From ad75c85fe281583ea92177a3995b45a89d2c4be3 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 15 Jan 2026 22:05:19 +0000 Subject: [PATCH 1/2] feat: updated v3 dialogflow client libraries docs: updated v3 dialogflow client libraries fix!: An existing field `start_flow` is moved in to oneof in message `.google.cloud.dialogflow.cx.v3.Agent` fix!: An existing field `webhook_ids` is removed from message `.google.cloud.dialogflow.cx.v3.QueryResult` fix!: An existing field `webhook_display_names` is removed from message `.google.cloud.dialogflow.cx.v3.QueryResult` fix!: An existing field `webhook_latencies` is removed from message `.google.cloud.dialogflow.cx.v3.QueryResult` fix!: An existing field `webhook_tags` is removed from message `.google.cloud.dialogflow.cx.v3.QueryResult` PiperOrigin-RevId: 856725401 Source-Link: https://github.com/googleapis/googleapis/commit/b8d149138be9552543ed2ad7700d2d0bc1a0045d Source-Link: https://github.com/googleapis/googleapis-gen/commit/e575c14c05589e4033626c61405641d38e2a7c06 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3ctY3gtdjMvLk93bEJvdC55YW1sIiwiaCI6ImU1NzVjMTRjMDU1ODllNDAzMzYyNmM2MTQwNTY0MWQzOGUyYTdjMDYifQ== --- .../google-cloud-dialogflow-cx-v3/.gitignore | 22 + .../.repo-metadata.json | 19 + .../.rubocop.yml | 33 + .../google-cloud-dialogflow-cx-v3/.toys.rb | 28 + .../google-cloud-dialogflow-cx-v3/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-dialogflow-cx-v3/Gemfile | 11 + .../google-cloud-dialogflow-cx-v3/LICENSE.md | 201 + .../google-cloud-dialogflow-cx-v3/README.md | 154 + .../google-cloud-dialogflow-cx-v3/Rakefile | 169 + .../gapic_metadata.json | 874 +++ .../google-cloud-dialogflow-cx-v3.gemspec | 29 + .../lib/google-cloud-dialogflow-cx-v3.rb | 21 + .../lib/google/cloud/dialogflow/cx/v3.rb | 66 + .../dialogflow/cx/v3/advanced_settings_pb.rb | 53 + .../google/cloud/dialogflow/cx/v3/agent_pb.rb | 88 + .../dialogflow/cx/v3/agent_services_pb.rb | 103 + .../google/cloud/dialogflow/cx/v3/agents.rb | 58 + .../cloud/dialogflow/cx/v3/agents/client.rb | 1569 +++++ .../dialogflow/cx/v3/agents/credentials.rb | 54 + .../dialogflow/cx/v3/agents/operations.rb | 843 +++ .../cloud/dialogflow/cx/v3/agents/paths.rb | 210 + .../cloud/dialogflow/cx/v3/agents/rest.rb | 56 + .../dialogflow/cx/v3/agents/rest/client.rb | 1457 +++++ .../cx/v3/agents/rest/operations.rb | 947 +++ .../cx/v3/agents/rest/service_stub.rb | 760 +++ .../cloud/dialogflow/cx/v3/audio_config_pb.rb | 59 + .../dialogflow/cx/v3/bindings_override.rb | 77 + .../cloud/dialogflow/cx/v3/changelog_pb.rb | 54 + .../dialogflow/cx/v3/changelog_services_pb.rb | 49 + .../cloud/dialogflow/cx/v3/changelogs.rb | 57 + .../dialogflow/cx/v3/changelogs/client.rb | 624 ++ .../cx/v3/changelogs/credentials.rb | 54 + .../dialogflow/cx/v3/changelogs/paths.rb | 75 + .../cloud/dialogflow/cx/v3/changelogs/rest.rb | 55 + .../cx/v3/changelogs/rest/client.rb | 575 ++ .../cx/v3/changelogs/rest/service_stub.rb | 205 + .../cloud/dialogflow/cx/v3/code_block_pb.rb | 46 + .../cx/v3/data_store_connection_pb.rb | 62 + .../cloud/dialogflow/cx/v3/deployment_pb.rb | 56 + .../cx/v3/deployment_services_pb.rb | 51 + .../cloud/dialogflow/cx/v3/deployments.rb | 57 + .../dialogflow/cx/v3/deployments/client.rb | 606 ++ .../cx/v3/deployments/credentials.rb | 54 + .../dialogflow/cx/v3/deployments/paths.rb | 79 + .../dialogflow/cx/v3/deployments/rest.rb | 55 + .../cx/v3/deployments/rest/client.rb | 557 ++ .../cx/v3/deployments/rest/service_stub.rb | 205 + .../cloud/dialogflow/cx/v3/entity_type_pb.rb | 74 + .../cx/v3/entity_type_services_pb.rb | 71 + .../cloud/dialogflow/cx/v3/entity_types.rb | 58 + .../dialogflow/cx/v3/entity_types/client.rb | 1243 ++++ .../cx/v3/entity_types/credentials.rb | 54 + .../cx/v3/entity_types/operations.rb | 843 +++ .../dialogflow/cx/v3/entity_types/paths.rb | 75 + .../dialogflow/cx/v3/entity_types/rest.rb | 56 + .../cx/v3/entity_types/rest/client.rb | 1159 ++++ .../cx/v3/entity_types/rest/operations.rb | 947 +++ .../cx/v3/entity_types/rest/service_stub.rb | 514 ++ .../cloud/dialogflow/cx/v3/environment_pb.rb | 81 + .../cx/v3/environment_services_pb.rb | 106 + .../cloud/dialogflow/cx/v3/environments.rb | 59 + .../dialogflow/cx/v3/environments/client.rb | 1382 +++++ .../cx/v3/environments/credentials.rb | 54 + .../cx/v3/environments/operations.rb | 843 +++ .../dialogflow/cx/v3/environments/paths.rb | 180 + .../dialogflow/cx/v3/environments/rest.rb | 57 + .../cx/v3/environments/rest/client.rb | 1284 ++++ .../cx/v3/environments/rest/operations.rb | 947 +++ .../cx/v3/environments/rest/service_stub.rb | 636 ++ .../cloud/dialogflow/cx/v3/example_pb.rb | 62 + .../dialogflow/cx/v3/example_services_pb.rb | 55 + .../google/cloud/dialogflow/cx/v3/examples.rb | 57 + .../cloud/dialogflow/cx/v3/examples/client.rb | 894 +++ .../dialogflow/cx/v3/examples/credentials.rb | 54 + .../cloud/dialogflow/cx/v3/examples/paths.rb | 121 + .../cloud/dialogflow/cx/v3/examples/rest.rb | 55 + .../dialogflow/cx/v3/examples/rest/client.rb | 824 +++ .../cx/v3/examples/rest/service_stub.rb | 390 ++ .../cloud/dialogflow/cx/v3/experiment_pb.rb | 78 + .../cx/v3/experiment_services_pb.rb | 67 + .../cloud/dialogflow/cx/v3/experiments.rb | 57 + .../dialogflow/cx/v3/experiments/client.rb | 1084 ++++ .../cx/v3/experiments/credentials.rb | 54 + .../dialogflow/cx/v3/experiments/paths.rb | 102 + .../dialogflow/cx/v3/experiments/rest.rb | 55 + .../cx/v3/experiments/rest/client.rb | 1000 +++ .../cx/v3/experiments/rest/service_stub.rb | 514 ++ .../google/cloud/dialogflow/cx/v3/flow_pb.rb | 85 + .../dialogflow/cx/v3/flow_services_pb.rb | 115 + .../google/cloud/dialogflow/cx/v3/flows.rb | 58 + .../cloud/dialogflow/cx/v3/flows/client.rb | 1550 +++++ .../dialogflow/cx/v3/flows/credentials.rb | 54 + .../dialogflow/cx/v3/flows/operations.rb | 843 +++ .../cloud/dialogflow/cx/v3/flows/paths.rb | 273 + .../cloud/dialogflow/cx/v3/flows/rest.rb | 56 + .../dialogflow/cx/v3/flows/rest/client.rb | 1445 +++++ .../dialogflow/cx/v3/flows/rest/operations.rb | 947 +++ .../cx/v3/flows/rest/service_stub.rb | 699 +++ .../cloud/dialogflow/cx/v3/fulfillment_pb.rb | 58 + .../google/cloud/dialogflow/cx/v3/gcs_pb.rb | 46 + .../cx/v3/generative_settings_pb.rb | 52 + .../cloud/dialogflow/cx/v3/generator_pb.rb | 63 + .../dialogflow/cx/v3/generator_services_pb.rb | 55 + .../cloud/dialogflow/cx/v3/generators.rb | 57 + .../dialogflow/cx/v3/generators/client.rb | 906 +++ .../cx/v3/generators/credentials.rb | 54 + .../dialogflow/cx/v3/generators/paths.rb | 75 + .../cloud/dialogflow/cx/v3/generators/rest.rb | 55 + .../cx/v3/generators/rest/client.rb | 836 +++ .../cx/v3/generators/rest/service_stub.rb | 390 ++ .../dialogflow/cx/v3/import_strategy_pb.rb | 44 + .../cloud/dialogflow/cx/v3/inline_pb.rb | 47 + .../cloud/dialogflow/cx/v3/intent_pb.rb | 74 + .../dialogflow/cx/v3/intent_services_pb.rb | 89 + .../google/cloud/dialogflow/cx/v3/intents.rb | 58 + .../cloud/dialogflow/cx/v3/intents/client.rb | 1221 ++++ .../dialogflow/cx/v3/intents/credentials.rb | 54 + .../dialogflow/cx/v3/intents/operations.rb | 843 +++ .../cloud/dialogflow/cx/v3/intents/paths.rb | 96 + .../cloud/dialogflow/cx/v3/intents/rest.rb | 56 + .../dialogflow/cx/v3/intents/rest/client.rb | 1137 ++++ .../cx/v3/intents/rest/operations.rb | 947 +++ .../cx/v3/intents/rest/service_stub.rb | 514 ++ .../google/cloud/dialogflow/cx/v3/page_pb.rb | 72 + .../dialogflow/cx/v3/page_services_pb.rb | 67 + .../google/cloud/dialogflow/cx/v3/pages.rb | 57 + .../cloud/dialogflow/cx/v3/pages/client.rb | 998 +++ .../dialogflow/cx/v3/pages/credentials.rb | 54 + .../cloud/dialogflow/cx/v3/pages/paths.rb | 254 + .../cloud/dialogflow/cx/v3/pages/rest.rb | 55 + .../dialogflow/cx/v3/pages/rest/client.rb | 928 +++ .../cx/v3/pages/rest/service_stub.rb | 390 ++ .../cx/v3/parameter_definition_pb.rb | 51 + .../cloud/dialogflow/cx/v3/playbook_pb.rb | 94 + .../dialogflow/cx/v3/playbook_services_pb.rb | 73 + .../cloud/dialogflow/cx/v3/playbooks.rb | 58 + .../dialogflow/cx/v3/playbooks/client.rb | 1620 +++++ .../dialogflow/cx/v3/playbooks/credentials.rb | 54 + .../dialogflow/cx/v3/playbooks/operations.rb | 843 +++ .../cloud/dialogflow/cx/v3/playbooks/paths.rb | 205 + .../cloud/dialogflow/cx/v3/playbooks/rest.rb | 56 + .../dialogflow/cx/v3/playbooks/rest/client.rb | 1501 +++++ .../cx/v3/playbooks/rest/operations.rb | 947 +++ .../cx/v3/playbooks/rest/service_stub.rb | 821 +++ .../dialogflow/cx/v3/response_message_pb.rb | 61 + .../lib/google/cloud/dialogflow/cx/v3/rest.rb | 59 + .../dialogflow/cx/v3/safety_settings_pb.rb | 53 + .../dialogflow/cx/v3/security_settings_pb.rb | 65 + .../cx/v3/security_settings_service.rb | 57 + .../cx/v3/security_settings_service/client.rb | 894 +++ .../security_settings_service/credentials.rb | 54 + .../cx/v3/security_settings_service/paths.rb | 157 + .../cx/v3/security_settings_service/rest.rb | 55 + .../security_settings_service/rest/client.rb | 824 +++ .../rest/service_stub.rb | 390 ++ .../cx/v3/security_settings_services_pb.rb | 59 + .../cx/v3/session_entity_type_pb.rb | 61 + .../cx/v3/session_entity_type_services_pb.rb | 56 + .../dialogflow/cx/v3/session_entity_types.rb | 58 + .../cx/v3/session_entity_types/client.rb | 911 +++ .../cx/v3/session_entity_types/credentials.rb | 54 + .../cx/v3/session_entity_types/paths.rb | 137 + .../cx/v3/session_entity_types/rest.rb | 56 + .../cx/v3/session_entity_types/rest/client.rb | 841 +++ .../session_entity_types/rest/service_stub.rb | 427 ++ .../cloud/dialogflow/cx/v3/session_pb.rb | 115 + .../dialogflow/cx/v3/session_services_pb.rb | 85 + .../google/cloud/dialogflow/cx/v3/sessions.rb | 60 + .../cloud/dialogflow/cx/v3/sessions/client.rb | 1073 ++++ .../dialogflow/cx/v3/sessions/credentials.rb | 54 + .../cloud/dialogflow/cx/v3/sessions/paths.rb | 312 + .../cloud/dialogflow/cx/v3/sessions/rest.rb | 58 + .../dialogflow/cx/v3/sessions/rest/client.rb | 912 +++ .../cx/v3/sessions/rest/service_stub.rb | 419 ++ .../cloud/dialogflow/cx/v3/test_case_pb.rb | 115 + .../dialogflow/cx/v3/test_case_services_pb.rb | 110 + .../cloud/dialogflow/cx/v3/test_cases.rb | 59 + .../dialogflow/cx/v3/test_cases/client.rb | 1729 ++++++ .../cx/v3/test_cases/credentials.rb | 54 + .../dialogflow/cx/v3/test_cases/operations.rb | 843 +++ .../dialogflow/cx/v3/test_cases/paths.rb | 338 + .../cloud/dialogflow/cx/v3/test_cases/rest.rb | 57 + .../cx/v3/test_cases/rest/client.rb | 1610 +++++ .../cx/v3/test_cases/rest/operations.rb | 947 +++ .../cx/v3/test_cases/rest/service_stub.rb | 822 +++ .../cloud/dialogflow/cx/v3/tool_call_pb.rb | 51 + .../google/cloud/dialogflow/cx/v3/tool_pb.rb | 89 + .../dialogflow/cx/v3/tool_services_pb.rb | 71 + .../google/cloud/dialogflow/cx/v3/tools.rb | 57 + .../cloud/dialogflow/cx/v3/tools/client.rb | 1392 +++++ .../dialogflow/cx/v3/tools/credentials.rb | 54 + .../cloud/dialogflow/cx/v3/tools/paths.rb | 138 + .../cloud/dialogflow/cx/v3/tools/rest.rb | 55 + .../dialogflow/cx/v3/tools/rest/client.rb | 1287 ++++ .../cx/v3/tools/rest/service_stub.rb | 697 +++ .../google/cloud/dialogflow/cx/v3/trace_pb.rb | 59 + .../cx/v3/transition_route_group_pb.rb | 60 + .../v3/transition_route_group_services_pb.rb | 73 + .../cx/v3/transition_route_groups.rb | 58 + .../cx/v3/transition_route_groups/client.rb | 974 +++ .../v3/transition_route_groups/credentials.rb | 54 + .../cx/v3/transition_route_groups/paths.rb | 231 + .../cx/v3/transition_route_groups/rest.rb | 56 + .../v3/transition_route_groups/rest/client.rb | 904 +++ .../rest/service_stub.rb | 427 ++ .../dialogflow/cx/v3/validation_message_pb.rb | 47 + .../google/cloud/dialogflow/cx/v3/version.rb | 30 + .../cloud/dialogflow/cx/v3/version_pb.rb | 69 + .../dialogflow/cx/v3/version_services_pb.rb | 78 + .../google/cloud/dialogflow/cx/v3/versions.rb | 58 + .../cloud/dialogflow/cx/v3/versions/client.rb | 1148 ++++ .../dialogflow/cx/v3/versions/credentials.rb | 54 + .../dialogflow/cx/v3/versions/operations.rb | 843 +++ .../cloud/dialogflow/cx/v3/versions/paths.rb | 79 + .../cloud/dialogflow/cx/v3/versions/rest.rb | 56 + .../dialogflow/cx/v3/versions/rest/client.rb | 1064 ++++ .../cx/v3/versions/rest/operations.rb | 947 +++ .../cx/v3/versions/rest/service_stub.rb | 514 ++ .../cloud/dialogflow/cx/v3/webhook_pb.rb | 86 + .../dialogflow/cx/v3/webhook_services_pb.rb | 55 + .../google/cloud/dialogflow/cx/v3/webhooks.rb | 57 + .../cloud/dialogflow/cx/v3/webhooks/client.rb | 898 +++ .../dialogflow/cx/v3/webhooks/credentials.rb | 54 + .../cloud/dialogflow/cx/v3/webhooks/paths.rb | 115 + .../cloud/dialogflow/cx/v3/webhooks/rest.rb | 55 + .../dialogflow/cx/v3/webhooks/rest/client.rb | 828 +++ .../cx/v3/webhooks/rest/service_stub.rb | 390 ++ .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../dialogflow/cx/v3/advanced_settings.rb | 150 + .../google/cloud/dialogflow/cx/v3/agent.rb | 576 ++ .../cloud/dialogflow/cx/v3/audio_config.rb | 401 ++ .../cloud/dialogflow/cx/v3/changelog.rb | 128 + .../cloud/dialogflow/cx/v3/code_block.rb | 37 + .../dialogflow/cx/v3/data_store_connection.rb | 282 + .../cloud/dialogflow/cx/v3/deployment.rb | 138 + .../cloud/dialogflow/cx/v3/entity_type.rb | 519 ++ .../cloud/dialogflow/cx/v3/environment.rb | 380 ++ .../google/cloud/dialogflow/cx/v3/example.rb | 173 + .../cloud/dialogflow/cx/v3/experiment.rb | 450 ++ .../google/cloud/dialogflow/cx/v3/flow.rb | 536 ++ .../cloud/dialogflow/cx/v3/fulfillment.rb | 188 + .../google/cloud/dialogflow/cx/v3/gcs.rb | 40 + .../dialogflow/cx/v3/generative_settings.rb | 128 + .../cloud/dialogflow/cx/v3/generator.rb | 223 + .../cloud/dialogflow/cx/v3/import_strategy.rb | 54 + .../google/cloud/dialogflow/cx/v3/inline.rb | 49 + .../google/cloud/dialogflow/cx/v3/intent.rb | 517 ++ .../google/cloud/dialogflow/cx/v3/page.rb | 578 ++ .../dialogflow/cx/v3/parameter_definition.rb | 137 + .../google/cloud/dialogflow/cx/v3/playbook.rb | 546 ++ .../dialogflow/cx/v3/response_message.rb | 319 + .../cloud/dialogflow/cx/v3/safety_settings.rb | 143 + .../dialogflow/cx/v3/security_settings.rb | 327 + .../google/cloud/dialogflow/cx/v3/session.rb | 1348 ++++ .../dialogflow/cx/v3/session_entity_type.rb | 193 + .../cloud/dialogflow/cx/v3/test_case.rb | 835 +++ .../google/cloud/dialogflow/cx/v3/tool.rb | 588 ++ .../cloud/dialogflow/cx/v3/tool_call.rb | 78 + .../google/cloud/dialogflow/cx/v3/trace.rb | 224 + .../cx/v3/transition_route_group.rb | 212 + .../dialogflow/cx/v3/validation_message.rb | 125 + .../google/cloud/dialogflow/cx/v3/version.rb | 235 + .../google/cloud/dialogflow/cx/v3/webhook.rb | 782 +++ .../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/create_agent.rb | 47 + .../snippets/agents/delete_agent.rb | 47 + .../snippets/agents/export_agent.rb | 54 + .../snippets/agents/get_agent.rb | 47 + .../agents/get_agent_validation_result.rb | 47 + .../agents/get_generative_settings.rb | 47 + .../snippets/agents/list_agents.rb | 51 + .../snippets/agents/restore_agent.rb | 54 + .../snippets/agents/update_agent.rb | 47 + .../agents/update_generative_settings.rb | 47 + .../snippets/agents/validate_agent.rb | 47 + .../snippets/changelogs/get_changelog.rb | 47 + .../snippets/changelogs/list_changelogs.rb | 51 + .../snippets/deployments/get_deployment.rb | 47 + .../snippets/deployments/list_deployments.rb | 51 + .../entity_types/create_entity_type.rb | 47 + .../entity_types/delete_entity_type.rb | 47 + .../entity_types/export_entity_types.rb | 54 + .../snippets/entity_types/get_entity_type.rb | 47 + .../entity_types/import_entity_types.rb | 54 + .../entity_types/list_entity_types.rb | 51 + .../entity_types/update_entity_type.rb | 47 + .../environments/create_environment.rb | 54 + .../environments/delete_environment.rb | 47 + .../snippets/environments/deploy_flow.rb | 54 + .../snippets/environments/get_environment.rb | 47 + .../list_continuous_test_results.rb | 51 + .../environments/list_environments.rb | 51 + .../lookup_environment_history.rb | 51 + .../environments/run_continuous_test.rb | 54 + .../environments/update_environment.rb | 54 + .../snippets/examples/create_example.rb | 47 + .../snippets/examples/delete_example.rb | 47 + .../snippets/examples/get_example.rb | 47 + .../snippets/examples/list_examples.rb | 51 + .../snippets/examples/update_example.rb | 47 + .../snippets/experiments/create_experiment.rb | 47 + .../snippets/experiments/delete_experiment.rb | 47 + .../snippets/experiments/get_experiment.rb | 47 + .../snippets/experiments/list_experiments.rb | 51 + .../snippets/experiments/start_experiment.rb | 47 + .../snippets/experiments/stop_experiment.rb | 47 + .../snippets/experiments/update_experiment.rb | 47 + .../snippets/flows/create_flow.rb | 47 + .../snippets/flows/delete_flow.rb | 47 + .../snippets/flows/export_flow.rb | 54 + .../snippets/flows/get_flow.rb | 47 + .../flows/get_flow_validation_result.rb | 47 + .../snippets/flows/import_flow.rb | 54 + .../snippets/flows/list_flows.rb | 51 + .../snippets/flows/train_flow.rb | 54 + .../snippets/flows/update_flow.rb | 47 + .../snippets/flows/validate_flow.rb | 47 + .../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/create_intent.rb | 47 + .../snippets/intents/delete_intent.rb | 47 + .../snippets/intents/export_intents.rb | 54 + .../snippets/intents/get_intent.rb | 47 + .../snippets/intents/import_intents.rb | 54 + .../snippets/intents/list_intents.rb | 51 + .../snippets/intents/update_intent.rb | 47 + .../snippets/pages/create_page.rb | 47 + .../snippets/pages/delete_page.rb | 47 + .../snippets/pages/get_page.rb | 47 + .../snippets/pages/list_pages.rb | 51 + .../snippets/pages/update_page.rb | 47 + .../snippets/playbooks/create_playbook.rb | 47 + .../playbooks/create_playbook_version.rb | 47 + .../snippets/playbooks/delete_playbook.rb | 47 + .../playbooks/delete_playbook_version.rb | 47 + .../snippets/playbooks/export_playbook.rb | 54 + .../snippets/playbooks/get_playbook.rb | 47 + .../playbooks/get_playbook_version.rb | 47 + .../snippets/playbooks/import_playbook.rb | 54 + .../playbooks/list_playbook_versions.rb | 51 + .../snippets/playbooks/list_playbooks.rb | 51 + .../playbooks/restore_playbook_version.rb | 47 + .../snippets/playbooks/update_playbook.rb | 47 + .../create_security_settings.rb | 47 + .../delete_security_settings.rb | 47 + .../get_security_settings.rb | 47 + .../list_security_settings.rb | 51 + .../update_security_settings.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 + .../snippets/sessions/fulfill_intent.rb | 47 + .../snippets/sessions/match_intent.rb | 47 + .../server_streaming_detect_intent.rb | 50 + .../sessions/streaming_detect_intent.rb | 56 + .../sessions/submit_answer_feedback.rb | 47 + ...etadata_google.cloud.dialogflow.cx.v3.json | 5495 +++++++++++++++++ .../test_cases/batch_delete_test_cases.rb | 47 + .../test_cases/batch_run_test_cases.rb | 54 + .../snippets/test_cases/calculate_coverage.rb | 47 + .../snippets/test_cases/create_test_case.rb | 47 + .../snippets/test_cases/export_test_cases.rb | 54 + .../snippets/test_cases/get_test_case.rb | 47 + .../test_cases/get_test_case_result.rb | 47 + .../snippets/test_cases/import_test_cases.rb | 54 + .../test_cases/list_test_case_results.rb | 51 + .../snippets/test_cases/list_test_cases.rb | 51 + .../snippets/test_cases/run_test_case.rb | 54 + .../snippets/test_cases/update_test_case.rb | 47 + .../snippets/tools/create_tool.rb | 47 + .../snippets/tools/create_tool_version.rb | 47 + .../snippets/tools/delete_tool.rb | 47 + .../snippets/tools/delete_tool_version.rb | 47 + .../snippets/tools/get_tool.rb | 47 + .../snippets/tools/get_tool_version.rb | 47 + .../snippets/tools/list_tool_versions.rb | 51 + .../snippets/tools/list_tools.rb | 51 + .../snippets/tools/restore_tool_version.rb | 47 + .../snippets/tools/update_tool.rb | 47 + .../create_transition_route_group.rb | 47 + .../delete_transition_route_group.rb | 47 + .../get_transition_route_group.rb | 47 + .../list_transition_route_groups.rb | 51 + .../update_transition_route_group.rb | 47 + .../snippets/versions/compare_versions.rb | 47 + .../snippets/versions/create_version.rb | 54 + .../snippets/versions/delete_version.rb | 47 + .../snippets/versions/get_version.rb | 47 + .../snippets/versions/list_versions.rb | 51 + .../snippets/versions/load_version.rb | 54 + .../snippets/versions/update_version.rb | 47 + .../snippets/webhooks/create_webhook.rb | 47 + .../snippets/webhooks/delete_webhook.rb | 47 + .../snippets/webhooks/get_webhook.rb | 47 + .../snippets/webhooks/list_webhooks.rb | 51 + .../snippets/webhooks/update_webhook.rb | 47 + .../cx/v3/agents_operations_test.rb | 400 ++ .../dialogflow/cx/v3/agents_paths_test.rb | 151 + .../dialogflow/cx/v3/agents_rest_test.rb | 708 +++ .../cloud/dialogflow/cx/v3/agents_test.rb | 802 +++ .../dialogflow/cx/v3/changelogs_paths_test.rb | 67 + .../dialogflow/cx/v3/changelogs_rest_test.rb | 210 + .../cloud/dialogflow/cx/v3/changelogs_test.rb | 231 + .../cx/v3/deployments_paths_test.rb | 67 + .../dialogflow/cx/v3/deployments_rest_test.rb | 209 + .../dialogflow/cx/v3/deployments_test.rb | 229 + .../cx/v3/entity_types_operations_test.rb | 400 ++ .../cx/v3/entity_types_paths_test.rb | 67 + .../cx/v3/entity_types_rest_test.rb | 493 ++ .../dialogflow/cx/v3/entity_types_test.rb | 573 ++ .../cx/v3/environments_operations_test.rb | 400 ++ .../cx/v3/environments_paths_test.rb | 127 + .../cx/v3/environments_rest_test.rb | 594 ++ .../dialogflow/cx/v3/environments_test.rb | 693 +++ .../dialogflow/cx/v3/examples_paths_test.rb | 91 + .../dialogflow/cx/v3/examples_rest_test.rb | 374 ++ .../cloud/dialogflow/cx/v3/examples_test.rb | 409 ++ .../cx/v3/experiments_paths_test.rb | 79 + .../dialogflow/cx/v3/experiments_rest_test.rb | 481 ++ .../dialogflow/cx/v3/experiments_test.rb | 523 ++ .../dialogflow/cx/v3/flows_operations_test.rb | 400 ++ .../dialogflow/cx/v3/flows_paths_test.rb | 166 + .../cloud/dialogflow/cx/v3/flows_rest_test.rb | 655 ++ .../cloud/dialogflow/cx/v3/flows_test.rb | 751 +++ .../dialogflow/cx/v3/generators_paths_test.rb | 67 + .../dialogflow/cx/v3/generators_rest_test.rb | 378 ++ .../cloud/dialogflow/cx/v3/generators_test.rb | 417 ++ .../cx/v3/intents_operations_test.rb | 400 ++ .../dialogflow/cx/v3/intents_paths_test.rb | 79 + .../dialogflow/cx/v3/intents_rest_test.rb | 491 ++ .../cloud/dialogflow/cx/v3/intents_test.rb | 569 ++ .../dialogflow/cx/v3/pages_paths_test.rb | 154 + .../cloud/dialogflow/cx/v3/pages_rest_test.rb | 378 ++ .../cloud/dialogflow/cx/v3/pages_test.rb | 417 ++ .../cx/v3/playbooks_operations_test.rb | 400 ++ .../dialogflow/cx/v3/playbooks_paths_test.rb | 139 + .../dialogflow/cx/v3/playbooks_rest_test.rb | 758 +++ .../cloud/dialogflow/cx/v3/playbooks_test.rb | 857 +++ .../security_settings_service_paths_test.rb | 97 + .../v3/security_settings_service_rest_test.rb | 373 ++ .../cx/v3/security_settings_service_test.rb | 407 ++ .../cx/v3/session_entity_types_paths_test.rb | 73 + .../cx/v3/session_entity_types_rest_test.rb | 373 ++ .../cx/v3/session_entity_types_test.rb | 407 ++ .../dialogflow/cx/v3/sessions_paths_test.rb | 160 + .../dialogflow/cx/v3/sessions_rest_test.rb | 385 ++ .../cloud/dialogflow/cx/v3/sessions_test.rb | 541 ++ .../cx/v3/test_cases_operations_test.rb | 400 ++ .../dialogflow/cx/v3/test_cases_paths_test.rb | 202 + .../dialogflow/cx/v3/test_cases_rest_test.rb | 764 +++ .../cloud/dialogflow/cx/v3/test_cases_test.rb | 880 +++ .../dialogflow/cx/v3/tools_paths_test.rb | 103 + .../cloud/dialogflow/cx/v3/tools_rest_test.rb | 648 ++ .../cloud/dialogflow/cx/v3/tools_test.rb | 712 +++ .../v3/transition_route_groups_paths_test.rb | 142 + .../v3/transition_route_groups_rest_test.rb | 378 ++ .../cx/v3/transition_route_groups_test.rb | 417 ++ .../cx/v3/versions_operations_test.rb | 400 ++ .../dialogflow/cx/v3/versions_paths_test.rb | 67 + .../dialogflow/cx/v3/versions_rest_test.rb | 484 ++ .../cloud/dialogflow/cx/v3/versions_test.rb | 553 ++ .../dialogflow/cx/v3/webhooks_paths_test.rb | 91 + .../dialogflow/cx/v3/webhooks_rest_test.rb | 374 ++ .../cloud/dialogflow/cx/v3/webhooks_test.rb | 409 ++ .../test/helper.rb | 25 + 486 files changed, 131939 insertions(+) create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/.gitignore create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/.toys.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/.yardopts create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/Gemfile create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/README.md create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/Rakefile create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/google-cloud-dialogflow-cx-v3.gemspec create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google-cloud-dialogflow-cx-v3.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/advanced_settings_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agent_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/audio_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelog_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelog_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/code_block_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/data_store_connection_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployment_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployment_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_type_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_type_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environment_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environment_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/example_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/example_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiment_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiment_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flow_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/fulfillment_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/gcs_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generative_settings_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generator_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generator_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/import_strategy_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/inline_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intent_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intent_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/page_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/page_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/parameter_definition_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbook_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbook_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/response_message_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/safety_settings_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_type_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_type_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_case_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_case_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_call_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/trace_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_group_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_group_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/validation_message_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhook_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/advanced_settings.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/changelog.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/code_block.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/data_store_connection.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/deployment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/entity_type.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/environment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/example.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/experiment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/fulfillment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/gcs.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generative_settings.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generator.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/import_strategy.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/inline.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/intent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/page.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/parameter_definition.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/playbook.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/safety_settings.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/session.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/session_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/test_case.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/tool.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/tool_call.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/trace.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/transition_route_group.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/validation_message.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/version.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/struct.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/type/latlng.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/create_agent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/delete_agent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/export_agent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent_validation_result.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_generative_settings.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/list_agents.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/restore_agent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/update_agent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/update_generative_settings.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/validate_agent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/changelogs/get_changelog.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/changelogs/list_changelogs.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/deployments/get_deployment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/deployments/list_deployments.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/create_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/delete_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/export_entity_types.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/get_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/import_entity_types.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/list_entity_types.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/update_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/create_environment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/delete_environment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/deploy_flow.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/get_environment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/list_continuous_test_results.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/list_environments.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/lookup_environment_history.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/run_continuous_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/update_environment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/create_example.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/delete_example.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/get_example.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/list_examples.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/update_example.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/create_experiment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/delete_experiment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/get_experiment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/list_experiments.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/start_experiment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/stop_experiment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/update_experiment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/create_flow.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/delete_flow.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/export_flow.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow_validation_result.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/import_flow.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/list_flows.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/train_flow.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/update_flow.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/validate_flow.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/create_generator.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/delete_generator.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/get_generator.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/list_generators.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/update_generator.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/create_intent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/delete_intent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/export_intents.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/get_intent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/import_intents.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/list_intents.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/update_intent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/create_page.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/delete_page.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/get_page.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/list_pages.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/update_page.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/create_playbook.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/create_playbook_version.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/delete_playbook.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/delete_playbook_version.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/export_playbook.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/get_playbook.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/get_playbook_version.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/import_playbook.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/list_playbook_versions.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/list_playbooks.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/restore_playbook_version.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/update_playbook.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/create_security_settings.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/delete_security_settings.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/get_security_settings.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/list_security_settings.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/update_security_settings.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/create_session_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/delete_session_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/get_session_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/list_session_entity_types.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/update_session_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/detect_intent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/fulfill_intent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/match_intent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/server_streaming_detect_intent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/streaming_detect_intent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/submit_answer_feedback.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/snippet_metadata_google.cloud.dialogflow.cx.v3.json create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_delete_test_cases.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_run_test_cases.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/calculate_coverage.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/create_test_case.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/export_test_cases.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case_result.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/import_test_cases.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_case_results.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_cases.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/run_test_case.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/update_test_case.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/create_tool.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/create_tool_version.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/delete_tool.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/delete_tool_version.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/get_tool.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/get_tool_version.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/list_tool_versions.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/list_tools.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/restore_tool_version.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/update_tool.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/create_transition_route_group.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/delete_transition_route_group.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/get_transition_route_group.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/list_transition_route_groups.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/update_transition_route_group.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/compare_versions.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/create_version.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/delete_version.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/get_version.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/list_versions.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/load_version.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/update_version.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/create_webhook.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/delete_webhook.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/get_webhook.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/list_webhooks.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/update_webhook.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/helper.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/.gitignore b/owl-bot-staging/google-cloud-dialogflow-cx-v3/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/.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-cx-v3/.repo-metadata.json b/owl-bot-staging/google-cloud-dialogflow-cx-v3/.repo-metadata.json new file mode 100644 index 000000000000..2ba78224f798 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/.repo-metadata.json @@ -0,0 +1,19 @@ +{ + "api_id": "dialogflow.googleapis.com", + "api_shortname": "dialogflow", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-cx-v3/latest", + "distribution_name": "google-cloud-dialogflow-cx-v3", + "is_cloud": true, + "language": "ruby", + "name": "dialogflow", + "name_pretty": "Dialogflow CX V3 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 CX, providing an advanced agent type suitable for large or very complex agents. Note that google-cloud-dialogflow-cx-v3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-dialogflow-cx instead. See the readme for more details.", + "ruby-cloud-env-prefix": "DIALOGFLOW", + "ruby-cloud-product-url": "https://cloud.google.com/dialogflow", + "ruby-cloud-namespace-override": "Cx=CX", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/.rubocop.yml b/owl-bot-staging/google-cloud-dialogflow-cx-v3/.rubocop.yml new file mode 100644 index 000000000000..a6b50c67bede --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-dialogflow-cx-v3.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-cx-v3.rb" diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/.toys.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/.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-cx-v3/.yardopts b/owl-bot-staging/google-cloud-dialogflow-cx-v3/.yardopts new file mode 100644 index 000000000000..cfa57b102370 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Dialogflow CX V3 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-cx-v3/AUTHENTICATION.md b/owl-bot-staging/google-cloud-dialogflow-cx-v3/AUTHENTICATION.md new file mode 100644 index 000000000000..7f0de856d6c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-dialogflow-cx-v3 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-cx-v3 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/cx/v3" + +client = ::Google::Cloud::Dialogflow::CX::V3::Pages::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/cx/v3" + +::Google::Cloud::Dialogflow::CX::V3::Pages::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Dialogflow::CX::V3::Pages::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-cx-v3 +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/cx/v3" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Dialogflow::CX::V3::Pages::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-cx-v3/CHANGELOG.md b/owl-bot-staging/google-cloud-dialogflow-cx-v3/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/Gemfile b/owl-bot-staging/google-cloud-dialogflow-cx-v3/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/LICENSE.md b/owl-bot-staging/google-cloud-dialogflow-cx-v3/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/README.md b/owl-bot-staging/google-cloud-dialogflow-cx-v3/README.md new file mode 100644 index 000000000000..c994a736221b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Dialogflow CX V3 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 CX, providing an advanced agent type suitable for large or very complex 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 CX V3 API. Most users should consider using +the main client gem, +[google-cloud-dialogflow-cx](https://rubygems.org/gems/google-cloud-dialogflow-cx). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-dialogflow-cx-v3 +``` + +## 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/cx/v3" + +client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new +request = ::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest.new # (request fields as keyword arguments...) +response = client.list_pages request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-cx-v3/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/cx/v3" +require "logger" + +client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| + config.logger = Logger.new "my-app.log" +end +``` + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 3.0+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-cloud-dialogflow-cx`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-dialogflow-cx-v3`. +_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-cx`. +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-cx-v3`. + +### 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-cx-v3/Rakefile b/owl-bot-staging/google-cloud-dialogflow-cx-v3/Rakefile new file mode 100644 index 000000000000..f1b0bdc7fdba --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3 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/cx/v3/pages/credentials" + ::Google::Cloud::Dialogflow::CX::V3::Pages::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-cx-v3 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-cx-v3 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-cx-v3 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-cx-v3 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-dialogflow-cx-v3" + header "google-cloud-dialogflow-cx-v3 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-dialogflow-cx-v3 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-dialogflow-cx-v3 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-cx-v3 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-cx-v3 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-cx-v3/gapic_metadata.json b/owl-bot-staging/google-cloud-dialogflow-cx-v3/gapic_metadata.json new file mode 100644 index 000000000000..37c2bf5fa424 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/gapic_metadata.json @@ -0,0 +1,874 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.dialogflow.cx.v3", + "libraryPackage": "::Google::Cloud::Dialogflow::CX::V3", + "services": { + "Pages": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client", + "rpcs": { + "ListPages": { + "methods": [ + "list_pages" + ] + }, + "GetPage": { + "methods": [ + "get_page" + ] + }, + "CreatePage": { + "methods": [ + "create_page" + ] + }, + "UpdatePage": { + "methods": [ + "update_page" + ] + }, + "DeletePage": { + "methods": [ + "delete_page" + ] + } + } + } + } + }, + "Flows": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client", + "rpcs": { + "CreateFlow": { + "methods": [ + "create_flow" + ] + }, + "DeleteFlow": { + "methods": [ + "delete_flow" + ] + }, + "ListFlows": { + "methods": [ + "list_flows" + ] + }, + "GetFlow": { + "methods": [ + "get_flow" + ] + }, + "UpdateFlow": { + "methods": [ + "update_flow" + ] + }, + "TrainFlow": { + "methods": [ + "train_flow" + ] + }, + "ValidateFlow": { + "methods": [ + "validate_flow" + ] + }, + "GetFlowValidationResult": { + "methods": [ + "get_flow_validation_result" + ] + }, + "ImportFlow": { + "methods": [ + "import_flow" + ] + }, + "ExportFlow": { + "methods": [ + "export_flow" + ] + } + } + } + } + }, + "Agents": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client", + "rpcs": { + "ListAgents": { + "methods": [ + "list_agents" + ] + }, + "GetAgent": { + "methods": [ + "get_agent" + ] + }, + "CreateAgent": { + "methods": [ + "create_agent" + ] + }, + "UpdateAgent": { + "methods": [ + "update_agent" + ] + }, + "DeleteAgent": { + "methods": [ + "delete_agent" + ] + }, + "ExportAgent": { + "methods": [ + "export_agent" + ] + }, + "RestoreAgent": { + "methods": [ + "restore_agent" + ] + }, + "ValidateAgent": { + "methods": [ + "validate_agent" + ] + }, + "GetAgentValidationResult": { + "methods": [ + "get_agent_validation_result" + ] + }, + "GetGenerativeSettings": { + "methods": [ + "get_generative_settings" + ] + }, + "UpdateGenerativeSettings": { + "methods": [ + "update_generative_settings" + ] + } + } + } + } + }, + "Changelogs": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client", + "rpcs": { + "ListChangelogs": { + "methods": [ + "list_changelogs" + ] + }, + "GetChangelog": { + "methods": [ + "get_changelog" + ] + } + } + } + } + }, + "Deployments": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Deployments::Client", + "rpcs": { + "ListDeployments": { + "methods": [ + "list_deployments" + ] + }, + "GetDeployment": { + "methods": [ + "get_deployment" + ] + } + } + } + } + }, + "EntityTypes": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client", + "rpcs": { + "GetEntityType": { + "methods": [ + "get_entity_type" + ] + }, + "CreateEntityType": { + "methods": [ + "create_entity_type" + ] + }, + "UpdateEntityType": { + "methods": [ + "update_entity_type" + ] + }, + "DeleteEntityType": { + "methods": [ + "delete_entity_type" + ] + }, + "ListEntityTypes": { + "methods": [ + "list_entity_types" + ] + }, + "ExportEntityTypes": { + "methods": [ + "export_entity_types" + ] + }, + "ImportEntityTypes": { + "methods": [ + "import_entity_types" + ] + } + } + } + } + }, + "Intents": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client", + "rpcs": { + "ListIntents": { + "methods": [ + "list_intents" + ] + }, + "GetIntent": { + "methods": [ + "get_intent" + ] + }, + "CreateIntent": { + "methods": [ + "create_intent" + ] + }, + "UpdateIntent": { + "methods": [ + "update_intent" + ] + }, + "DeleteIntent": { + "methods": [ + "delete_intent" + ] + }, + "ImportIntents": { + "methods": [ + "import_intents" + ] + }, + "ExportIntents": { + "methods": [ + "export_intents" + ] + } + } + } + } + }, + "SessionEntityTypes": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Sessions::Client", + "rpcs": { + "DetectIntent": { + "methods": [ + "detect_intent" + ] + }, + "ServerStreamingDetectIntent": { + "methods": [ + "server_streaming_detect_intent" + ] + }, + "StreamingDetectIntent": { + "methods": [ + "streaming_detect_intent" + ] + }, + "MatchIntent": { + "methods": [ + "match_intent" + ] + }, + "FulfillIntent": { + "methods": [ + "fulfill_intent" + ] + }, + "SubmitAnswerFeedback": { + "methods": [ + "submit_answer_feedback" + ] + } + } + } + } + }, + "TransitionRouteGroups": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client", + "rpcs": { + "ListTransitionRouteGroups": { + "methods": [ + "list_transition_route_groups" + ] + }, + "GetTransitionRouteGroup": { + "methods": [ + "get_transition_route_group" + ] + }, + "CreateTransitionRouteGroup": { + "methods": [ + "create_transition_route_group" + ] + }, + "UpdateTransitionRouteGroup": { + "methods": [ + "update_transition_route_group" + ] + }, + "DeleteTransitionRouteGroup": { + "methods": [ + "delete_transition_route_group" + ] + } + } + } + } + }, + "TestCases": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client", + "rpcs": { + "ListTestCases": { + "methods": [ + "list_test_cases" + ] + }, + "BatchDeleteTestCases": { + "methods": [ + "batch_delete_test_cases" + ] + }, + "GetTestCase": { + "methods": [ + "get_test_case" + ] + }, + "CreateTestCase": { + "methods": [ + "create_test_case" + ] + }, + "UpdateTestCase": { + "methods": [ + "update_test_case" + ] + }, + "RunTestCase": { + "methods": [ + "run_test_case" + ] + }, + "BatchRunTestCases": { + "methods": [ + "batch_run_test_cases" + ] + }, + "CalculateCoverage": { + "methods": [ + "calculate_coverage" + ] + }, + "ImportTestCases": { + "methods": [ + "import_test_cases" + ] + }, + "ExportTestCases": { + "methods": [ + "export_test_cases" + ] + }, + "ListTestCaseResults": { + "methods": [ + "list_test_case_results" + ] + }, + "GetTestCaseResult": { + "methods": [ + "get_test_case_result" + ] + } + } + } + } + }, + "Webhooks": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client", + "rpcs": { + "ListWebhooks": { + "methods": [ + "list_webhooks" + ] + }, + "GetWebhook": { + "methods": [ + "get_webhook" + ] + }, + "CreateWebhook": { + "methods": [ + "create_webhook" + ] + }, + "UpdateWebhook": { + "methods": [ + "update_webhook" + ] + }, + "DeleteWebhook": { + "methods": [ + "delete_webhook" + ] + } + } + } + } + }, + "Environments": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client", + "rpcs": { + "ListEnvironments": { + "methods": [ + "list_environments" + ] + }, + "GetEnvironment": { + "methods": [ + "get_environment" + ] + }, + "CreateEnvironment": { + "methods": [ + "create_environment" + ] + }, + "UpdateEnvironment": { + "methods": [ + "update_environment" + ] + }, + "DeleteEnvironment": { + "methods": [ + "delete_environment" + ] + }, + "LookupEnvironmentHistory": { + "methods": [ + "lookup_environment_history" + ] + }, + "RunContinuousTest": { + "methods": [ + "run_continuous_test" + ] + }, + "ListContinuousTestResults": { + "methods": [ + "list_continuous_test_results" + ] + }, + "DeployFlow": { + "methods": [ + "deploy_flow" + ] + } + } + } + } + }, + "Examples": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client", + "rpcs": { + "CreateExample": { + "methods": [ + "create_example" + ] + }, + "DeleteExample": { + "methods": [ + "delete_example" + ] + }, + "ListExamples": { + "methods": [ + "list_examples" + ] + }, + "GetExample": { + "methods": [ + "get_example" + ] + }, + "UpdateExample": { + "methods": [ + "update_example" + ] + } + } + } + } + }, + "Experiments": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client", + "rpcs": { + "ListExperiments": { + "methods": [ + "list_experiments" + ] + }, + "GetExperiment": { + "methods": [ + "get_experiment" + ] + }, + "CreateExperiment": { + "methods": [ + "create_experiment" + ] + }, + "UpdateExperiment": { + "methods": [ + "update_experiment" + ] + }, + "DeleteExperiment": { + "methods": [ + "delete_experiment" + ] + }, + "StartExperiment": { + "methods": [ + "start_experiment" + ] + }, + "StopExperiment": { + "methods": [ + "stop_experiment" + ] + } + } + } + } + }, + "Generators": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client", + "rpcs": { + "ListGenerators": { + "methods": [ + "list_generators" + ] + }, + "GetGenerator": { + "methods": [ + "get_generator" + ] + }, + "CreateGenerator": { + "methods": [ + "create_generator" + ] + }, + "UpdateGenerator": { + "methods": [ + "update_generator" + ] + }, + "DeleteGenerator": { + "methods": [ + "delete_generator" + ] + } + } + } + } + }, + "Playbooks": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client", + "rpcs": { + "CreatePlaybook": { + "methods": [ + "create_playbook" + ] + }, + "DeletePlaybook": { + "methods": [ + "delete_playbook" + ] + }, + "ListPlaybooks": { + "methods": [ + "list_playbooks" + ] + }, + "GetPlaybook": { + "methods": [ + "get_playbook" + ] + }, + "ExportPlaybook": { + "methods": [ + "export_playbook" + ] + }, + "ImportPlaybook": { + "methods": [ + "import_playbook" + ] + }, + "UpdatePlaybook": { + "methods": [ + "update_playbook" + ] + }, + "CreatePlaybookVersion": { + "methods": [ + "create_playbook_version" + ] + }, + "GetPlaybookVersion": { + "methods": [ + "get_playbook_version" + ] + }, + "RestorePlaybookVersion": { + "methods": [ + "restore_playbook_version" + ] + }, + "ListPlaybookVersions": { + "methods": [ + "list_playbook_versions" + ] + }, + "DeletePlaybookVersion": { + "methods": [ + "delete_playbook_version" + ] + } + } + } + } + }, + "SecuritySettingsService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client", + "rpcs": { + "CreateSecuritySettings": { + "methods": [ + "create_security_settings" + ] + }, + "GetSecuritySettings": { + "methods": [ + "get_security_settings" + ] + }, + "UpdateSecuritySettings": { + "methods": [ + "update_security_settings" + ] + }, + "ListSecuritySettings": { + "methods": [ + "list_security_settings" + ] + }, + "DeleteSecuritySettings": { + "methods": [ + "delete_security_settings" + ] + } + } + } + } + }, + "Tools": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client", + "rpcs": { + "CreateTool": { + "methods": [ + "create_tool" + ] + }, + "ListTools": { + "methods": [ + "list_tools" + ] + }, + "GetTool": { + "methods": [ + "get_tool" + ] + }, + "UpdateTool": { + "methods": [ + "update_tool" + ] + }, + "DeleteTool": { + "methods": [ + "delete_tool" + ] + }, + "ListToolVersions": { + "methods": [ + "list_tool_versions" + ] + }, + "CreateToolVersion": { + "methods": [ + "create_tool_version" + ] + }, + "GetToolVersion": { + "methods": [ + "get_tool_version" + ] + }, + "DeleteToolVersion": { + "methods": [ + "delete_tool_version" + ] + }, + "RestoreToolVersion": { + "methods": [ + "restore_tool_version" + ] + } + } + } + } + }, + "Versions": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client", + "rpcs": { + "ListVersions": { + "methods": [ + "list_versions" + ] + }, + "GetVersion": { + "methods": [ + "get_version" + ] + }, + "CreateVersion": { + "methods": [ + "create_version" + ] + }, + "UpdateVersion": { + "methods": [ + "update_version" + ] + }, + "DeleteVersion": { + "methods": [ + "delete_version" + ] + }, + "LoadVersion": { + "methods": [ + "load_version" + ] + }, + "CompareVersions": { + "methods": [ + "compare_versions" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/google-cloud-dialogflow-cx-v3.gemspec b/owl-bot-staging/google-cloud-dialogflow-cx-v3/google-cloud-dialogflow-cx-v3.gemspec new file mode 100644 index 000000000000..ac45eaa9f882 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/google-cloud-dialogflow-cx-v3.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/dialogflow/cx/v3/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-dialogflow-cx-v3" + gem.version = Google::Cloud::Dialogflow::CX::V3::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 CX, providing an advanced agent type suitable for large or very complex agents. Note that google-cloud-dialogflow-cx-v3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-dialogflow-cx 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.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google-cloud-dialogflow-cx-v3.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google-cloud-dialogflow-cx-v3.rb new file mode 100644 index 000000000000..4c4fb203f02f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google-cloud-dialogflow-cx-v3.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/cx/v3" diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3.rb new file mode 100644 index 000000000000..28aad8d17934 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3.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/cx/v3/pages" +require "google/cloud/dialogflow/cx/v3/flows" +require "google/cloud/dialogflow/cx/v3/agents" +require "google/cloud/dialogflow/cx/v3/changelogs" +require "google/cloud/dialogflow/cx/v3/deployments" +require "google/cloud/dialogflow/cx/v3/entity_types" +require "google/cloud/dialogflow/cx/v3/intents" +require "google/cloud/dialogflow/cx/v3/session_entity_types" +require "google/cloud/dialogflow/cx/v3/sessions" +require "google/cloud/dialogflow/cx/v3/transition_route_groups" +require "google/cloud/dialogflow/cx/v3/test_cases" +require "google/cloud/dialogflow/cx/v3/webhooks" +require "google/cloud/dialogflow/cx/v3/environments" +require "google/cloud/dialogflow/cx/v3/examples" +require "google/cloud/dialogflow/cx/v3/experiments" +require "google/cloud/dialogflow/cx/v3/generators" +require "google/cloud/dialogflow/cx/v3/playbooks" +require "google/cloud/dialogflow/cx/v3/security_settings_service" +require "google/cloud/dialogflow/cx/v3/tools" +require "google/cloud/dialogflow/cx/v3/versions" +require "google/cloud/dialogflow/cx/v3/version" + +module Google + module Cloud + module Dialogflow + module CX + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/dialogflow/cx/v3" + # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/dialogflow/cx/v3" + # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new + # + module V3 + end + end + end + end +end + +helper_path = ::File.join __dir__, "v3", "_helpers.rb" +require "google/cloud/dialogflow/cx/v3/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/advanced_settings_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/advanced_settings_pb.rb new file mode 100644 index 000000000000..db7ad74ee237 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/advanced_settings_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/advanced_settings.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/dialogflow/cx/v3/gcs_pb' +require 'google/protobuf/duration_pb' + + +descriptor_data = "\n5google/cloud/dialogflow/cx/v3/advanced_settings.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\'google/cloud/dialogflow/cx/v3/gcs.proto\x1a\x1egoogle/protobuf/duration.proto\"\xdc\x07\n\x10\x41\x64vancedSettings\x12S\n\x1c\x61udio_export_gcs_destination\x18\x02 \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.GcsDestination\x12W\n\x0fspeech_settings\x18\x03 \x01(\x0b\x32>.google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings\x12S\n\rdtmf_settings\x18\x05 \x01(\x0b\x32<.google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings\x12Y\n\x10logging_settings\x18\x06 \x01(\x0b\x32?.google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings\x1a\x98\x02\n\x0eSpeechSettings\x12\x1e\n\x16\x65ndpointer_sensitivity\x18\x01 \x01(\x05\x12\x34\n\x11no_speech_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12%\n\x1duse_timeout_based_endpointing\x18\x03 \x01(\x08\x12Z\n\x06models\x18\x05 \x03(\x0b\x32J.google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.ModelsEntry\x1a-\n\x0bModelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\xca\x01\n\x0c\x44tmfSettings\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x12\n\nmax_digits\x18\x02 \x01(\x05\x12\x14\n\x0c\x66inish_digit\x18\x03 \x01(\t\x12>\n\x1binterdigit_timeout_duration\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12?\n\x1c\x65ndpointing_timeout_duration\x18\x07 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a\x81\x01\n\x0fLoggingSettings\x12\"\n\x1a\x65nable_stackdriver_logging\x18\x02 \x01(\x08\x12\"\n\x1a\x65nable_interaction_logging\x18\x03 \x01(\x08\x12&\n\x1e\x65nable_consent_based_redaction\x18\x04 \x01(\x08\x42\xb8\x01\n!com.google.cloud.dialogflow.cx.v3B\x15\x41\x64vancedSettingsProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.dialogflow.cx.v3.GcsDestination", "google/cloud/dialogflow/cx/v3/gcs.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + AdvancedSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.AdvancedSettings").msgclass + AdvancedSettings::SpeechSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings").msgclass + AdvancedSettings::DtmfSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings").msgclass + AdvancedSettings::LoggingSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb new file mode 100644 index 000000000000..30c31944b4eb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/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/cx/v3/advanced_settings_pb' +require 'google/cloud/dialogflow/cx/v3/audio_config_pb' +require 'google/cloud/dialogflow/cx/v3/flow_pb' +require 'google/cloud/dialogflow/cx/v3/generative_settings_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/cx/v3/agent.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/advanced_settings.proto\x1a\x30google/cloud/dialogflow/cx/v3/audio_config.proto\x1a(google/cloud/dialogflow/cx/v3/flow.proto\x1a\x37google/cloud/dialogflow/cx/v3/generative_settings.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"8\n\x14SpeechToTextSettings\x12 \n\x18\x65nable_speech_adaptation\x18\x01 \x01(\x08\"\xa1\x11\n\x05\x41gent\x12\x0c\n\x04name\x18\x01 \x01(\t\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\x06\xe0\x41\x02\xe0\x41\x05\x12 \n\x18supported_language_codes\x18\x04 \x03(\t\x12\x16\n\ttime_zone\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x12\n\navatar_uri\x18\x07 \x01(\t\x12T\n\x17speech_to_text_settings\x18\r \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.SpeechToTextSettings\x12\x39\n\nstart_flow\x18\x10 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/FlowH\x00\x12\x41\n\x0estart_playbook\x18\' \x01(\tB\'\xfa\x41$\n\"dialogflow.googleapis.com/PlaybookH\x00\x12J\n\x11security_settings\x18\x11 \x01(\tB/\xfa\x41,\n*dialogflow.googleapis.com/SecuritySettings\x12&\n\x1a\x65nable_stackdriver_logging\x18\x12 \x01(\x08\x42\x02\x18\x01\x12\x1f\n\x17\x65nable_spell_correction\x18\x14 \x01(\x08\x12+\n\x1e\x65nable_multi_language_training\x18( \x01(\x08\x42\x03\xe0\x41\x01\x12\x0e\n\x06locked\x18\x1b \x01(\x08\x12J\n\x11\x61\x64vanced_settings\x18\x16 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x12]\n\x18git_integration_settings\x18\x1e \x01(\x0b\x32;.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings\x12T\n\x17text_to_speech_settings\x18\x1f \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.TextToSpeechSettings\x12\x61\n\x18gen_app_builder_settings\x18! \x01(\x0b\x32:.google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettingsH\x01\x88\x01\x01\x12\x62\n\x18\x61nswer_feedback_settings\x18& \x01(\x0b\x32;.google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettingsB\x03\xe0\x41\x01\x12\x63\n\x18personalization_settings\x18* \x01(\x0b\x32<.google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettingsB\x03\xe0\x41\x01\x12h\n\x1b\x63lient_certificate_settings\x18+ \x01(\x0b\x32>.google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettingsB\x03\xe0\x41\x01\x12\"\n\rsatisfies_pzs\x18- \x01(\x08\x42\x06\xe0\x41\x01\xe0\x41\x03H\x02\x88\x01\x01\x12\"\n\rsatisfies_pzi\x18. \x01(\x08\x42\x06\xe0\x41\x01\xe0\x41\x03H\x03\x88\x01\x01\x1a\x90\x02\n\x16GitIntegrationSettings\x12\x65\n\x0fgithub_settings\x18\x01 \x01(\x0b\x32J.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettingsH\x00\x1a\x7f\n\x0eGithubSettings\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x16\n\x0erepository_uri\x18\x02 \x01(\t\x12\x17\n\x0ftracking_branch\x18\x03 \x01(\t\x12\x14\n\x0c\x61\x63\x63\x65ss_token\x18\x04 \x01(\t\x12\x10\n\x08\x62ranches\x18\x05 \x03(\tB\x0e\n\x0cgit_settings\x1a,\n\x15GenAppBuilderSettings\x12\x13\n\x06\x65ngine\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a=\n\x16\x41nswerFeedbackSettings\x12#\n\x16\x65nable_answer_feedback\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x1aZ\n\x17PersonalizationSettings\x12?\n\x19\x64\x65\x66\x61ult_end_user_metadata\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x1a\xca\x01\n\x19\x43lientCertificateSettings\x12\x1c\n\x0fssl_certificate\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12G\n\x0bprivate_key\x18\x02 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x46\n\npassphrase\x18\x03 \x01(\tB2\xe0\x41\x01\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion:\\\xea\x41Y\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x36projects/{project}/locations/{location}/agents/{agent}B\x18\n\x16session_entry_resourceB\x1b\n\x19_gen_app_builder_settingsB\x10\n\x0e_satisfies_pzsB\x10\n\x0e_satisfies_pzi\"s\n\x11ListAgentsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"c\n\x12ListAgentsResponse\x12\x34\n\x06\x61gents\x18\x01 \x03(\x0b\x32$.google.cloud.dialogflow.cx.v3.Agent\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"H\n\x0fGetAgentRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\"\x87\x01\n\x12\x43reateAgentRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\x12\x38\n\x05\x61gent\x18\x02 \x01(\x0b\x32$.google.cloud.dialogflow.cx.v3.AgentB\x03\xe0\x41\x02\"\x7f\n\x12UpdateAgentRequest\x12\x38\n\x05\x61gent\x18\x01 \x01(\x0b\x32$.google.cloud.dialogflow.cx.v3.AgentB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"K\n\x12\x44\x65leteAgentRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\"\x98\x04\n\x12\x45xportAgentRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x16\n\tagent_uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12V\n\x0b\x64\x61ta_format\x18\x03 \x01(\x0e\x32<.google.cloud.dialogflow.cx.v3.ExportAgentRequest.DataFormatB\x03\xe0\x41\x01\x12\x42\n\x0b\x65nvironment\x18\x05 \x01(\tB-\xe0\x41\x01\xfa\x41\'\n%dialogflow.googleapis.com/Environment\x12^\n\x0fgit_destination\x18\x06 \x01(\x0b\x32@.google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestinationB\x03\xe0\x41\x01\x12-\n include_bigquery_export_settings\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x41\n\x0eGitDestination\x12\x17\n\x0ftracking_branch\x18\x01 \x01(\t\x12\x16\n\x0e\x63ommit_message\x18\x02 \x01(\t\"E\n\nDataFormat\x12\x1b\n\x17\x44\x41TA_FORMAT_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42LOB\x10\x01\x12\x10\n\x0cJSON_PACKAGE\x10\x04\"b\n\x13\x45xportAgentResponse\x12\x13\n\tagent_uri\x18\x01 \x01(\tH\x00\x12\x17\n\ragent_content\x18\x02 \x01(\x0cH\x00\x12\x14\n\ncommit_sha\x18\x03 \x01(\tH\x00\x42\x07\n\x05\x61gent\"\xa0\x03\n\x13RestoreAgentRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\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\x12R\n\ngit_source\x18\x06 \x01(\x0b\x32<.google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSourceH\x00\x12X\n\x0erestore_option\x18\x05 \x01(\x0e\x32@.google.cloud.dialogflow.cx.v3.RestoreAgentRequest.RestoreOption\x1a$\n\tGitSource\x12\x17\n\x0ftracking_branch\x18\x01 \x01(\t\"G\n\rRestoreOption\x12\x1e\n\x1aRESTORE_OPTION_UNSPECIFIED\x10\x00\x12\x08\n\x04KEEP\x10\x01\x12\x0c\n\x08\x46\x41LLBACK\x10\x02\x42\x07\n\x05\x61gent\"d\n\x14ValidateAgentRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\x7f\n\x1fGetAgentValidationResultRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/dialogflow.googleapis.com/AgentValidationResult\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\xfa\x01\n\x15\x41gentValidationResult\x12\x0c\n\x04name\x18\x01 \x01(\t\x12T\n\x17\x66low_validation_results\x18\x02 \x03(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.FlowValidationResult:}\xea\x41z\n/dialogflow.googleapis.com/AgentValidationResult\x12Gprojects/{project}/locations/{location}/agents/{agent}/validationResult\"\x83\x01\n\x1cGetGenerativeSettingsRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1dialogflow.googleapis.com/AgentGenerativeSettings\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\xac\x01\n\x1fUpdateGenerativeSettingsRequest\x12S\n\x13generative_settings\x18\x01 \x01(\x0b\x32\x31.google.cloud.dialogflow.cx.v3.GenerativeSettingsB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x32\xa2\x12\n\x06\x41gents\x12\xae\x01\n\nListAgents\x12\x30.google.cloud.dialogflow.cx.v3.ListAgentsRequest\x1a\x31.google.cloud.dialogflow.cx.v3.ListAgentsResponse\";\xda\x41\x06parent\x82\xd3\xe4\x93\x02,\x12*/v3/{parent=projects/*/locations/*}/agents\x12\x9b\x01\n\x08GetAgent\x12..google.cloud.dialogflow.cx.v3.GetAgentRequest\x1a$.google.cloud.dialogflow.cx.v3.Agent\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,\x12*/v3/{name=projects/*/locations/*/agents/*}\x12\xb0\x01\n\x0b\x43reateAgent\x12\x31.google.cloud.dialogflow.cx.v3.CreateAgentRequest\x1a$.google.cloud.dialogflow.cx.v3.Agent\"H\xda\x41\x0cparent,agent\x82\xd3\xe4\x93\x02\x33\"*/v3/{parent=projects/*/locations/*}/agents:\x05\x61gent\x12\xbb\x01\n\x0bUpdateAgent\x12\x31.google.cloud.dialogflow.cx.v3.UpdateAgentRequest\x1a$.google.cloud.dialogflow.cx.v3.Agent\"S\xda\x41\x11\x61gent,update_mask\x82\xd3\xe4\x93\x02\x39\x32\x30/v3/{agent.name=projects/*/locations/*/agents/*}:\x05\x61gent\x12\x93\x01\n\x0b\x44\x65leteAgent\x12\x31.google.cloud.dialogflow.cx.v3.DeleteAgentRequest\x1a\x16.google.protobuf.Empty\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,**/v3/{name=projects/*/locations/*/agents/*}\x12\xcd\x01\n\x0b\x45xportAgent\x12\x31.google.cloud.dialogflow.cx.v3.ExportAgentRequest\x1a\x1d.google.longrunning.Operation\"l\xca\x41-\n\x13\x45xportAgentResponse\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02\x36\"1/v3/{name=projects/*/locations/*/agents/*}:export:\x01*\x12\xd2\x01\n\x0cRestoreAgent\x12\x32.google.cloud.dialogflow.cx.v3.RestoreAgentRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02\x37\"2/v3/{name=projects/*/locations/*/agents/*}:restore:\x01*\x12\xba\x01\n\rValidateAgent\x12\x33.google.cloud.dialogflow.cx.v3.ValidateAgentRequest\x1a\x34.google.cloud.dialogflow.cx.v3.AgentValidationResult\">\x82\xd3\xe4\x93\x02\x38\"3/v3/{name=projects/*/locations/*/agents/*}:validate:\x01*\x12\xdc\x01\n\x18GetAgentValidationResult\x12>.google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest\x1a\x34.google.cloud.dialogflow.cx.v3.AgentValidationResult\"J\xda\x41\x04name\x82\xd3\xe4\x93\x02=\x12;/v3/{name=projects/*/locations/*/agents/*/validationResult}\x12\xe3\x01\n\x15GetGenerativeSettings\x12;.google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest\x1a\x31.google.cloud.dialogflow.cx.v3.GenerativeSettings\"Z\xda\x41\x12name,language_code\x82\xd3\xe4\x93\x02?\x12=/v3/{name=projects/*/locations/*/agents/*/generativeSettings}\x12\xa0\x02\n\x18UpdateGenerativeSettings\x12>.google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest\x1a\x31.google.cloud.dialogflow.cx.v3.GenerativeSettings\"\x90\x01\xda\x41\x1fgenerative_settings,update_mask\x82\xd3\xe4\x93\x02h2Q/v3/{generative_settings.name=projects/*/locations/*/agents/*/generativeSettings}:\x13generative_settings\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x94\x02\n!com.google.cloud.dialogflow.cx.v3B\nAgentProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3\xea\x41\x64\n*secretmanager.googleapis.com/SecretVersion\x12\x36projects/{project}/secrets/{secret}/versions/{version}b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.dialogflow.cx.v3.AdvancedSettings", "google/cloud/dialogflow/cx/v3/advanced_settings.proto"], + ["google.cloud.dialogflow.cx.v3.TextToSpeechSettings", "google/cloud/dialogflow/cx/v3/audio_config.proto"], + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.dialogflow.cx.v3.FlowValidationResult", "google/cloud/dialogflow/cx/v3/flow.proto"], + ["google.cloud.dialogflow.cx.v3.GenerativeSettings", "google/cloud/dialogflow/cx/v3/generative_settings.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + SpeechToTextSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SpeechToTextSettings").msgclass + Agent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Agent").msgclass + Agent::GitIntegrationSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings").msgclass + Agent::GitIntegrationSettings::GithubSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings").msgclass + Agent::GenAppBuilderSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings").msgclass + Agent::AnswerFeedbackSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings").msgclass + Agent::PersonalizationSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings").msgclass + Agent::ClientCertificateSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings").msgclass + ListAgentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListAgentsRequest").msgclass + ListAgentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListAgentsResponse").msgclass + GetAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetAgentRequest").msgclass + CreateAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateAgentRequest").msgclass + UpdateAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateAgentRequest").msgclass + DeleteAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteAgentRequest").msgclass + ExportAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportAgentRequest").msgclass + ExportAgentRequest::GitDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination").msgclass + ExportAgentRequest::DataFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportAgentRequest.DataFormat").enummodule + ExportAgentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportAgentResponse").msgclass + RestoreAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RestoreAgentRequest").msgclass + RestoreAgentRequest::GitSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource").msgclass + RestoreAgentRequest::RestoreOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RestoreAgentRequest.RestoreOption").enummodule + ValidateAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ValidateAgentRequest").msgclass + GetAgentValidationResultRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest").msgclass + AgentValidationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.AgentValidationResult").msgclass + GetGenerativeSettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest").msgclass + UpdateGenerativeSettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agent_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agent_services_pb.rb new file mode 100644 index 000000000000..0dbd29141d9a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agent_services_pb.rb @@ -0,0 +1,103 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/cx/v3/agent.proto for package 'Google.Cloud.Dialogflow.CX.V3' +# 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/cx/v3/agent_pb' + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Agents + # Service for managing [Agents][google.cloud.dialogflow.cx.v3.Agent]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.cx.v3.Agents' + + # Returns the list of all agents in the specified location. + rpc :ListAgents, ::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListAgentsResponse + # Retrieves the specified agent. + rpc :GetAgent, ::Google::Cloud::Dialogflow::CX::V3::GetAgentRequest, ::Google::Cloud::Dialogflow::CX::V3::Agent + # Creates an agent in the specified location. + # + # Note: You should always train flows prior to sending them queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc :CreateAgent, ::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest, ::Google::Cloud::Dialogflow::CX::V3::Agent + # Updates the specified agent. + # + # Note: You should always train flows prior to sending them queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc :UpdateAgent, ::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest, ::Google::Cloud::Dialogflow::CX::V3::Agent + # Deletes the specified agent. + rpc :DeleteAgent, ::Google::Cloud::Dialogflow::CX::V3::DeleteAgentRequest, ::Google::Protobuf::Empty + # Exports the specified agent to a binary file. + # + # 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`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: + # [ExportAgentResponse][google.cloud.dialogflow.cx.v3.ExportAgentResponse] + rpc :ExportAgent, ::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest, ::Google::Longrunning::Operation + # Restores the specified agent from a binary file. + # + # Replaces the current agent with a new one. Note that all existing resources + # in agent (e.g. intents, entity types, flows) will be removed. + # + # 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`: 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 flows prior to sending them queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc :RestoreAgent, ::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest, ::Google::Longrunning::Operation + # Validates the specified agent and creates or updates validation results. + # The agent in draft version is validated. Please call this API after the + # training is completed to get the complete validation results. + rpc :ValidateAgent, ::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest, ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult + # Gets the latest agent validation result. Agent validation is performed + # when ValidateAgent is called. + rpc :GetAgentValidationResult, ::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest, ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult + # Gets the generative settings for the agent. + rpc :GetGenerativeSettings, ::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest, ::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings + # Updates the generative settings for the agent. + rpc :UpdateGenerativeSettings, ::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest, ::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents.rb new file mode 100644 index 000000000000..8798d806b89c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents.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/cx/v3/version" + +require "google/cloud/dialogflow/cx/v3/agents/credentials" +require "google/cloud/dialogflow/cx/v3/agents/paths" +require "google/cloud/dialogflow/cx/v3/agents/operations" +require "google/cloud/dialogflow/cx/v3/agents/client" +require "google/cloud/dialogflow/cx/v3/agents/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Agent Agents}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/cx/v3/agents" + # client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/cx/v3/agents/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + module Agents + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "agents", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/agents/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/client.rb new file mode 100644 index 000000000000..8267f7959c06 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/client.rb @@ -0,0 +1,1569 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/agent_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Agents + ## + # Client for the Agents service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Agents::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Agents clients + # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] + 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.create_agent.timeout = 180.0 + default_config.rpcs.create_agent.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::CX::V3::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::CX::V3::Agents::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::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/cx/v3/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::CX::V3::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::CX::V3::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 + + ## + # Returns the list of all agents in the specified location. + # + # @overload list_agents(request, options = nil) + # Pass arguments to `list_agents` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_agents(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_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 location to list all agents for. + # 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::CX::V3::Agent>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Agent>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest.new + # + # # Call the list_agents method. + # result = client.list_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::CX::V3::Agent. + # p item + # end + # + def list_agents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest + + # Converts hash and nil to 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_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::CX::V3::VERSION + metadata[:"x-goog-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_agents.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_agents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.call_rpc :list_agents, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @agents_stub, :list_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 + + ## + # 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::CX::V3::GetAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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(name: 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 name [::String] + # Required. The name of the agent. + # Format: `projects//locations//agents/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Agent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetAgentRequest.new + # + # # Call the get_agent method. + # result = client.get_agent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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 an agent in the specified location. + # + # Note: You should always train flows prior to sending them queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload create_agent(request, options = nil) + # Pass arguments to `create_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_agent(parent: nil, agent: nil) + # Pass arguments to `create_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 location to create a agent for. + # Format: `projects//locations/`. + # @param agent [::Google::Cloud::Dialogflow::CX::V3::Agent, ::Hash] + # Required. The agent to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Agent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest.new + # + # # Call the create_agent method. + # result = client.create_agent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. + # p result + # + def create_agent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest + + # Converts hash and nil to 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_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::CX::V3::VERSION + metadata[:"x-goog-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_agent.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_agent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.call_rpc :create_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 + + ## + # Updates the specified agent. + # + # Note: You should always train flows prior to sending them queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload update_agent(request, options = nil) + # Pass arguments to `update_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_agent(agent: nil, update_mask: nil) + # Pass arguments to `update_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::CX::V3::Agent, ::Hash] + # Required. The agent to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # 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::CX::V3::Agent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest.new + # + # # Call the update_agent method. + # result = client.update_agent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. + # p result + # + def update_agent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest + + # Converts hash and nil to 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_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::CX::V3::VERSION + metadata[:"x-goog-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&.name + header_params["agent.name"] = request.agent.name + end + + request_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_agent.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_agent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.call_rpc :update_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::CX::V3::DeleteAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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(name: 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 name [::String] + # Required. The name of the agent to delete. + # Format: `projects//locations//agents/`. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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 + + ## + # Exports the specified agent to a binary file. + # + # 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`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::ExportAgentResponse ExportAgentResponse} + # + # @overload export_agent(request, options = nil) + # Pass arguments to `export_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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(name: nil, agent_uri: nil, data_format: nil, environment: nil, git_destination: nil, include_bigquery_export_settings: 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 name [::String] + # Required. The name of the agent to export. + # Format: `projects//locations//agents/`. + # @param agent_uri [::String] + # Optional. 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). + # @param data_format [::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest::DataFormat] + # Optional. The data format of the exported agent. If not specified, `BLOB` + # is assumed. + # @param environment [::String] + # Optional. Environment name. If not set, draft environment is assumed. + # Format: + # `projects//locations//agents//environments/`. + # @param git_destination [::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest::GitDestination, ::Hash] + # Optional. The Git branch to export the agent to. + # @param include_bigquery_export_settings [::Boolean] + # Optional. Whether to include BigQuery Export setting. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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 + + ## + # Restores the specified agent from a binary file. + # + # Replaces the current agent with a new one. Note that all existing resources + # in agent (e.g. intents, entity types, flows) will be removed. + # + # 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`: 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 flows prior to sending them queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload restore_agent(request, options = nil) + # Pass arguments to `restore_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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(name: nil, agent_uri: nil, agent_content: nil, git_source: nil, restore_option: 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 name [::String] + # Required. The name of the agent to restore into. + # Format: `projects//locations//agents/`. + # @param agent_uri [::String] + # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + # to restore agent from. The format of this URI must be + # `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`, `git_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param agent_content [::String] + # Uncompressed raw byte content for agent. + # + # Note: The following parameters are mutually exclusive: `agent_content`, `agent_uri`, `git_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param git_source [::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest::GitSource, ::Hash] + # Setting for restoring from a git branch + # + # Note: The following parameters are mutually exclusive: `git_source`, `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 restore_option [::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest::RestoreOption] + # Agent restore mode. If not specified, `KEEP` is assumed. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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 + + ## + # Validates the specified agent and creates or updates validation results. + # The agent in draft version is validated. Please call this API after the + # training is completed to get the complete validation results. + # + # @overload validate_agent(request, options = nil) + # Pass arguments to `validate_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload validate_agent(name: nil, language_code: nil) + # Pass arguments to `validate_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 name [::String] + # Required. The agent to validate. + # Format: `projects//locations//agents/`. + # @param language_code [::String] + # If not specified, the agent's default language is used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest.new + # + # # Call the validate_agent method. + # result = client.validate_agent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AgentValidationResult. + # p result + # + def validate_agent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.validate_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.validate_agent.timeout, + metadata: metadata, + retry_policy: @config.rpcs.validate_agent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.call_rpc :validate_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 + + ## + # Gets the latest agent validation result. Agent validation is performed + # when ValidateAgent is called. + # + # @overload get_agent_validation_result(request, options = nil) + # Pass arguments to `get_agent_validation_result` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_validation_result(name: nil, language_code: nil) + # Pass arguments to `get_agent_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 name [::String] + # Required. The agent name. + # Format: + # `projects//locations//agents//validationResult`. + # @param language_code [::String] + # If not specified, the agent's default language is used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest.new + # + # # Call the get_agent_validation_result method. + # result = client.get_agent_validation_result request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AgentValidationResult. + # p result + # + def get_agent_validation_result request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest + + # Converts hash and nil to 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_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_validation_result.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_agent_validation_result.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.call_rpc :get_agent_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 + + ## + # Gets the generative settings for the agent. + # + # @overload get_generative_settings(request, options = nil) + # Pass arguments to `get_generative_settings` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generative_settings(name: nil, language_code: nil) + # Pass arguments to `get_generative_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Format: + # `projects//locations//agents//generativeSettings`. + # @param language_code [::String] + # Required. Language code of the generative settings. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest.new + # + # # Call the get_generative_settings method. + # result = client.get_generative_settings request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::GenerativeSettings. + # p result + # + def get_generative_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest + + # Converts hash and nil to 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_generative_settings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_generative_settings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_generative_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.call_rpc :get_generative_settings, request, 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 generative settings for the agent. + # + # @overload update_generative_settings(request, options = nil) + # Pass arguments to `update_generative_settings` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generative_settings(generative_settings: nil, update_mask: nil) + # Pass arguments to `update_generative_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param generative_settings [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings, ::Hash] + # Required. Generative settings 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::CX::V3::GenerativeSettings] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest.new + # + # # Call the update_generative_settings method. + # result = client.update_generative_settings request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::GenerativeSettings. + # p result + # + def update_generative_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest + + # Converts hash and nil to 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_generative_settings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.generative_settings&.name + header_params["generative_settings.name"] = request.generative_settings.name + end + + request_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_generative_settings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_generative_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.call_rpc :update_generative_settings, request, 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::CX::V3::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 + # # list_agents to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_agents.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_agents.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::CX::V3::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. + # * `: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. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_agents` + # @return [::Gapic::Config::Method] + # + attr_reader :list_agents + ## + # RPC-specific configuration for `get_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :get_agent + ## + # RPC-specific configuration for `create_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :create_agent + ## + # RPC-specific configuration for `update_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :update_agent + ## + # RPC-specific configuration for `delete_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_agent + ## + # RPC-specific configuration for `export_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :export_agent + ## + # RPC-specific configuration for `restore_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_agent + ## + # RPC-specific configuration for `validate_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :validate_agent + ## + # RPC-specific configuration for `get_agent_validation_result` + # @return [::Gapic::Config::Method] + # + attr_reader :get_agent_validation_result + ## + # RPC-specific configuration for `get_generative_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :get_generative_settings + ## + # RPC-specific configuration for `update_generative_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :update_generative_settings + + # @private + def initialize parent_rpcs = nil + list_agents_config = parent_rpcs.list_agents if parent_rpcs.respond_to? :list_agents + @list_agents = ::Gapic::Config::Method.new list_agents_config + get_agent_config = parent_rpcs.get_agent if parent_rpcs.respond_to? :get_agent + @get_agent = ::Gapic::Config::Method.new get_agent_config + create_agent_config = parent_rpcs.create_agent if parent_rpcs.respond_to? :create_agent + @create_agent = ::Gapic::Config::Method.new create_agent_config + update_agent_config = parent_rpcs.update_agent if parent_rpcs.respond_to? :update_agent + @update_agent = ::Gapic::Config::Method.new update_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 + export_agent_config = parent_rpcs.export_agent if parent_rpcs.respond_to? :export_agent + @export_agent = ::Gapic::Config::Method.new export_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 + validate_agent_config = parent_rpcs.validate_agent if parent_rpcs.respond_to? :validate_agent + @validate_agent = ::Gapic::Config::Method.new validate_agent_config + get_agent_validation_result_config = parent_rpcs.get_agent_validation_result if parent_rpcs.respond_to? :get_agent_validation_result + @get_agent_validation_result = ::Gapic::Config::Method.new get_agent_validation_result_config + get_generative_settings_config = parent_rpcs.get_generative_settings if parent_rpcs.respond_to? :get_generative_settings + @get_generative_settings = ::Gapic::Config::Method.new get_generative_settings_config + update_generative_settings_config = parent_rpcs.update_generative_settings if parent_rpcs.respond_to? :update_generative_settings + @update_generative_settings = ::Gapic::Config::Method.new update_generative_settings_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/credentials.rb new file mode 100644 index 000000000000..4808b1595bff --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb new file mode 100644 index 000000000000..a7b68a307818 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/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 CX + module V3 + 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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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. + # * `: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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/paths.rb new file mode 100644 index 000000000000..9ac32eefe45f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/paths.rb @@ -0,0 +1,210 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + module Agents + # Path helper methods for the Agents API. + module Paths + ## + # Create a fully-qualified Agent resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # + # @return [::String] + def agent_path project:, location:, agent: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}" + end + + ## + # Create a fully-qualified AgentGenerativeSettings resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/generativeSettings` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # + # @return [::String] + def agent_generative_settings_path project:, location:, agent: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/generativeSettings" + end + + ## + # Create a fully-qualified AgentValidationResult resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/validationResult` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # + # @return [::String] + def agent_validation_result_path project:, location:, agent: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/validationResult" + end + + ## + # Create a fully-qualified Environment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param environment [String] + # + # @return [::String] + def environment_path project:, location:, agent:, environment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}" + end + + ## + # Create a fully-qualified Flow resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # + # @return [::String] + def flow_path project:, location:, agent:, flow: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}" + 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 Playbook resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param playbook [String] + # + # @return [::String] + def playbook_path project:, location:, agent:, playbook: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}" + 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 SecuritySettings 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 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 + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest.rb new file mode 100644 index 000000000000..c00ccb479570 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/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/cx/v3/version" +require "google/cloud/dialogflow/cx/v3/bindings_override" + +require "google/cloud/dialogflow/cx/v3/agents/credentials" +require "google/cloud/dialogflow/cx/v3/agents/paths" +require "google/cloud/dialogflow/cx/v3/agents/rest/operations" +require "google/cloud/dialogflow/cx/v3/agents/rest/client" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Agent Agents}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/cx/v3/agents/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + module Agents + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/agents/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb new file mode 100644 index 000000000000..e40f82dd8d40 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb @@ -0,0 +1,1457 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/agent_pb" +require "google/cloud/dialogflow/cx/v3/agents/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Agents + module Rest + ## + # REST client for the Agents service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Agents::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Agents clients + # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] + 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.create_agent.timeout = 180.0 + default_config.rpcs.create_agent.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::CX::V3::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::CX::V3::Agents::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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 + + ## + # Returns the list of all agents in the specified location. + # + # @overload list_agents(request, options = nil) + # Pass arguments to `list_agents` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_agents(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_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 location to list all agents for. + # 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::CX::V3::Agent>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Agent>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest.new + # + # # Call the list_agents method. + # result = client.list_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::CX::V3::Agent. + # p item + # end + # + def list_agents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest + + # Converts hash and nil to an 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_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_agents.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_agents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.list_agents request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @agents_stub, :list_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 + + ## + # 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::CX::V3::GetAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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(name: 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 name [::String] + # Required. The name of the agent. + # Format: `projects//locations//agents/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Agent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetAgentRequest.new + # + # # Call the get_agent method. + # result = client.get_agent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 an agent in the specified location. + # + # Note: You should always train flows prior to sending them queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload create_agent(request, options = nil) + # Pass arguments to `create_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_agent(parent: nil, agent: nil) + # Pass arguments to `create_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 location to create a agent for. + # Format: `projects//locations/`. + # @param agent [::Google::Cloud::Dialogflow::CX::V3::Agent, ::Hash] + # Required. The agent to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Agent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest.new + # + # # Call the create_agent method. + # result = client.create_agent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. + # p result + # + def create_agent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest + + # Converts hash and nil to an 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_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_agent.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_agent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.create_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 + + ## + # Updates the specified agent. + # + # Note: You should always train flows prior to sending them queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload update_agent(request, options = nil) + # Pass arguments to `update_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_agent(agent: nil, update_mask: nil) + # Pass arguments to `update_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::CX::V3::Agent, ::Hash] + # Required. The agent to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # 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::CX::V3::Agent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest.new + # + # # Call the update_agent method. + # result = client.update_agent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. + # p result + # + def update_agent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest + + # Converts hash and nil to an 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_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_agent.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_agent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.update_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::CX::V3::DeleteAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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(name: 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 name [::String] + # Required. The name of the agent to delete. + # Format: `projects//locations//agents/`. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # Exports the specified agent to a binary file. + # + # 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`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::ExportAgentResponse ExportAgentResponse} + # + # @overload export_agent(request, options = nil) + # Pass arguments to `export_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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(name: nil, agent_uri: nil, data_format: nil, environment: nil, git_destination: nil, include_bigquery_export_settings: 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 name [::String] + # Required. The name of the agent to export. + # Format: `projects//locations//agents/`. + # @param agent_uri [::String] + # Optional. 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). + # @param data_format [::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest::DataFormat] + # Optional. The data format of the exported agent. If not specified, `BLOB` + # is assumed. + # @param environment [::String] + # Optional. Environment name. If not set, draft environment is assumed. + # Format: + # `projects//locations//agents//environments/`. + # @param git_destination [::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest::GitDestination, ::Hash] + # Optional. The Git branch to export the agent to. + # @param include_bigquery_export_settings [::Boolean] + # Optional. Whether to include BigQuery Export setting. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # Restores the specified agent from a binary file. + # + # Replaces the current agent with a new one. Note that all existing resources + # in agent (e.g. intents, entity types, flows) will be removed. + # + # 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`: 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 flows prior to sending them queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload restore_agent(request, options = nil) + # Pass arguments to `restore_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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(name: nil, agent_uri: nil, agent_content: nil, git_source: nil, restore_option: 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 name [::String] + # Required. The name of the agent to restore into. + # Format: `projects//locations//agents/`. + # @param agent_uri [::String] + # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + # to restore agent from. The format of this URI must be + # `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`, `git_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param agent_content [::String] + # Uncompressed raw byte content for agent. + # + # Note: The following parameters are mutually exclusive: `agent_content`, `agent_uri`, `git_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param git_source [::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest::GitSource, ::Hash] + # Setting for restoring from a git branch + # + # Note: The following parameters are mutually exclusive: `git_source`, `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 restore_option [::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest::RestoreOption] + # Agent restore mode. If not specified, `KEEP` is assumed. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # Validates the specified agent and creates or updates validation results. + # The agent in draft version is validated. Please call this API after the + # training is completed to get the complete validation results. + # + # @overload validate_agent(request, options = nil) + # Pass arguments to `validate_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload validate_agent(name: nil, language_code: nil) + # Pass arguments to `validate_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 name [::String] + # Required. The agent to validate. + # Format: `projects//locations//agents/`. + # @param language_code [::String] + # If not specified, the agent's default language is used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest.new + # + # # Call the validate_agent method. + # result = client.validate_agent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AgentValidationResult. + # p result + # + def validate_agent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.validate_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.validate_agent.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.validate_agent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.validate_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 + + ## + # Gets the latest agent validation result. Agent validation is performed + # when ValidateAgent is called. + # + # @overload get_agent_validation_result(request, options = nil) + # Pass arguments to `get_agent_validation_result` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_validation_result(name: nil, language_code: nil) + # Pass arguments to `get_agent_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 name [::String] + # Required. The agent name. + # Format: + # `projects//locations//agents//validationResult`. + # @param language_code [::String] + # If not specified, the agent's default language is used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest.new + # + # # Call the get_agent_validation_result method. + # result = client.get_agent_validation_result request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AgentValidationResult. + # p result + # + def get_agent_validation_result request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest + + # Converts hash and nil to an 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_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_validation_result.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_agent_validation_result.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.get_agent_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 + + ## + # Gets the generative settings for the agent. + # + # @overload get_generative_settings(request, options = nil) + # Pass arguments to `get_generative_settings` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generative_settings(name: nil, language_code: nil) + # Pass arguments to `get_generative_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Format: + # `projects//locations//agents//generativeSettings`. + # @param language_code [::String] + # Required. Language code of the generative settings. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest.new + # + # # Call the get_generative_settings method. + # result = client.get_generative_settings request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::GenerativeSettings. + # p result + # + def get_generative_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest + + # Converts hash and nil to an 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_generative_settings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_generative_settings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_generative_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.get_generative_settings request, 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 generative settings for the agent. + # + # @overload update_generative_settings(request, options = nil) + # Pass arguments to `update_generative_settings` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generative_settings(generative_settings: nil, update_mask: nil) + # Pass arguments to `update_generative_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param generative_settings [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings, ::Hash] + # Required. Generative settings 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::CX::V3::GenerativeSettings] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest.new + # + # # Call the update_generative_settings method. + # result = client.update_generative_settings request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::GenerativeSettings. + # p result + # + def update_generative_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest + + # Converts hash and nil to an 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_generative_settings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_generative_settings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_generative_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.update_generative_settings request, 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::CX::V3::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 + # # list_agents to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_agents.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_agents.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_agents` + # @return [::Gapic::Config::Method] + # + attr_reader :list_agents + ## + # RPC-specific configuration for `get_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :get_agent + ## + # RPC-specific configuration for `create_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :create_agent + ## + # RPC-specific configuration for `update_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :update_agent + ## + # RPC-specific configuration for `delete_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_agent + ## + # RPC-specific configuration for `export_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :export_agent + ## + # RPC-specific configuration for `restore_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_agent + ## + # RPC-specific configuration for `validate_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :validate_agent + ## + # RPC-specific configuration for `get_agent_validation_result` + # @return [::Gapic::Config::Method] + # + attr_reader :get_agent_validation_result + ## + # RPC-specific configuration for `get_generative_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :get_generative_settings + ## + # RPC-specific configuration for `update_generative_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :update_generative_settings + + # @private + def initialize parent_rpcs = nil + list_agents_config = parent_rpcs.list_agents if parent_rpcs.respond_to? :list_agents + @list_agents = ::Gapic::Config::Method.new list_agents_config + get_agent_config = parent_rpcs.get_agent if parent_rpcs.respond_to? :get_agent + @get_agent = ::Gapic::Config::Method.new get_agent_config + create_agent_config = parent_rpcs.create_agent if parent_rpcs.respond_to? :create_agent + @create_agent = ::Gapic::Config::Method.new create_agent_config + update_agent_config = parent_rpcs.update_agent if parent_rpcs.respond_to? :update_agent + @update_agent = ::Gapic::Config::Method.new update_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 + export_agent_config = parent_rpcs.export_agent if parent_rpcs.respond_to? :export_agent + @export_agent = ::Gapic::Config::Method.new export_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 + validate_agent_config = parent_rpcs.validate_agent if parent_rpcs.respond_to? :validate_agent + @validate_agent = ::Gapic::Config::Method.new validate_agent_config + get_agent_validation_result_config = parent_rpcs.get_agent_validation_result if parent_rpcs.respond_to? :get_agent_validation_result + @get_agent_validation_result = ::Gapic::Config::Method.new get_agent_validation_result_config + get_generative_settings_config = parent_rpcs.get_generative_settings if parent_rpcs.respond_to? :get_generative_settings + @get_generative_settings = ::Gapic::Config::Method.new get_generative_settings_config + update_generative_settings_config = parent_rpcs.update_generative_settings if parent_rpcs.respond_to? :update_generative_settings + @update_generative_settings = ::Gapic::Config::Method.new update_generative_settings_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb new file mode 100644 index 000000000000..7767c8986ec6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/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 CX + module V3 + 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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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. + # * `: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: "/v3/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{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: "/v3/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb new file mode 100644 index 000000000000..53976a53bf83 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb @@ -0,0 +1,760 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/agent_pb" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + 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 list_agents REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::ListAgentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ListAgentsResponse] + # A result object deserialized from the server's reply + def list_agents request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_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: "list_agents", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::ListAgentsResponse.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_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Agent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 create_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Agent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] + # A result object deserialized from the server's reply + def create_agent request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_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: "create_agent", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::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 update_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Agent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] + # A result object deserialized from the server's reply + def update_agent request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_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: "update_agent", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 export_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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 restore_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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 validate_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::AgentValidationResult] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] + # A result object deserialized from the server's reply + def validate_agent request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_validate_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: "validate_agent", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult.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_agent_validation_result REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::AgentValidationResult] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] + # A result object deserialized from the server's reply + def get_agent_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_agent_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_agent_validation_result", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult.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_generative_settings REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::GenerativeSettings] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings] + # A result object deserialized from the server's reply + def get_generative_settings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_generative_settings_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_generative_settings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings.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_generative_settings REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::GenerativeSettings] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings] + # A result object deserialized from the server's reply + def update_generative_settings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_generative_settings_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_generative_settings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings.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_agents REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest] + # 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_agents_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/agents", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest] + # 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_agent_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/agents", + body: "agent", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest] + # 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_agent_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v3/{agent.name}", + body: "agent", + matches: [ + ["agent.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}:export", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the restore_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}:restore", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the validate_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_validate_agent_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:validate", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_agent_validation_result REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest] + # 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_validation_result_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/validationResult/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_generative_settings REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest] + # 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_generative_settings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/generativeSettings/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_generative_settings REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest] + # 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_generative_settings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v3/{generative_settings.name}", + body: "generative_settings", + matches: [ + ["generative_settings.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/generativeSettings/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/audio_config_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/audio_config_pb.rb new file mode 100644 index 000000000000..244fdc51b3b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/audio_config_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/audio_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/duration_pb' + + +descriptor_data = "\n0google/cloud/dialogflow/cx/v3/audio_config.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\"\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\"{\n\rBargeInConfig\x12\x37\n\x14no_barge_in_duration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x31\n\x0etotal_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"\x8d\x03\n\x10InputAudioConfig\x12I\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32,.google.cloud.dialogflow.cx.v3.AudioEncodingB\x03\xe0\x41\x02\x12\x19\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x12\x18\n\x10\x65nable_word_info\x18\r \x01(\x08\x12\x14\n\x0cphrase_hints\x18\x04 \x03(\t\x12\r\n\x05model\x18\x07 \x01(\t\x12H\n\rmodel_variant\x18\n \x01(\x0e\x32\x31.google.cloud.dialogflow.cx.v3.SpeechModelVariant\x12\x18\n\x10single_utterance\x18\x08 \x01(\x08\x12\x45\n\x0f\x62\x61rge_in_config\x18\x0f \x01(\x0b\x32,.google.cloud.dialogflow.cx.v3.BargeInConfig\x12)\n!opt_out_conformer_model_migration\x18\x1a \x01(\x08\"i\n\x14VoiceSelectionParams\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x43\n\x0bssml_gender\x18\x02 \x01(\x0e\x32..google.cloud.dialogflow.cx.v3.SsmlVoiceGender\"\xb6\x01\n\x16SynthesizeSpeechConfig\x12\x15\n\rspeaking_rate\x18\x01 \x01(\x01\x12\r\n\x05pitch\x18\x02 \x01(\x01\x12\x16\n\x0evolume_gain_db\x18\x03 \x01(\x01\x12\x1a\n\x12\x65\x66\x66\x65\x63ts_profile_id\x18\x05 \x03(\t\x12\x42\n\x05voice\x18\x04 \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.VoiceSelectionParams\"\xd8\x01\n\x11OutputAudioConfig\x12O\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32\x32.google.cloud.dialogflow.cx.v3.OutputAudioEncodingB\x03\xe0\x41\x02\x12\x19\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x12W\n\x18synthesize_speech_config\x18\x03 \x01(\x0b\x32\x35.google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig\"\x82\x02\n\x14TextToSpeechSettings\x12s\n\x19synthesize_speech_configs\x18\x01 \x03(\x0b\x32P.google.cloud.dialogflow.cx.v3.TextToSpeechSettings.SynthesizeSpeechConfigsEntry\x1au\n\x1cSynthesizeSpeechConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x44\n\x05value\x18\x02 \x01(\x0b\x32\x35.google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig:\x02\x38\x01*\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\x8b\x02\n!com.google.cloud.dialogflow.cx.v3B\x10\x41udioConfigProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3\xea\x41U\n\x1b\x61utoml.googleapis.com/Model\x12\x36projects/{project}/locations/{location}/models/{model}b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + SpeechWordInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SpeechWordInfo").msgclass + BargeInConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BargeInConfig").msgclass + InputAudioConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.InputAudioConfig").msgclass + VoiceSelectionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.VoiceSelectionParams").msgclass + SynthesizeSpeechConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig").msgclass + OutputAudioConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.OutputAudioConfig").msgclass + TextToSpeechSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TextToSpeechSettings").msgclass + AudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.AudioEncoding").enummodule + SpeechModelVariant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SpeechModelVariant").enummodule + SsmlVoiceGender = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SsmlVoiceGender").enummodule + OutputAudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.OutputAudioEncoding").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/bindings_override.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/bindings_override.rb new file mode 100644 index 000000000000..2b02b38167a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/bindings_override.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See 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 + module CX + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/dialogflow/cx/v3/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new + # + module V3 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Dialogflow", "CX"] + 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: "/v3/{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: "/v3/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelog_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelog_pb.rb new file mode 100644 index 000000000000..e397c2dcf543 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelog_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/changelog.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/timestamp_pb' + + +descriptor_data = "\n-google/cloud/dialogflow/cx/v3/changelog.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8b\x01\n\x15ListChangelogsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#dialogflow.googleapis.com/Changelog\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"o\n\x16ListChangelogsResponse\x12<\n\nchangelogs\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.cx.v3.Changelog\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"P\n\x13GetChangelogRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#dialogflow.googleapis.com/Changelog\"\xb4\x02\n\tChangelog\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nuser_email\x18\x02 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x07 \x01(\t\x12\x0e\n\x06\x61\x63tion\x18\x0b \x01(\t\x12\x0c\n\x04type\x18\x08 \x01(\t\x12\x10\n\x08resource\x18\x03 \x01(\t\x12/\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rlanguage_code\x18\x0e \x01(\t:w\xea\x41t\n#dialogflow.googleapis.com/Changelog\x12Mprojects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}2\x87\x04\n\nChangelogs\x12\xc7\x01\n\x0eListChangelogs\x12\x34.google.cloud.dialogflow.cx.v3.ListChangelogsRequest\x1a\x35.google.cloud.dialogflow.cx.v3.ListChangelogsResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v3/{parent=projects/*/locations/*/agents/*}/changelogs\x12\xb4\x01\n\x0cGetChangelog\x12\x32.google.cloud.dialogflow.cx.v3.GetChangelogRequest\x1a(.google.cloud.dialogflow.cx.v3.Changelog\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\x12\x37/v3/{name=projects/*/locations/*/agents/*/changelogs/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xb1\x01\n!com.google.cloud.dialogflow.cx.v3B\x0e\x43hangelogProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ListChangelogsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListChangelogsRequest").msgclass + ListChangelogsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListChangelogsResponse").msgclass + GetChangelogRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetChangelogRequest").msgclass + Changelog = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Changelog").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelog_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelog_services_pb.rb new file mode 100644 index 000000000000..14b28b74492e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelog_services_pb.rb @@ -0,0 +1,49 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/cx/v3/changelog.proto for package 'Google.Cloud.Dialogflow.CX.V3' +# 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/cx/v3/changelog_pb' + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Changelogs + # Service for managing [Changelogs][google.cloud.dialogflow.cx.v3.Changelog]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.cx.v3.Changelogs' + + # Returns the list of Changelogs. + rpc :ListChangelogs, ::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListChangelogsResponse + # Retrieves the specified Changelog. + rpc :GetChangelog, ::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest, ::Google::Cloud::Dialogflow::CX::V3::Changelog + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs.rb new file mode 100644 index 000000000000..fe2be82b78aa --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs.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/cx/v3/version" + +require "google/cloud/dialogflow/cx/v3/changelogs/credentials" +require "google/cloud/dialogflow/cx/v3/changelogs/paths" +require "google/cloud/dialogflow/cx/v3/changelogs/client" +require "google/cloud/dialogflow/cx/v3/changelogs/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Changelog Changelogs}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/cx/v3/changelogs" + # client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/cx/v3/changelogs/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.new + # + module Changelogs + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "changelogs", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/changelogs/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb new file mode 100644 index 000000000000..6f21e7c8f3c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb @@ -0,0 +1,624 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/changelog_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Changelogs + ## + # Client for the Changelogs service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Changelog Changelogs}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :changelogs_stub + + ## + # Configure the Changelogs Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Changelogs clients + # ::Google::Cloud::Dialogflow::CX::V3::Changelogs::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", "CX", "V3"] + 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 Changelogs 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::CX::V3::Changelogs::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 + @changelogs_stub.universe_domain + end + + ## + # Create a new Changelogs client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Changelogs 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/cx/v3/changelog_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 + + @changelogs_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::CX::V3::Changelogs::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 + ) + + @changelogs_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 = @changelogs_stub.endpoint + config.universe_domain = @changelogs_stub.universe_domain + config.logger = @changelogs_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 + @changelogs_stub.logger + end + + # Service calls + + ## + # Returns the list of Changelogs. + # + # @overload list_changelogs(request, options = nil) + # Pass arguments to `list_changelogs` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_changelogs(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_changelogs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 containing the changelogs. + # Format: `projects//locations//agents/`. + # @param filter [::String] + # The filter string. Supports filter by user_email, resource, type and + # create_time. Some examples: + # 1. By user email: + # user_email = "someone@google.com" + # 2. By resource name: + # resource = "projects/123/locations/global/agents/456/flows/789" + # 3. By resource display name: + # display_name = "my agent" + # 4. By action: + # action = "Create" + # 5. By type: + # type = "flows" + # 6. By create time. Currently predicates on `create_time` and + # `create_time_epoch_seconds` are supported: + # create_time_epoch_seconds > 1551790877 AND create_time <= + # 2017-01-15T01:30:15.01Z + # 7. Combination of above filters: + # resource = "projects/123/locations/global/agents/456/flows/789" + # AND user_email = "someone@google.com" + # AND create_time <= 2017-01-15T01:30:15.01Z + # @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::CX::V3::Changelog>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Changelog>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest.new + # + # # Call the list_changelogs method. + # result = client.list_changelogs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Changelog. + # p item + # end + # + def list_changelogs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest + + # Converts hash and nil to 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_changelogs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_changelogs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_changelogs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @changelogs_stub.call_rpc :list_changelogs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @changelogs_stub, :list_changelogs, 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 Changelog. + # + # @overload get_changelog(request, options = nil) + # Pass arguments to `get_changelog` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_changelog(name: nil) + # Pass arguments to `get_changelog` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 changelog to get. + # Format: + # `projects//locations//agents//changelogs/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Changelog] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Changelog] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest.new + # + # # Call the get_changelog method. + # result = client.get_changelog request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Changelog. + # p result + # + def get_changelog request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest + + # Converts hash and nil to 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_changelog.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_changelog.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_changelog.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @changelogs_stub.call_rpc :get_changelog, request, 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 Changelogs API. + # + # This class represents the configuration for Changelogs, + # 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::CX::V3::Changelogs::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_changelogs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_changelogs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_changelogs.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::CX::V3::Changelogs::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 Changelogs API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_changelogs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_changelogs + ## + # RPC-specific configuration for `get_changelog` + # @return [::Gapic::Config::Method] + # + attr_reader :get_changelog + + # @private + def initialize parent_rpcs = nil + list_changelogs_config = parent_rpcs.list_changelogs if parent_rpcs.respond_to? :list_changelogs + @list_changelogs = ::Gapic::Config::Method.new list_changelogs_config + get_changelog_config = parent_rpcs.get_changelog if parent_rpcs.respond_to? :get_changelog + @get_changelog = ::Gapic::Config::Method.new get_changelog_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/credentials.rb new file mode 100644 index 000000000000..824acb2ecdb4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Changelogs + # Credentials for the Changelogs 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/paths.rb new file mode 100644 index 000000000000..3bf87a11adfb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/paths.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! + + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Changelogs + # Path helper methods for the Changelogs API. + module Paths + ## + # Create a fully-qualified Agent resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # + # @return [::String] + def agent_path project:, location:, agent: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}" + end + + ## + # Create a fully-qualified Changelog resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param changelog [String] + # + # @return [::String] + def changelog_path project:, location:, agent:, changelog: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/changelogs/#{changelog}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest.rb new file mode 100644 index 000000000000..e726f27da37e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/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/cx/v3/version" +require "google/cloud/dialogflow/cx/v3/bindings_override" + +require "google/cloud/dialogflow/cx/v3/changelogs/credentials" +require "google/cloud/dialogflow/cx/v3/changelogs/paths" +require "google/cloud/dialogflow/cx/v3/changelogs/rest/client" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Changelog Changelogs}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/cx/v3/changelogs/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.new + # + module Changelogs + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/changelogs/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb new file mode 100644 index 000000000000..03b9fc92e606 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb @@ -0,0 +1,575 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/dialogflow/cx/v3/changelog_pb" +require "google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Changelogs + module Rest + ## + # REST client for the Changelogs service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Changelog Changelogs}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :changelogs_stub + + ## + # Configure the Changelogs Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Changelogs clients + # ::Google::Cloud::Dialogflow::CX::V3::Changelogs::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", "CX", "V3"] + 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 Changelogs 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::CX::V3::Changelogs::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 + @changelogs_stub.universe_domain + end + + ## + # Create a new Changelogs REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Changelogs 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 + + @changelogs_stub = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @changelogs_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 = @changelogs_stub.endpoint + config.universe_domain = @changelogs_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @changelogs_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 + @changelogs_stub.logger + end + + # Service calls + + ## + # Returns the list of Changelogs. + # + # @overload list_changelogs(request, options = nil) + # Pass arguments to `list_changelogs` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_changelogs(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_changelogs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 containing the changelogs. + # Format: `projects//locations//agents/`. + # @param filter [::String] + # The filter string. Supports filter by user_email, resource, type and + # create_time. Some examples: + # 1. By user email: + # user_email = "someone@google.com" + # 2. By resource name: + # resource = "projects/123/locations/global/agents/456/flows/789" + # 3. By resource display name: + # display_name = "my agent" + # 4. By action: + # action = "Create" + # 5. By type: + # type = "flows" + # 6. By create time. Currently predicates on `create_time` and + # `create_time_epoch_seconds` are supported: + # create_time_epoch_seconds > 1551790877 AND create_time <= + # 2017-01-15T01:30:15.01Z + # 7. Combination of above filters: + # resource = "projects/123/locations/global/agents/456/flows/789" + # AND user_email = "someone@google.com" + # AND create_time <= 2017-01-15T01:30:15.01Z + # @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::CX::V3::Changelog>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Changelog>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest.new + # + # # Call the list_changelogs method. + # result = client.list_changelogs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Changelog. + # p item + # end + # + def list_changelogs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest + + # Converts hash and nil to an 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_changelogs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_changelogs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_changelogs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @changelogs_stub.list_changelogs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @changelogs_stub, :list_changelogs, "changelogs", 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 Changelog. + # + # @overload get_changelog(request, options = nil) + # Pass arguments to `get_changelog` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_changelog(name: nil) + # Pass arguments to `get_changelog` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 changelog to get. + # Format: + # `projects//locations//agents//changelogs/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Changelog] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Changelog] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest.new + # + # # Call the get_changelog method. + # result = client.get_changelog request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Changelog. + # p result + # + def get_changelog request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest + + # Converts hash and nil to an 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_changelog.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_changelog.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_changelog.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @changelogs_stub.get_changelog request, 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 Changelogs REST API. + # + # This class represents the configuration for Changelogs 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::CX::V3::Changelogs::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_changelogs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_changelogs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_changelogs.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 Changelogs API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_changelogs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_changelogs + ## + # RPC-specific configuration for `get_changelog` + # @return [::Gapic::Config::Method] + # + attr_reader :get_changelog + + # @private + def initialize parent_rpcs = nil + list_changelogs_config = parent_rpcs.list_changelogs if parent_rpcs.respond_to? :list_changelogs + @list_changelogs = ::Gapic::Config::Method.new list_changelogs_config + get_changelog_config = parent_rpcs.get_changelog if parent_rpcs.respond_to? :get_changelog + @get_changelog = ::Gapic::Config::Method.new get_changelog_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb new file mode 100644 index 000000000000..51d3e6f22d24 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb @@ -0,0 +1,205 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/dialogflow/cx/v3/changelog_pb" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Changelogs + module Rest + ## + # REST service stub for the Changelogs 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_changelogs REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::ListChangelogsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ListChangelogsResponse] + # A result object deserialized from the server's reply + def list_changelogs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_changelogs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_changelogs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::ListChangelogsResponse.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_changelog REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Changelog] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Changelog] + # A result object deserialized from the server's reply + def get_changelog request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_changelog_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_changelog", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Changelog.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_changelogs REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest] + # 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_changelogs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/changelogs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_changelog REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest] + # 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_changelog_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/changelogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/code_block_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/code_block_pb.rb new file mode 100644 index 000000000000..c21e771fb37d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/code_block_pb.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/code_block.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n.google/cloud/dialogflow/cx/v3/code_block.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\"\x1e\n\tCodeBlock\x12\x11\n\x04\x63ode\x18\x01 \x01(\tB\x03\xe0\x41\x01\x42\x8d\x01\n!com.google.cloud.dialogflow.cx.v3B\x0e\x43odeBlockProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module Cx + module V3 + CodeBlock = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CodeBlock").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/data_store_connection_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/data_store_connection_pb.rb new file mode 100644 index 000000000000..d26d07a2049c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/data_store_connection_pb.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/data_store_connection.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n9google/cloud/dialogflow/cx/v3/data_store_connection.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xc9\x01\n\x13\x44\x61taStoreConnection\x12\x45\n\x0f\x64\x61ta_store_type\x18\x01 \x01(\x0e\x32,.google.cloud.dialogflow.cx.v3.DataStoreType\x12\x12\n\ndata_store\x18\x02 \x01(\t\x12W\n\x18\x64ocument_processing_mode\x18\x04 \x01(\x0e\x32\x35.google.cloud.dialogflow.cx.v3.DocumentProcessingMode\"\xcd\x12\n\x1a\x44\x61taStoreConnectionSignals\x12|\n\x1brewriter_model_call_signals\x18\x01 \x01(\x0b\x32R.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignalsB\x03\xe0\x41\x01\x12\x1c\n\x0frewritten_query\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x65\n\x0fsearch_snippets\x18\x03 \x03(\x0b\x32G.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippetB\x03\xe0\x41\x01\x12\x8d\x01\n$answer_generation_model_call_signals\x18\x04 \x01(\x0b\x32Z.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignalsB\x03\xe0\x41\x01\x12\x13\n\x06\x61nswer\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12_\n\x0c\x61nswer_parts\x18\x06 \x03(\x0b\x32\x44.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPartB\x03\xe0\x41\x01\x12\x63\n\x0e\x63ited_snippets\x18\x07 \x03(\x0b\x32\x46.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippetB\x03\xe0\x41\x01\x12j\n\x11grounding_signals\x18\x08 \x01(\x0b\x32J.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignalsB\x03\xe0\x41\x01\x12\x64\n\x0esafety_signals\x18\t \x01(\x0b\x32G.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignalsB\x03\xe0\x41\x01\x1aX\n\x18RewriterModelCallSignals\x12\x17\n\x0frendered_prompt\x18\x01 \x01(\t\x12\x14\n\x0cmodel_output\x18\x02 \x01(\t\x12\r\n\x05model\x18\x03 \x01(\t\x1av\n\rSearchSnippet\x12\x16\n\x0e\x64ocument_title\x18\x01 \x01(\t\x12\x14\n\x0c\x64ocument_uri\x18\x02 \x01(\t\x12\x0c\n\x04text\x18\x03 \x01(\t\x12)\n\x08metadata\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a`\n AnswerGenerationModelCallSignals\x12\x17\n\x0frendered_prompt\x18\x01 \x01(\t\x12\x14\n\x0cmodel_output\x18\x02 \x01(\t\x12\r\n\x05model\x18\x03 \x01(\t\x1a\x36\n\nAnswerPart\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x1a\n\x12supporting_indices\x18\x02 \x03(\x05\x1a\x86\x01\n\x0c\x43itedSnippet\x12_\n\x0esearch_snippet\x18\x01 \x01(\x0b\x32G.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet\x12\x15\n\rsnippet_index\x18\x02 \x01(\x05\x1a\xdd\x03\n\x10GroundingSignals\x12n\n\x08\x64\x65\x63ision\x18\x01 \x01(\x0e\x32\\.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingDecision\x12n\n\x05score\x18\x02 \x01(\x0e\x32_.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket\"m\n\x11GroundingDecision\x12\"\n\x1eGROUNDING_DECISION_UNSPECIFIED\x10\x00\x12\x19\n\x15\x41\x43\x43\x45PTED_BY_GROUNDING\x10\x01\x12\x19\n\x15REJECTED_BY_GROUNDING\x10\x02\"z\n\x14GroundingScoreBucket\x12&\n\"GROUNDING_SCORE_BUCKET_UNSPECIFIED\x10\x00\x12\x0c\n\x08VERY_LOW\x10\x01\x12\x07\n\x03LOW\x10\x03\x12\n\n\x06MEDIUM\x10\x04\x12\x08\n\x04HIGH\x10\x05\x12\r\n\tVERY_HIGH\x10\x06\x1a\x99\x04\n\rSafetySignals\x12h\n\x08\x64\x65\x63ision\x18\x01 \x01(\x0e\x32V.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.SafetyDecision\x12v\n\x13\x62\x61nned_phrase_match\x18\x02 \x01(\x0e\x32Y.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch\x12\x1d\n\x15matched_banned_phrase\x18\x03 \x01(\t\"m\n\x0eSafetyDecision\x12\x1f\n\x1bSAFETY_DECISION_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x41\x43\x43\x45PTED_BY_SAFETY_CHECK\x10\x01\x12\x1c\n\x18REJECTED_BY_SAFETY_CHECK\x10\x02\"\x97\x01\n\x11\x42\x61nnedPhraseMatch\x12#\n\x1f\x42\x41NNED_PHRASE_MATCH_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x42\x41NNED_PHRASE_MATCH_NONE\x10\x01\x12\x1d\n\x19\x42\x41NNED_PHRASE_MATCH_QUERY\x10\x02\x12 \n\x1c\x42\x41NNED_PHRASE_MATCH_RESPONSE\x10\x03*b\n\rDataStoreType\x12\x1f\n\x1b\x44\x41TA_STORE_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nPUBLIC_WEB\x10\x01\x12\x10\n\x0cUNSTRUCTURED\x10\x02\x12\x0e\n\nSTRUCTURED\x10\x03*]\n\x16\x44ocumentProcessingMode\x12(\n$DOCUMENT_PROCESSING_MODE_UNSPECIFIED\x10\x00\x12\r\n\tDOCUMENTS\x10\x01\x12\n\n\x06\x43HUNKS\x10\x02\x42\xbb\x01\n!com.google.cloud.dialogflow.cx.v3B\x18\x44\x61taStoreConnectionProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + DataStoreConnection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnection").msgclass + DataStoreConnectionSignals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals").msgclass + DataStoreConnectionSignals::RewriterModelCallSignals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals").msgclass + DataStoreConnectionSignals::SearchSnippet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet").msgclass + DataStoreConnectionSignals::AnswerGenerationModelCallSignals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals").msgclass + DataStoreConnectionSignals::AnswerPart = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart").msgclass + DataStoreConnectionSignals::CitedSnippet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet").msgclass + DataStoreConnectionSignals::GroundingSignals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals").msgclass + DataStoreConnectionSignals::GroundingSignals::GroundingDecision = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingDecision").enummodule + DataStoreConnectionSignals::GroundingSignals::GroundingScoreBucket = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket").enummodule + DataStoreConnectionSignals::SafetySignals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals").msgclass + DataStoreConnectionSignals::SafetySignals::SafetyDecision = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.SafetyDecision").enummodule + DataStoreConnectionSignals::SafetySignals::BannedPhraseMatch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch").enummodule + DataStoreType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreType").enummodule + DocumentProcessingMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DocumentProcessingMode").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployment_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployment_pb.rb new file mode 100644 index 000000000000..9dfd45e59043 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployment_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/deployment.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/timestamp_pb' + + +descriptor_data = "\n.google/cloud/dialogflow/cx/v3/deployment.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb3\x05\n\nDeployment\x12\x0c\n\x04name\x18\x01 \x01(\t\x12<\n\x0c\x66low_version\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Version\x12>\n\x05state\x18\x03 \x01(\x0e\x32/.google.cloud.dialogflow.cx.v3.Deployment.State\x12@\n\x06result\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.Deployment.Result\x12.\n\nstart_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x97\x01\n\x06Result\x12N\n\x17\x64\x65ployment_test_results\x18\x01 \x03(\tB-\xfa\x41*\n(dialogflow.googleapis.com/TestCaseResult\x12=\n\nexperiment\x18\x02 \x01(\tB)\xfa\x41&\n$dialogflow.googleapis.com/Experiment\"F\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03:\x96\x01\xea\x41\x92\x01\n$dialogflow.googleapis.com/Deployment\x12jprojects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}\"}\n\x16ListDeploymentsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/Deployment\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"r\n\x17ListDeploymentsResponse\x12>\n\x0b\x64\x65ployments\x18\x01 \x03(\x0b\x32).google.cloud.dialogflow.cx.v3.Deployment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"R\n\x14GetDeploymentRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/Deployment2\xae\x04\n\x0b\x44\x65ployments\x12\xda\x01\n\x0fListDeployments\x12\x35.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest\x1a\x36.google.cloud.dialogflow.cx.v3.ListDeploymentsResponse\"X\xda\x41\x06parent\x82\xd3\xe4\x93\x02I\x12G/v3/{parent=projects/*/locations/*/agents/*/environments/*}/deployments\x12\xc7\x01\n\rGetDeployment\x12\x33.google.cloud.dialogflow.cx.v3.GetDeploymentRequest\x1a).google.cloud.dialogflow.cx.v3.Deployment\"V\xda\x41\x04name\x82\xd3\xe4\x93\x02I\x12G/v3/{name=projects/*/locations/*/agents/*/environments/*/deployments/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xb2\x01\n!com.google.cloud.dialogflow.cx.v3B\x0f\x44\x65ploymentProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + Deployment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Deployment").msgclass + Deployment::Result = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Deployment.Result").msgclass + Deployment::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Deployment.State").enummodule + ListDeploymentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListDeploymentsRequest").msgclass + ListDeploymentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListDeploymentsResponse").msgclass + GetDeploymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetDeploymentRequest").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployment_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployment_services_pb.rb new file mode 100644 index 000000000000..5efd71c0faec --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployment_services_pb.rb @@ -0,0 +1,51 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/cx/v3/deployment.proto for package 'Google.Cloud.Dialogflow.CX.V3' +# 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/cx/v3/deployment_pb' + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Deployments + # Service for managing [Deployments][google.cloud.dialogflow.cx.v3.Deployment]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.cx.v3.Deployments' + + # Returns the list of all deployments in the specified + # [Environment][google.cloud.dialogflow.cx.v3.Environment]. + rpc :ListDeployments, ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsResponse + # Retrieves the specified + # [Deployment][google.cloud.dialogflow.cx.v3.Deployment]. + rpc :GetDeployment, ::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest, ::Google::Cloud::Dialogflow::CX::V3::Deployment + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments.rb new file mode 100644 index 000000000000..2e3eb43326ff --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments.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/cx/v3/version" + +require "google/cloud/dialogflow/cx/v3/deployments/credentials" +require "google/cloud/dialogflow/cx/v3/deployments/paths" +require "google/cloud/dialogflow/cx/v3/deployments/client" +require "google/cloud/dialogflow/cx/v3/deployments/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployments}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/cx/v3/deployments" + # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/cx/v3/deployments/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new + # + module Deployments + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "deployments", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/deployments/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb new file mode 100644 index 000000000000..017d8b7fce00 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb @@ -0,0 +1,606 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/deployment_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Deployments + ## + # Client for the Deployments service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployments}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :deployments_stub + + ## + # Configure the Deployments Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::Deployments::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Deployments clients + # ::Google::Cloud::Dialogflow::CX::V3::Deployments::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", "CX", "V3"] + 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 Deployments 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::CX::V3::Deployments::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 + @deployments_stub.universe_domain + end + + ## + # Create a new Deployments client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Deployments 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/cx/v3/deployment_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 + + @deployments_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::CX::V3::Deployments::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 + ) + + @deployments_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 = @deployments_stub.endpoint + config.universe_domain = @deployments_stub.universe_domain + config.logger = @deployments_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 + @deployments_stub.logger + end + + # Service calls + + ## + # Returns the list of all deployments in the specified + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. + # + # @overload list_deployments(request, options = nil) + # Pass arguments to `list_deployments` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_deployments(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_deployments` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to + # list all environments for. Format: + # `projects//locations//agents//environments/`. + # @param page_size [::Integer] + # The maximum number of items to return in a single page. By default 20 and + # at most 100. + # @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::CX::V3::Deployment>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Deployment>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest.new + # + # # Call the list_deployments method. + # result = client.list_deployments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Deployment. + # p item + # end + # + def list_deployments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest + + # Converts hash and nil to 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_deployments.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_deployments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_deployments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @deployments_stub.call_rpc :list_deployments, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @deployments_stub, :list_deployments, 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 + # {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployment}. + # + # @overload get_deployment(request, options = nil) + # Pass arguments to `get_deployment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_deployment(name: nil) + # Pass arguments to `get_deployment` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 + # {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployment}. Format: + # `projects//locations//agents//environments//deployments/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Deployment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Deployment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest.new + # + # # Call the get_deployment method. + # result = client.get_deployment request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Deployment. + # p result + # + def get_deployment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest + + # Converts hash and nil to 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_deployment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_deployment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_deployment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @deployments_stub.call_rpc :get_deployment, request, 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 Deployments API. + # + # This class represents the configuration for Deployments, + # 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::CX::V3::Deployments::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_deployments to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_deployments.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_deployments.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::CX::V3::Deployments::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 Deployments API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_deployments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_deployments + ## + # RPC-specific configuration for `get_deployment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_deployment + + # @private + def initialize parent_rpcs = nil + list_deployments_config = parent_rpcs.list_deployments if parent_rpcs.respond_to? :list_deployments + @list_deployments = ::Gapic::Config::Method.new list_deployments_config + get_deployment_config = parent_rpcs.get_deployment if parent_rpcs.respond_to? :get_deployment + @get_deployment = ::Gapic::Config::Method.new get_deployment_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/credentials.rb new file mode 100644 index 000000000000..4721d9d99ca2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Deployments + # Credentials for the Deployments 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/paths.rb new file mode 100644 index 000000000000..7ed8ea8adf5f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/paths.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + module Deployments + # Path helper methods for the Deployments API. + module Paths + ## + # Create a fully-qualified Deployment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param environment [String] + # @param deployment [String] + # + # @return [::String] + def deployment_path project:, location:, agent:, environment:, deployment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}/deployments/#{deployment}" + end + + ## + # Create a fully-qualified Environment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param environment [String] + # + # @return [::String] + def environment_path project:, location:, agent:, environment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest.rb new file mode 100644 index 000000000000..96109c156abf --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/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/cx/v3/version" +require "google/cloud/dialogflow/cx/v3/bindings_override" + +require "google/cloud/dialogflow/cx/v3/deployments/credentials" +require "google/cloud/dialogflow/cx/v3/deployments/paths" +require "google/cloud/dialogflow/cx/v3/deployments/rest/client" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployments}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/cx/v3/deployments/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new + # + module Deployments + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/deployments/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb new file mode 100644 index 000000000000..021b9399873d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb @@ -0,0 +1,557 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/deployment_pb" +require "google/cloud/dialogflow/cx/v3/deployments/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Deployments + module Rest + ## + # REST client for the Deployments service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployments}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :deployments_stub + + ## + # Configure the Deployments Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Deployments clients + # ::Google::Cloud::Dialogflow::CX::V3::Deployments::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", "CX", "V3"] + 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 Deployments 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::CX::V3::Deployments::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 + @deployments_stub.universe_domain + end + + ## + # Create a new Deployments REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Deployments 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 + + @deployments_stub = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @deployments_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 = @deployments_stub.endpoint + config.universe_domain = @deployments_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @deployments_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 + @deployments_stub.logger + end + + # Service calls + + ## + # Returns the list of all deployments in the specified + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. + # + # @overload list_deployments(request, options = nil) + # Pass arguments to `list_deployments` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_deployments(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_deployments` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to + # list all environments for. Format: + # `projects//locations//agents//environments/`. + # @param page_size [::Integer] + # The maximum number of items to return in a single page. By default 20 and + # at most 100. + # @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::CX::V3::Deployment>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Deployment>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest.new + # + # # Call the list_deployments method. + # result = client.list_deployments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Deployment. + # p item + # end + # + def list_deployments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest + + # Converts hash and nil to an 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_deployments.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_deployments.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_deployments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @deployments_stub.list_deployments request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @deployments_stub, :list_deployments, "deployments", 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 + # {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployment}. + # + # @overload get_deployment(request, options = nil) + # Pass arguments to `get_deployment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_deployment(name: nil) + # Pass arguments to `get_deployment` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 + # {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployment}. Format: + # `projects//locations//agents//environments//deployments/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Deployment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Deployment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest.new + # + # # Call the get_deployment method. + # result = client.get_deployment request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Deployment. + # p result + # + def get_deployment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest + + # Converts hash and nil to an 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_deployment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_deployment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_deployment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @deployments_stub.get_deployment request, 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 Deployments REST API. + # + # This class represents the configuration for Deployments 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::CX::V3::Deployments::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_deployments to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_deployments.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_deployments.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 Deployments API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_deployments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_deployments + ## + # RPC-specific configuration for `get_deployment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_deployment + + # @private + def initialize parent_rpcs = nil + list_deployments_config = parent_rpcs.list_deployments if parent_rpcs.respond_to? :list_deployments + @list_deployments = ::Gapic::Config::Method.new list_deployments_config + get_deployment_config = parent_rpcs.get_deployment if parent_rpcs.respond_to? :get_deployment + @get_deployment = ::Gapic::Config::Method.new get_deployment_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb new file mode 100644 index 000000000000..1e2fc4b21f06 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb @@ -0,0 +1,205 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/dialogflow/cx/v3/deployment_pb" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Deployments + module Rest + ## + # REST service stub for the Deployments 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_deployments REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::ListDeploymentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsResponse] + # A result object deserialized from the server's reply + def list_deployments request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_deployments_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_deployments", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsResponse.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_deployment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Deployment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Deployment] + # A result object deserialized from the server's reply + def get_deployment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_deployment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_deployment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Deployment.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_deployments REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest] + # 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_deployments_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/deployments", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_deployment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest] + # 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_deployment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/deployments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_type_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_type_pb.rb new file mode 100644 index 000000000000..6ee3d1300a01 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_type_pb.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/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/cx/v3/inline_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n/google/cloud/dialogflow/cx/v3/entity_type.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/inline.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x9a\x06\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\x41\n\x04kind\x18\x03 \x01(\x0e\x32..google.cloud.dialogflow.cx.v3.EntityType.KindB\x03\xe0\x41\x02\x12X\n\x13\x61uto_expansion_mode\x18\x04 \x01(\x0e\x32;.google.cloud.dialogflow.cx.v3.EntityType.AutoExpansionMode\x12\x42\n\x08\x65ntities\x18\x05 \x03(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.EntityType.Entity\x12R\n\x10\x65xcluded_phrases\x18\x06 \x03(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase\x12\x1f\n\x17\x65nable_fuzzy_extraction\x18\x07 \x01(\x08\x12\x0e\n\x06redact\x18\t \x01(\x08\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\x1a$\n\x0e\x45xcludedPhrase\x12\x12\n\x05value\x18\x01 \x01(\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:{\xea\x41x\n$dialogflow.googleapis.com/EntityType\x12Pprojects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}\"\x90\x03\n\x18\x45xportEntityTypesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/EntityType\x12\x19\n\x0c\x65ntity_types\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12\x1f\n\x10\x65ntity_types_uri\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x12*\n\x1b\x65ntity_types_content_inline\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x12\\\n\x0b\x64\x61ta_format\x18\x05 \x01(\x0e\x32\x42.google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest.DataFormatB\x03\xe0\x41\x01\x12\x1a\n\rlanguage_code\x18\x06 \x01(\tB\x03\xe0\x41\x01\"E\n\nDataFormat\x12\x1b\n\x17\x44\x41TA_FORMAT_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42LOB\x10\x01\x12\x10\n\x0cJSON_PACKAGE\x10\x05\x42\r\n\x0b\x64\x65stination\"\xa2\x01\n\x19\x45xportEntityTypesResponse\x12\x1a\n\x10\x65ntity_types_uri\x18\x01 \x01(\tH\x00\x12P\n\x14\x65ntity_types_content\x18\x02 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.InlineDestinationH\x00\x42\x17\n\x15\x65xported_entity_types\"\x1b\n\x19\x45xportEntityTypesMetadata\"\xeb\x03\n\x18ImportEntityTypesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/EntityType\x12\x1a\n\x10\x65ntity_types_uri\x18\x02 \x01(\tH\x00\x12K\n\x14\x65ntity_types_content\x18\x03 \x01(\x0b\x32+.google.cloud.dialogflow.cx.v3.InlineSourceH\x00\x12^\n\x0cmerge_option\x18\x04 \x01(\x0e\x32\x43.google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.MergeOptionB\x03\xe0\x41\x02\x12H\n\x12target_entity_type\x18\x05 \x01(\tB,\xe0\x41\x01\xfa\x41&\n$dialogflow.googleapis.com/EntityType\"n\n\x0bMergeOption\x12\x1c\n\x18MERGE_OPTION_UNSPECIFIED\x10\x00\x12\x0b\n\x07REPLACE\x10\x01\x12\t\n\x05MERGE\x10\x02\x12\n\n\x06RENAME\x10\x03\x12\x13\n\x0fREPORT_CONFLICT\x10\x04\x12\x08\n\x04KEEP\x10\x05\x42\x0e\n\x0c\x65ntity_types\"\xa3\x02\n\x19ImportEntityTypesResponse\x12?\n\x0c\x65ntity_types\x18\x01 \x03(\tB)\xfa\x41&\n$dialogflow.googleapis.com/EntityType\x12l\n\x15\x63onflicting_resources\x18\x02 \x01(\x0b\x32M.google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources\x1aW\n\x14\x43onflictingResources\x12!\n\x19\x65ntity_type_display_names\x18\x01 \x03(\t\x12\x1c\n\x14\x65ntity_display_names\x18\x02 \x03(\t\"\x1b\n\x19ImportEntityTypesMetadata\"\x94\x01\n\x16ListEntityTypesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/EntityType\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"s\n\x17ListEntityTypesResponse\x12?\n\x0c\x65ntity_types\x18\x01 \x03(\x0b\x32).google.cloud.dialogflow.cx.v3.EntityType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"i\n\x14GetEntityTypeRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/EntityType\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\xb3\x01\n\x17\x43reateEntityTypeRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/EntityType\x12\x43\n\x0b\x65ntity_type\x18\x02 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.EntityTypeB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"\xa6\x01\n\x17UpdateEntityTypeRequest\x12\x43\n\x0b\x65ntity_type\x18\x01 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.EntityTypeB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"d\n\x17\x44\x65leteEntityTypeRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/EntityType\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\x32\xef\x0c\n\x0b\x45ntityTypes\x12\xb8\x01\n\rGetEntityType\x12\x33.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest\x1a).google.cloud.dialogflow.cx.v3.EntityType\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v3/{name=projects/*/locations/*/agents/*/entityTypes/*}\x12\xd9\x01\n\x10\x43reateEntityType\x12\x36.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest\x1a).google.cloud.dialogflow.cx.v3.EntityType\"b\xda\x41\x12parent,entity_type\x82\xd3\xe4\x93\x02G\"8/v3/{parent=projects/*/locations/*/agents/*}/entityTypes:\x0b\x65ntity_type\x12\xea\x01\n\x10UpdateEntityType\x12\x36.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest\x1a).google.cloud.dialogflow.cx.v3.EntityType\"s\xda\x41\x17\x65ntity_type,update_mask\x82\xd3\xe4\x93\x02S2D/v3/{entity_type.name=projects/*/locations/*/agents/*/entityTypes/*}:\x0b\x65ntity_type\x12\xab\x01\n\x10\x44\x65leteEntityType\x12\x36.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest\x1a\x16.google.protobuf.Empty\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v3/{name=projects/*/locations/*/agents/*/entityTypes/*}\x12\xcb\x01\n\x0fListEntityTypes\x12\x35.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest\x1a\x36.google.cloud.dialogflow.cx.v3.ListEntityTypesResponse\"I\xda\x41\x06parent\x82\xd3\xe4\x93\x02:\x12\x38/v3/{parent=projects/*/locations/*/agents/*}/entityTypes\x12\xf1\x01\n\x11\x45xportEntityTypes\x12\x37.google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest\x1a\x1d.google.longrunning.Operation\"\x83\x01\xca\x41\x36\n\x19\x45xportEntityTypesResponse\x12\x19\x45xportEntityTypesMetadata\x82\xd3\xe4\x93\x02\x44\"?/v3/{parent=projects/*/locations/*/agents/*}/entityTypes:export:\x01*\x12\xf1\x01\n\x11ImportEntityTypes\x12\x37.google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest\x1a\x1d.google.longrunning.Operation\"\x83\x01\xca\x41\x36\n\x19ImportEntityTypesResponse\x12\x19ImportEntityTypesMetadata\x82\xd3\xe4\x93\x02\x44\"?/v3/{parent=projects/*/locations/*/agents/*}/entityTypes:import:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xb2\x01\n!com.google.cloud.dialogflow.cx.v3B\x0f\x45ntityTypeProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.dialogflow.cx.v3.InlineDestination", "google/cloud/dialogflow/cx/v3/inline.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + EntityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.EntityType").msgclass + EntityType::Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.EntityType.Entity").msgclass + EntityType::ExcludedPhrase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase").msgclass + EntityType::Kind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.EntityType.Kind").enummodule + EntityType::AutoExpansionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.EntityType.AutoExpansionMode").enummodule + ExportEntityTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest").msgclass + ExportEntityTypesRequest::DataFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest.DataFormat").enummodule + ExportEntityTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse").msgclass + ExportEntityTypesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata").msgclass + ImportEntityTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest").msgclass + ImportEntityTypesRequest::MergeOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.MergeOption").enummodule + ImportEntityTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse").msgclass + ImportEntityTypesResponse::ConflictingResources = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources").msgclass + ImportEntityTypesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata").msgclass + ListEntityTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListEntityTypesRequest").msgclass + ListEntityTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListEntityTypesResponse").msgclass + GetEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetEntityTypeRequest").msgclass + CreateEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest").msgclass + UpdateEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest").msgclass + DeleteEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_type_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_type_services_pb.rb new file mode 100644 index 000000000000..8b475e4abab4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_type_services_pb.rb @@ -0,0 +1,71 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/cx/v3/entity_type.proto for package 'Google.Cloud.Dialogflow.CX.V3' +# 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/cx/v3/entity_type_pb' + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module EntityTypes + # Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3.EntityType]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.cx.v3.EntityTypes' + + # Retrieves the specified entity type. + rpc :GetEntityType, ::Google::Cloud::Dialogflow::CX::V3::GetEntityTypeRequest, ::Google::Cloud::Dialogflow::CX::V3::EntityType + # Creates an entity type in the specified agent. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc :CreateEntityType, ::Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest, ::Google::Cloud::Dialogflow::CX::V3::EntityType + # Updates the specified entity type. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc :UpdateEntityType, ::Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest, ::Google::Cloud::Dialogflow::CX::V3::EntityType + # Deletes the specified entity type. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc :DeleteEntityType, ::Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest, ::Google::Protobuf::Empty + # Returns the list of all entity types in the specified agent. + rpc :ListEntityTypes, ::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest, ::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesResponse + # Exports the selected entity types. + rpc :ExportEntityTypes, ::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest, ::Google::Longrunning::Operation + # Imports the specified entitytypes into the agent. + rpc :ImportEntityTypes, ::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types.rb new file mode 100644 index 000000000000..4ddd79c8213f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types.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/cx/v3/version" + +require "google/cloud/dialogflow/cx/v3/entity_types/credentials" +require "google/cloud/dialogflow/cx/v3/entity_types/paths" +require "google/cloud/dialogflow/cx/v3/entity_types/operations" +require "google/cloud/dialogflow/cx/v3/entity_types/client" +require "google/cloud/dialogflow/cx/v3/entity_types/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::EntityType EntityTypes}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/cx/v3/entity_types" + # client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/cx/v3/entity_types/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new + # + module EntityTypes + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "entity_types", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/entity_types/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb new file mode 100644 index 000000000000..333c41fc6259 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb @@ -0,0 +1,1243 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/entity_type_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module EntityTypes + ## + # Client for the EntityTypes service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityTypes::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all EntityTypes clients + # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] + 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::CX::V3::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::CX::V3::EntityTypes::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::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/cx/v3/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::CX::V3::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::CX::V3::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 + + ## + # 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::CX::V3::GetEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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//locations//agents//entityTypes/`. + # @param language_code [::String] + # The language to retrieve the entity type for. The following fields are + # language dependent: + # + # * `EntityType.entities.value` + # * `EntityType.entities.synonyms` + # * `EntityType.excluded_phrases.value` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::EntityType] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetEntityTypeRequest.new + # + # # Call the get_entity_type method. + # result = client.get_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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 a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload create_entity_type(request, options = nil) + # Pass arguments to `create_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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//locations//agents/`. + # @param entity_type [::Google::Cloud::Dialogflow::CX::V3::EntityType, ::Hash] + # Required. The entity type to create. + # @param language_code [::String] + # The language of the following fields in `entity_type`: + # + # * `EntityType.entities.value` + # * `EntityType.entities.synonyms` + # * `EntityType.excluded_phrases.value` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::EntityType] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest.new + # + # # Call the create_entity_type method. + # result = client.create_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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 a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload update_entity_type(request, options = nil) + # Pass arguments to `update_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityType, ::Hash] + # Required. The entity type to update. + # @param language_code [::String] + # The language of the following fields in `entity_type`: + # + # * `EntityType.entities.value` + # * `EntityType.entities.synonyms` + # * `EntityType.excluded_phrases.value` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The mask to control which fields get updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::EntityType] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest.new + # + # # Call the update_entity_type method. + # result = client.update_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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 a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload delete_entity_type(request, options = nil) + # Pass arguments to `delete_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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, force: 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//locations//agents//entityTypes/`. + # @param force [::Boolean] + # This field has no effect for entity type not being used. + # For entity types that are used by intents or pages: + # + # * If `force` is set to false, an error will be returned with message + # indicating the referencing resources. + # * If `force` is set to true, Dialogflow will remove the entity type, as + # well as any references to the entity type (i.e. Page + # {::Google::Cloud::Dialogflow::CX::V3::Form::Parameter parameter} of the entity + # type will be changed to + # '@sys.any' and intent + # {::Google::Cloud::Dialogflow::CX::V3::Intent::Parameter parameter} of the + # entity type will be removed). + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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 + + ## + # 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::CX::V3::ListEntityTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 for. + # Format: `projects//locations//agents/`. + # @param language_code [::String] + # The language to list entity types for. The following fields are language + # dependent: + # + # * `EntityType.entities.value` + # * `EntityType.entities.synonyms` + # * `EntityType.excluded_phrases.value` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + # @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::CX::V3::EntityType>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::EntityType>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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 + + ## + # Exports the selected entity types. + # + # @overload export_entity_types(request, options = nil) + # Pass arguments to `export_entity_types` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_types(parent: nil, entity_types: nil, entity_types_uri: nil, entity_types_content_inline: nil, data_format: nil, language_code: nil) + # Pass arguments to `export_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 parent agent to export entity types. + # Format: `projects//locations//agents/`. + # @param entity_types [::Array<::String>] + # Required. The name of the entity types to export. + # Format: + # `projects//locations//agents//entityTypes/`. + # @param entity_types_uri [::String] + # Optional. The [Google Cloud + # Storage](https://cloud.google.com/storage/docs/) URI to export the entity + # types to. The format of this URI must be + # `gs:///`. + # + # 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). + # + # Note: The following parameters are mutually exclusive: `entity_types_uri`, `entity_types_content_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_types_content_inline [::Boolean] + # Optional. The option to return the serialized entity types inline. + # + # Note: The following parameters are mutually exclusive: `entity_types_content_inline`, `entity_types_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 data_format [::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest::DataFormat] + # Optional. The data format of the exported entity types. If not specified, + # `BLOB` is assumed. + # @param language_code [::String] + # Optional. The language to retrieve the entity type for. The following + # fields are language dependent: + # + # * `EntityType.entities.value` + # * `EntityType.entities.synonyms` + # * `EntityType.excluded_phrases.value` + # + # If not specified, all language dependent fields will be retrieved. + # [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 [::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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest.new + # + # # Call the export_entity_types method. + # result = client.export_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 export_entity_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest + + # Converts hash and nil to 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_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::CX::V3::VERSION + metadata[:"x-goog-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_entity_types.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_entity_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.call_rpc :export_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 + + ## + # Imports the specified entitytypes into the agent. + # + # @overload import_entity_types(request, options = nil) + # Pass arguments to `import_entity_types` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_types(parent: nil, entity_types_uri: nil, entity_types_content: nil, merge_option: nil, target_entity_type: nil) + # Pass arguments to `import_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 import the entity types into. + # Format: `projects//locations//agents/`. + # @param entity_types_uri [::String] + # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + # to import entity types from. The format of this URI must be + # `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: `entity_types_uri`, `entity_types_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 entity_types_content [::Google::Cloud::Dialogflow::CX::V3::InlineSource, ::Hash] + # Uncompressed byte content of entity types. + # + # Note: The following parameters are mutually exclusive: `entity_types_content`, `entity_types_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 merge_option [::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest::MergeOption] + # Required. Merge option for importing entity types. + # @param target_entity_type [::String] + # Optional. The target entity type to import into. + # Format: + # `projects//locations//agents//entity_types/`. + # If set, there should be only one entity type included in + # [entity_types][google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.entity_types], + # of which the type should match the type of the target entity type. All + # {::Google::Cloud::Dialogflow::CX::V3::EntityType#entities entities} in the + # imported entity type will be added to the target entity type. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest.new + # + # # Call the import_entity_types method. + # result = client.import_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 import_entity_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest + + # Converts hash and nil to 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_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::CX::V3::VERSION + metadata[:"x-goog-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_entity_types.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_entity_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.call_rpc :import_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 + + ## + # 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::CX::V3::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 + # # get_entity_type to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_entity_type.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_entity_type.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::CX::V3::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. + # * `: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. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # 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 `list_entity_types` + # @return [::Gapic::Config::Method] + # + attr_reader :list_entity_types + ## + # RPC-specific configuration for `export_entity_types` + # @return [::Gapic::Config::Method] + # + attr_reader :export_entity_types + ## + # RPC-specific configuration for `import_entity_types` + # @return [::Gapic::Config::Method] + # + attr_reader :import_entity_types + + # @private + def initialize parent_rpcs = nil + 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 + 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 + export_entity_types_config = parent_rpcs.export_entity_types if parent_rpcs.respond_to? :export_entity_types + @export_entity_types = ::Gapic::Config::Method.new export_entity_types_config + import_entity_types_config = parent_rpcs.import_entity_types if parent_rpcs.respond_to? :import_entity_types + @import_entity_types = ::Gapic::Config::Method.new import_entity_types_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/credentials.rb new file mode 100644 index 000000000000..2b351cd1c438 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/operations.rb new file mode 100644 index 000000000000..e93af8ed6ffd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/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 CX + module V3 + 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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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. + # * `: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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/paths.rb new file mode 100644 index 000000000000..be3823154354 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/paths.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! + + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module EntityTypes + # Path helper methods for the EntityTypes API. + module Paths + ## + # Create a fully-qualified Agent resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # + # @return [::String] + def agent_path project:, location:, agent: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}" + end + + ## + # Create a fully-qualified EntityType resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param entity_type [String] + # + # @return [::String] + def entity_type_path project:, location:, agent:, entity_type: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/entityTypes/#{entity_type}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest.rb new file mode 100644 index 000000000000..a3136f87ea20 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/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/cx/v3/version" +require "google/cloud/dialogflow/cx/v3/bindings_override" + +require "google/cloud/dialogflow/cx/v3/entity_types/credentials" +require "google/cloud/dialogflow/cx/v3/entity_types/paths" +require "google/cloud/dialogflow/cx/v3/entity_types/rest/operations" +require "google/cloud/dialogflow/cx/v3/entity_types/rest/client" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::EntityType EntityTypes}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/cx/v3/entity_types/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new + # + module EntityTypes + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/entity_types/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb new file mode 100644 index 000000000000..c26a929a7fd6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb @@ -0,0 +1,1159 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/dialogflow/cx/v3/entity_type_pb" +require "google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module EntityTypes + module Rest + ## + # REST client for the EntityTypes service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityTypes::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all EntityTypes clients + # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] + 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::CX::V3::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::CX::V3::EntityTypes::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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 + + ## + # 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::CX::V3::GetEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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//locations//agents//entityTypes/`. + # @param language_code [::String] + # The language to retrieve the entity type for. The following fields are + # language dependent: + # + # * `EntityType.entities.value` + # * `EntityType.entities.synonyms` + # * `EntityType.excluded_phrases.value` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::EntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetEntityTypeRequest.new + # + # # Call the get_entity_type method. + # result = client.get_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload create_entity_type(request, options = nil) + # Pass arguments to `create_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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//locations//agents/`. + # @param entity_type [::Google::Cloud::Dialogflow::CX::V3::EntityType, ::Hash] + # Required. The entity type to create. + # @param language_code [::String] + # The language of the following fields in `entity_type`: + # + # * `EntityType.entities.value` + # * `EntityType.entities.synonyms` + # * `EntityType.excluded_phrases.value` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::EntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest.new + # + # # Call the create_entity_type method. + # result = client.create_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload update_entity_type(request, options = nil) + # Pass arguments to `update_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityType, ::Hash] + # Required. The entity type to update. + # @param language_code [::String] + # The language of the following fields in `entity_type`: + # + # * `EntityType.entities.value` + # * `EntityType.entities.synonyms` + # * `EntityType.excluded_phrases.value` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The mask to control which fields get updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::EntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest.new + # + # # Call the update_entity_type method. + # result = client.update_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload delete_entity_type(request, options = nil) + # Pass arguments to `delete_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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, force: 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//locations//agents//entityTypes/`. + # @param force [::Boolean] + # This field has no effect for entity type not being used. + # For entity types that are used by intents or pages: + # + # * If `force` is set to false, an error will be returned with message + # indicating the referencing resources. + # * If `force` is set to true, Dialogflow will remove the entity type, as + # well as any references to the entity type (i.e. Page + # {::Google::Cloud::Dialogflow::CX::V3::Form::Parameter parameter} of the entity + # type will be changed to + # '@sys.any' and intent + # {::Google::Cloud::Dialogflow::CX::V3::Intent::Parameter parameter} of the + # entity type will be removed). + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # 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::CX::V3::ListEntityTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 for. + # Format: `projects//locations//agents/`. + # @param language_code [::String] + # The language to list entity types for. The following fields are language + # dependent: + # + # * `EntityType.entities.value` + # * `EntityType.entities.synonyms` + # * `EntityType.excluded_phrases.value` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + # @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::CX::V3::EntityType>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::EntityType>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # Exports the selected entity types. + # + # @overload export_entity_types(request, options = nil) + # Pass arguments to `export_entity_types` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_types(parent: nil, entity_types: nil, entity_types_uri: nil, entity_types_content_inline: nil, data_format: nil, language_code: nil) + # Pass arguments to `export_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 parent agent to export entity types. + # Format: `projects//locations//agents/`. + # @param entity_types [::Array<::String>] + # Required. The name of the entity types to export. + # Format: + # `projects//locations//agents//entityTypes/`. + # @param entity_types_uri [::String] + # Optional. The [Google Cloud + # Storage](https://cloud.google.com/storage/docs/) URI to export the entity + # types to. The format of this URI must be + # `gs:///`. + # + # 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). + # + # Note: The following parameters are mutually exclusive: `entity_types_uri`, `entity_types_content_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_types_content_inline [::Boolean] + # Optional. The option to return the serialized entity types inline. + # + # Note: The following parameters are mutually exclusive: `entity_types_content_inline`, `entity_types_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 data_format [::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest::DataFormat] + # Optional. The data format of the exported entity types. If not specified, + # `BLOB` is assumed. + # @param language_code [::String] + # Optional. The language to retrieve the entity type for. The following + # fields are language dependent: + # + # * `EntityType.entities.value` + # * `EntityType.entities.synonyms` + # * `EntityType.excluded_phrases.value` + # + # If not specified, all language dependent fields will be retrieved. + # [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 [::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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest.new + # + # # Call the export_entity_types method. + # result = client.export_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 export_entity_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest + + # Converts hash and nil to an 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_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_entity_types.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_entity_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.export_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 + + ## + # Imports the specified entitytypes into the agent. + # + # @overload import_entity_types(request, options = nil) + # Pass arguments to `import_entity_types` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_types(parent: nil, entity_types_uri: nil, entity_types_content: nil, merge_option: nil, target_entity_type: nil) + # Pass arguments to `import_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 import the entity types into. + # Format: `projects//locations//agents/`. + # @param entity_types_uri [::String] + # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + # to import entity types from. The format of this URI must be + # `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: `entity_types_uri`, `entity_types_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 entity_types_content [::Google::Cloud::Dialogflow::CX::V3::InlineSource, ::Hash] + # Uncompressed byte content of entity types. + # + # Note: The following parameters are mutually exclusive: `entity_types_content`, `entity_types_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 merge_option [::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest::MergeOption] + # Required. Merge option for importing entity types. + # @param target_entity_type [::String] + # Optional. The target entity type to import into. + # Format: + # `projects//locations//agents//entity_types/`. + # If set, there should be only one entity type included in + # [entity_types][google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.entity_types], + # of which the type should match the type of the target entity type. All + # {::Google::Cloud::Dialogflow::CX::V3::EntityType#entities entities} in the + # imported entity type will be added to the target entity type. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest.new + # + # # Call the import_entity_types method. + # result = client.import_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 import_entity_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest + + # Converts hash and nil to an 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_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_entity_types.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_entity_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.import_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 + + ## + # 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::CX::V3::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 + # # get_entity_type to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_entity_type.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_entity_type.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # 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 `list_entity_types` + # @return [::Gapic::Config::Method] + # + attr_reader :list_entity_types + ## + # RPC-specific configuration for `export_entity_types` + # @return [::Gapic::Config::Method] + # + attr_reader :export_entity_types + ## + # RPC-specific configuration for `import_entity_types` + # @return [::Gapic::Config::Method] + # + attr_reader :import_entity_types + + # @private + def initialize parent_rpcs = nil + 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 + 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 + export_entity_types_config = parent_rpcs.export_entity_types if parent_rpcs.respond_to? :export_entity_types + @export_entity_types = ::Gapic::Config::Method.new export_entity_types_config + import_entity_types_config = parent_rpcs.import_entity_types if parent_rpcs.respond_to? :import_entity_types + @import_entity_types = ::Gapic::Config::Method.new import_entity_types_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/operations.rb new file mode 100644 index 000000000000..a7f85b3eafd6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/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 CX + module V3 + 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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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. + # * `: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: "/v3/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{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: "/v3/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb new file mode 100644 index 000000000000..ac316c062994 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb @@ -0,0 +1,514 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/entity_type_pb" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + 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 get_entity_type REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::EntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::EntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 list_entity_types REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::ListEntityTypesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 export_entity_types REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_entity_types request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_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: "export_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 import_entity_types REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_entity_types request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_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: "import_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 + + ## + # @private + # + # GRPC transcoding helper method for the get_entity_type REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/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::CX::V3::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: "/v3/{parent}/entityTypes", + body: "entity_type", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_entity_type REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{entity_type.name}", + body: "entity_type", + matches: [ + ["entity_type.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/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::CX::V3::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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_entity_types REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{parent}/entityTypes", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_entity_types REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest] + # 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_entity_types_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/entityTypes:export", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_entity_types REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest] + # 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_entity_types_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/entityTypes:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environment_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environment_pb.rb new file mode 100644 index 000000000000..1e470432e33d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environment_pb.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/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/cx/v3/test_case_pb' +require 'google/cloud/dialogflow/cx/v3/webhook_pb' +require 'google/longrunning/operations_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/cx/v3/environment.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/test_case.proto\x1a+google/cloud/dialogflow/cx/v3/webhook.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xaf\x06\n\x0b\x45nvironment\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12Q\n\x0fversion_configs\x18\x06 \x03(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.Environment.VersionConfig\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12U\n\x11test_cases_config\x18\x07 \x01(\x0b\x32:.google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig\x12P\n\x0ewebhook_config\x18\n \x01(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.Environment.WebhookConfig\x1aK\n\rVersionConfig\x12:\n\x07version\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Version\x1a\x8f\x01\n\x0fTestCasesConfig\x12;\n\ntest_cases\x18\x01 \x03(\tB\'\xfa\x41$\n\"dialogflow.googleapis.com/TestCase\x12\x1d\n\x15\x65nable_continuous_run\x18\x02 \x01(\x08\x12 \n\x18\x65nable_predeployment_run\x18\x03 \x01(\x08\x1aR\n\rWebhookConfig\x12\x41\n\x11webhook_overrides\x18\x01 \x03(\x0b\x32&.google.cloud.dialogflow.cx.v3.Webhook:}\xea\x41z\n%dialogflow.googleapis.com/Environment\x12Qprojects/{project}/locations/{location}/agents/{agent}/environments/{environment}\"\x7f\n\x17ListEnvironmentsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%dialogflow.googleapis.com/Environment\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"u\n\x18ListEnvironmentsResponse\x12@\n\x0c\x65nvironments\x18\x01 \x03(\x0b\x32*.google.cloud.dialogflow.cx.v3.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\"\x9f\x01\n\x18\x43reateEnvironmentRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%dialogflow.googleapis.com/Environment\x12\x44\n\x0b\x65nvironment\x18\x02 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.EnvironmentB\x03\xe0\x41\x02\"\x96\x01\n\x18UpdateEnvironmentRequest\x12\x44\n\x0b\x65nvironment\x18\x01 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.EnvironmentB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"W\n\x18\x44\x65leteEnvironmentRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Environment\"\x85\x01\n\x1fLookupEnvironmentHistoryRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Environment\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"}\n LookupEnvironmentHistoryResponse\x12@\n\x0c\x65nvironments\x18\x01 \x03(\x0b\x32*.google.cloud.dialogflow.cx.v3.Environment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x88\x04\n\x14\x43ontinuousTestResult\x12\x0c\n\x04name\x18\x01 \x01(\t\x12X\n\x06result\x18\x02 \x01(\x0e\x32H.google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult\x12H\n\x11test_case_results\x18\x03 \x03(\tB-\xfa\x41*\n(dialogflow.googleapis.com/TestCaseResult\x12,\n\x08run_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"V\n\x14\x41ggregatedTestResult\x12&\n\"AGGREGATED_TEST_RESULT_UNSPECIFIED\x10\x00\x12\n\n\x06PASSED\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02:\xb7\x01\xea\x41\xb3\x01\n.dialogflow.googleapis.com/ContinuousTestResult\x12\x80\x01projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}\"^\n\x18RunContinuousTestRequest\x12\x42\n\x0b\x65nvironment\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Environment\"p\n\x19RunContinuousTestResponse\x12S\n\x16\x63ontinuous_test_result\x18\x01 \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.ContinuousTestResult\"U\n\x19RunContinuousTestMetadata\x12\x38\n\x06\x65rrors\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.cx.v3.TestError\"\x91\x01\n ListContinuousTestResultsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.dialogflow.googleapis.com/ContinuousTestResult\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x92\x01\n!ListContinuousTestResultsResponse\x12T\n\x17\x63ontinuous_test_results\x18\x01 \x03(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.ContinuousTestResult\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x98\x01\n\x11\x44\x65ployFlowRequest\x12\x42\n\x0b\x65nvironment\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Environment\x12?\n\x0c\x66low_version\x18\x02 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Version\"i\n\x12\x44\x65ployFlowResponse\x12?\n\x0b\x65nvironment\x18\x01 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.Environment\x12\x12\n\ndeployment\x18\x02 \x01(\t\"S\n\x12\x44\x65ployFlowMetadata\x12=\n\x0btest_errors\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.cx.v3.TestError2\xc4\x11\n\x0c\x45nvironments\x12\xcf\x01\n\x10ListEnvironments\x12\x36.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest\x1a\x37.google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v3/{parent=projects/*/locations/*/agents/*}/environments\x12\xbc\x01\n\x0eGetEnvironment\x12\x34.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest\x1a*.google.cloud.dialogflow.cx.v3.Environment\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v3/{name=projects/*/locations/*/agents/*/environments/*}\x12\xf9\x01\n\x11\x43reateEnvironment\x12\x37.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41%\n\x0b\x45nvironment\x12\x16google.protobuf.Struct\xda\x41\x12parent,environment\x82\xd3\xe4\x93\x02H\"9/v3/{parent=projects/*/locations/*/agents/*}/environments:\x0b\x65nvironment\x12\x8a\x02\n\x11UpdateEnvironment\x12\x37.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest\x1a\x1d.google.longrunning.Operation\"\x9c\x01\xca\x41%\n\x0b\x45nvironment\x12\x16google.protobuf.Struct\xda\x41\x17\x65nvironment,update_mask\x82\xd3\xe4\x93\x02T2E/v3/{environment.name=projects/*/locations/*/agents/*/environments/*}:\x0b\x65nvironment\x12\xae\x01\n\x11\x44\x65leteEnvironment\x12\x37.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest\x1a\x16.google.protobuf.Empty\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;*9/v3/{name=projects/*/locations/*/agents/*/environments/*}\x12\xfe\x01\n\x18LookupEnvironmentHistory\x12>.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest\x1a?.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse\"a\xda\x41\x04name\x82\xd3\xe4\x93\x02T\x12R/v3/{name=projects/*/locations/*/agents/*/environments/*}:lookupEnvironmentHistory\x12\x84\x02\n\x11RunContinuousTest\x12\x37.google.cloud.dialogflow.cx.v3.RunContinuousTestRequest\x1a\x1d.google.longrunning.Operation\"\x96\x01\xca\x41\x36\n\x19RunContinuousTestResponse\x12\x19RunContinuousTestMetadata\x82\xd3\xe4\x93\x02W\"R/v3/{environment=projects/*/locations/*/agents/*/environments/*}:runContinuousTest:\x01*\x12\x82\x02\n\x19ListContinuousTestResults\x12?.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest\x1a@.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse\"b\xda\x41\x06parent\x82\xd3\xe4\x93\x02S\x12Q/v3/{parent=projects/*/locations/*/agents/*/environments/*}/continuousTestResults\x12\xe1\x01\n\nDeployFlow\x12\x30.google.cloud.dialogflow.cx.v3.DeployFlowRequest\x1a\x1d.google.longrunning.Operation\"\x81\x01\xca\x41(\n\x12\x44\x65ployFlowResponse\x12\x12\x44\x65ployFlowMetadata\x82\xd3\xe4\x93\x02P\"K/v3/{environment=projects/*/locations/*/agents/*/environments/*}:deployFlow:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xb3\x01\n!com.google.cloud.dialogflow.cx.v3B\x10\x45nvironmentProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.dialogflow.cx.v3.Webhook", "google/cloud/dialogflow/cx/v3/webhook.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.dialogflow.cx.v3.TestError", "google/cloud/dialogflow/cx/v3/test_case.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + Environment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Environment").msgclass + Environment::VersionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Environment.VersionConfig").msgclass + Environment::TestCasesConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig").msgclass + Environment::WebhookConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Environment.WebhookConfig").msgclass + ListEnvironmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest").msgclass + ListEnvironmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse").msgclass + GetEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetEnvironmentRequest").msgclass + CreateEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest").msgclass + UpdateEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest").msgclass + DeleteEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest").msgclass + LookupEnvironmentHistoryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest").msgclass + LookupEnvironmentHistoryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse").msgclass + ContinuousTestResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ContinuousTestResult").msgclass + ContinuousTestResult::AggregatedTestResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult").enummodule + RunContinuousTestRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RunContinuousTestRequest").msgclass + RunContinuousTestResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RunContinuousTestResponse").msgclass + RunContinuousTestMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata").msgclass + ListContinuousTestResultsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest").msgclass + ListContinuousTestResultsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse").msgclass + DeployFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeployFlowRequest").msgclass + DeployFlowResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeployFlowResponse").msgclass + DeployFlowMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeployFlowMetadata").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environment_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environment_services_pb.rb new file mode 100644 index 000000000000..904483183374 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environment_services_pb.rb @@ -0,0 +1,106 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/cx/v3/environment.proto for package 'Google.Cloud.Dialogflow.CX.V3' +# 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/cx/v3/environment_pb' + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Environments + # Service for managing + # [Environments][google.cloud.dialogflow.cx.v3.Environment]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.cx.v3.Environments' + + # Returns the list of all environments in the specified + # [Agent][google.cloud.dialogflow.cx.v3.Agent]. + rpc :ListEnvironments, ::Google::Cloud::Dialogflow::CX::V3::ListEnvironmentsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListEnvironmentsResponse + # Retrieves the specified + # [Environment][google.cloud.dialogflow.cx.v3.Environment]. + rpc :GetEnvironment, ::Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest, ::Google::Cloud::Dialogflow::CX::V3::Environment + # Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the + # specified [Agent][google.cloud.dialogflow.cx.v3.Agent]. + # + # 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`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: [Environment][google.cloud.dialogflow.cx.v3.Environment] + rpc :CreateEnvironment, ::Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest, ::Google::Longrunning::Operation + # Updates the specified + # [Environment][google.cloud.dialogflow.cx.v3.Environment]. + # + # 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`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: [Environment][google.cloud.dialogflow.cx.v3.Environment] + rpc :UpdateEnvironment, ::Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest, ::Google::Longrunning::Operation + # Deletes the specified + # [Environment][google.cloud.dialogflow.cx.v3.Environment]. + rpc :DeleteEnvironment, ::Google::Cloud::Dialogflow::CX::V3::DeleteEnvironmentRequest, ::Google::Protobuf::Empty + # Looks up the history of the specified + # [Environment][google.cloud.dialogflow.cx.v3.Environment]. + rpc :LookupEnvironmentHistory, ::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest, ::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryResponse + # Kicks off a continuous test under the specified + # [Environment][google.cloud.dialogflow.cx.v3.Environment]. + # + # 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`: + # [RunContinuousTestMetadata][google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata] + # - `response`: + # [RunContinuousTestResponse][google.cloud.dialogflow.cx.v3.RunContinuousTestResponse] + rpc :RunContinuousTest, ::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest, ::Google::Longrunning::Operation + # Fetches a list of continuous test results for a given environment. + rpc :ListContinuousTestResults, ::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsResponse + # Deploys a flow to the specified + # [Environment][google.cloud.dialogflow.cx.v3.Environment]. + # + # 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`: + # [DeployFlowMetadata][google.cloud.dialogflow.cx.v3.DeployFlowMetadata] + # - `response`: + # [DeployFlowResponse][google.cloud.dialogflow.cx.v3.DeployFlowResponse] + rpc :DeployFlow, ::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments.rb new file mode 100644 index 000000000000..bab4ad76c69e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments.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/cx/v3/version" + +require "google/cloud/dialogflow/cx/v3/environments/credentials" +require "google/cloud/dialogflow/cx/v3/environments/paths" +require "google/cloud/dialogflow/cx/v3/environments/operations" +require "google/cloud/dialogflow/cx/v3/environments/client" +require "google/cloud/dialogflow/cx/v3/environments/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environments}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/cx/v3/environments" + # client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/cx/v3/environments/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new + # + module Environments + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "environments", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/environments/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/client.rb new file mode 100644 index 000000000000..d35c1676530d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/client.rb @@ -0,0 +1,1382 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/environment_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Environments + ## + # Client for the Environments service. + # + # Service for managing + # {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Environments::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Environments clients + # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] + 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::CX::V3::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::CX::V3::Environments::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::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/cx/v3/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 + + @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 + + @environments_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::CX::V3::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 long-running operations. + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Environments::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 + @environments_stub.logger + end + + # Service calls + + ## + # Returns the list of all environments in the specified + # {::Google::Cloud::Dialogflow::CX::V3::Agent Agent}. + # + # @overload list_environments(request, options = nil) + # Pass arguments to `list_environments` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListEnvironmentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Agent Agent} to list all + # environments for. Format: + # `projects//locations//agents/`. + # @param page_size [::Integer] + # The maximum number of items to return in a single page. By default 20 and + # at most 100. + # @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::CX::V3::Environment>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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 + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. + # + # @overload get_environment(request, options = nil) + # Pass arguments to `get_environment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. Format: + # `projects//locations//agents//environments/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Environment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Environment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest.new + # + # # Call the get_environment method. + # result = client.get_environment request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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 {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} in the + # specified {::Google::Cloud::Dialogflow::CX::V3::Agent Agent}. + # + # 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`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} + # + # @overload create_environment(request, options = nil) + # Pass arguments to `create_environment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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) + # 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 {::Google::Cloud::Dialogflow::CX::V3::Agent Agent} to create an + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} for. Format: + # `projects//locations//agents/`. + # @param environment [::Google::Cloud::Dialogflow::CX::V3::Environment, ::Hash] + # Required. The environment 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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest.new + # + # # Call the create_environment method. + # result = client.create_environment request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_environment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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| + 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 + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. + # + # 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`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} + # + # @overload update_environment(request, options = nil) + # Pass arguments to `update_environment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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) + # 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::CX::V3::Environment, ::Hash] + # Required. The environment 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 [::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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest.new + # + # # Call the update_environment method. + # result = client.update_environment request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_environment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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| + 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 + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. + # + # @overload delete_environment(request, options = nil) + # Pass arguments to `delete_environment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to delete. Format: + # `projects//locations//agents//environments/`. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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 + + ## + # Looks up the history of the specified + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. + # + # @overload lookup_environment_history(request, options = nil) + # Pass arguments to `lookup_environment_history` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload lookup_environment_history(name: nil, page_size: nil, page_token: nil) + # Pass arguments to `lookup_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 name [::String] + # Required. Resource name of the environment to look up the history for. + # Format: + # `projects//locations//agents//environments/`. + # @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::CX::V3::Environment>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest.new + # + # # Call the lookup_environment_history method. + # result = client.lookup_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::CX::V3::Environment. + # p item + # end + # + def lookup_environment_history request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.lookup_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.lookup_environment_history.timeout, + metadata: metadata, + retry_policy: @config.rpcs.lookup_environment_history.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @environments_stub.call_rpc :lookup_environment_history, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @environments_stub, :lookup_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 + + ## + # Kicks off a continuous test under the specified + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. + # + # 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::CX::V3::RunContinuousTestMetadata RunContinuousTestMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestResponse RunContinuousTestResponse} + # + # @overload run_continuous_test(request, options = nil) + # Pass arguments to `run_continuous_test` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload run_continuous_test(environment: nil) + # Pass arguments to `run_continuous_test` via keyword arguments. Note that at + # least one keyword argument is 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 [::String] + # Required. Format: + # `projects//locations//agents//environments/`. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest.new + # + # # Call the run_continuous_test method. + # result = client.run_continuous_test request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def run_continuous_test request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.run_continuous_test.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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 + header_params["environment"] = request.environment + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.run_continuous_test.timeout, + metadata: metadata, + retry_policy: @config.rpcs.run_continuous_test.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @environments_stub.call_rpc :run_continuous_test, 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 + + ## + # Fetches a list of continuous test results for a given environment. + # + # @overload list_continuous_test_results(request, options = nil) + # Pass arguments to `list_continuous_test_results` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_continuous_test_results(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_continuous_test_results` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The environment to list results for. + # Format: + # `projects//locations//agents//environments/`. + # @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::CX::V3::ContinuousTestResult>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest.new + # + # # Call the list_continuous_test_results method. + # result = client.list_continuous_test_results request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::ContinuousTestResult. + # p item + # end + # + def list_continuous_test_results request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest + + # Converts hash and nil to 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_continuous_test_results.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_continuous_test_results.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_continuous_test_results.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @environments_stub.call_rpc :list_continuous_test_results, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @environments_stub, :list_continuous_test_results, 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 + + ## + # Deploys a flow to the specified + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. + # + # 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::CX::V3::DeployFlowMetadata DeployFlowMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::DeployFlowResponse DeployFlowResponse} + # + # @overload deploy_flow(request, options = nil) + # Pass arguments to `deploy_flow` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_flow(environment: nil, flow_version: nil) + # Pass arguments to `deploy_flow` via keyword arguments. Note that at + # least one keyword argument is 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 [::String] + # Required. The environment to deploy the flow to. + # Format: + # `projects//locations//agents//environments/`. + # @param flow_version [::String] + # Required. The flow version to deploy. + # Format: + # `projects//locations//agents//flows//versions/`. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest.new + # + # # Call the deploy_flow method. + # result = client.deploy_flow request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_flow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest + + # Converts hash and nil to 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_flow.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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 + header_params["environment"] = request.environment + end + + request_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_flow.timeout, + metadata: metadata, + retry_policy: @config.rpcs.deploy_flow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @environments_stub.call_rpc :deploy_flow, 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 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::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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. + # * `: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. + # * `: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 `lookup_environment_history` + # @return [::Gapic::Config::Method] + # + attr_reader :lookup_environment_history + ## + # RPC-specific configuration for `run_continuous_test` + # @return [::Gapic::Config::Method] + # + attr_reader :run_continuous_test + ## + # RPC-specific configuration for `list_continuous_test_results` + # @return [::Gapic::Config::Method] + # + attr_reader :list_continuous_test_results + ## + # RPC-specific configuration for `deploy_flow` + # @return [::Gapic::Config::Method] + # + attr_reader :deploy_flow + + # @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 + lookup_environment_history_config = parent_rpcs.lookup_environment_history if parent_rpcs.respond_to? :lookup_environment_history + @lookup_environment_history = ::Gapic::Config::Method.new lookup_environment_history_config + run_continuous_test_config = parent_rpcs.run_continuous_test if parent_rpcs.respond_to? :run_continuous_test + @run_continuous_test = ::Gapic::Config::Method.new run_continuous_test_config + list_continuous_test_results_config = parent_rpcs.list_continuous_test_results if parent_rpcs.respond_to? :list_continuous_test_results + @list_continuous_test_results = ::Gapic::Config::Method.new list_continuous_test_results_config + deploy_flow_config = parent_rpcs.deploy_flow if parent_rpcs.respond_to? :deploy_flow + @deploy_flow = ::Gapic::Config::Method.new deploy_flow_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/credentials.rb new file mode 100644 index 000000000000..4fdb595988b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb new file mode 100644 index 000000000000..75b382fcd731 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/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 CX + module V3 + module Environments + # 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 Environments 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 Environments 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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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. + # * `: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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/paths.rb new file mode 100644 index 000000000000..921d6c4a0187 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/paths.rb @@ -0,0 +1,180 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + module Environments + # Path helper methods for the Environments API. + module Paths + ## + # Create a fully-qualified Agent resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # + # @return [::String] + def agent_path project:, location:, agent: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}" + end + + ## + # Create a fully-qualified Environment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param environment [String] + # + # @return [::String] + def environment_path project:, location:, agent:, environment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}" + 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 TestCase resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param test_case [String] + # + # @return [::String] + def test_case_path project:, location:, agent:, test_case: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/testCases/#{test_case}" + end + + ## + # Create a fully-qualified Version resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # @param version [String] + # + # @return [::String] + def version_path project:, location:, agent:, flow:, version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/versions/#{version}" + end + + ## + # Create a fully-qualified Webhook resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param webhook [String] + # + # @return [::String] + def webhook_path project:, location:, agent:, webhook: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/webhooks/#{webhook}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest.rb new file mode 100644 index 000000000000..8b082ed916ec --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/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/cx/v3/version" +require "google/cloud/dialogflow/cx/v3/bindings_override" + +require "google/cloud/dialogflow/cx/v3/environments/credentials" +require "google/cloud/dialogflow/cx/v3/environments/paths" +require "google/cloud/dialogflow/cx/v3/environments/rest/operations" +require "google/cloud/dialogflow/cx/v3/environments/rest/client" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environments}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/cx/v3/environments/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new + # + module Environments + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/environments/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb new file mode 100644 index 000000000000..e66702a594fc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb @@ -0,0 +1,1284 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/environment_pb" +require "google/cloud/dialogflow/cx/v3/environments/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Environments + module Rest + ## + # REST client for the Environments service. + # + # Service for managing + # {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Environments::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Environments clients + # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] + 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::CX::V3::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::CX::V3::Environments::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::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 + + @operations_client = ::Google::Cloud::Dialogflow::CX::V3::Environments::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 + + @environments_stub = ::Google::Cloud::Dialogflow::CX::V3::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 long-running operations. + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Environments::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 + @environments_stub.logger + end + + # Service calls + + ## + # Returns the list of all environments in the specified + # {::Google::Cloud::Dialogflow::CX::V3::Agent Agent}. + # + # @overload list_environments(request, options = nil) + # Pass arguments to `list_environments` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListEnvironmentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Agent Agent} to list all + # environments for. Format: + # `projects//locations//agents/`. + # @param page_size [::Integer] + # The maximum number of items to return in a single page. By default 20 and + # at most 100. + # @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::CX::V3::Environment>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. + # + # @overload get_environment(request, options = nil) + # Pass arguments to `get_environment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. Format: + # `projects//locations//agents//environments/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Environment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Environment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest.new + # + # # Call the get_environment method. + # result = client.get_environment request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} in the + # specified {::Google::Cloud::Dialogflow::CX::V3::Agent Agent}. + # + # 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`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} + # + # @overload create_environment(request, options = nil) + # Pass arguments to `create_environment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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) + # 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 {::Google::Cloud::Dialogflow::CX::V3::Agent Agent} to create an + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} for. Format: + # `projects//locations//agents/`. + # @param environment [::Google::Cloud::Dialogflow::CX::V3::Environment, ::Hash] + # Required. The environment 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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest.new + # + # # Call the create_environment method. + # result = client.create_environment request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_environment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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| + 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 + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. + # + # 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`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} + # + # @overload update_environment(request, options = nil) + # Pass arguments to `update_environment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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) + # 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::CX::V3::Environment, ::Hash] + # Required. The environment 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 [::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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest.new + # + # # Call the update_environment method. + # result = client.update_environment request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_environment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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| + 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 + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. + # + # @overload delete_environment(request, options = nil) + # Pass arguments to `delete_environment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to delete. Format: + # `projects//locations//agents//environments/`. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # Looks up the history of the specified + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. + # + # @overload lookup_environment_history(request, options = nil) + # Pass arguments to `lookup_environment_history` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload lookup_environment_history(name: nil, page_size: nil, page_token: nil) + # Pass arguments to `lookup_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 name [::String] + # Required. Resource name of the environment to look up the history for. + # Format: + # `projects//locations//agents//environments/`. + # @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::CX::V3::Environment>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest.new + # + # # Call the lookup_environment_history method. + # result = client.lookup_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::CX::V3::Environment. + # p item + # end + # + def lookup_environment_history request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.lookup_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.lookup_environment_history.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.lookup_environment_history.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @environments_stub.lookup_environment_history request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @environments_stub, :lookup_environment_history, "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 + + ## + # Kicks off a continuous test under the specified + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. + # + # 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::CX::V3::RunContinuousTestMetadata RunContinuousTestMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestResponse RunContinuousTestResponse} + # + # @overload run_continuous_test(request, options = nil) + # Pass arguments to `run_continuous_test` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload run_continuous_test(environment: nil) + # Pass arguments to `run_continuous_test` via keyword arguments. Note that at + # least one keyword argument is 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 [::String] + # Required. Format: + # `projects//locations//agents//environments/`. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest.new + # + # # Call the run_continuous_test method. + # result = client.run_continuous_test request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def run_continuous_test request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.run_continuous_test.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.run_continuous_test.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.run_continuous_test.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @environments_stub.run_continuous_test 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 + + ## + # Fetches a list of continuous test results for a given environment. + # + # @overload list_continuous_test_results(request, options = nil) + # Pass arguments to `list_continuous_test_results` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_continuous_test_results(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_continuous_test_results` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The environment to list results for. + # Format: + # `projects//locations//agents//environments/`. + # @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::CX::V3::ContinuousTestResult>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest.new + # + # # Call the list_continuous_test_results method. + # result = client.list_continuous_test_results request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::ContinuousTestResult. + # p item + # end + # + def list_continuous_test_results request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest + + # Converts hash and nil to an 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_continuous_test_results.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_continuous_test_results.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_continuous_test_results.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @environments_stub.list_continuous_test_results request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @environments_stub, :list_continuous_test_results, "continuous_test_results", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deploys a flow to the specified + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. + # + # 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::CX::V3::DeployFlowMetadata DeployFlowMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::DeployFlowResponse DeployFlowResponse} + # + # @overload deploy_flow(request, options = nil) + # Pass arguments to `deploy_flow` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_flow(environment: nil, flow_version: nil) + # Pass arguments to `deploy_flow` via keyword arguments. Note that at + # least one keyword argument is 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 [::String] + # Required. The environment to deploy the flow to. + # Format: + # `projects//locations//agents//environments/`. + # @param flow_version [::String] + # Required. The flow version to deploy. + # Format: + # `projects//locations//agents//flows//versions/`. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest.new + # + # # Call the deploy_flow method. + # result = client.deploy_flow request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_flow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest + + # Converts hash and nil to an 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_flow.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_flow.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.deploy_flow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @environments_stub.deploy_flow 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 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::CX::V3::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::CX::V3::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::CX::V3::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. + # * `: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. + # * `: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 `lookup_environment_history` + # @return [::Gapic::Config::Method] + # + attr_reader :lookup_environment_history + ## + # RPC-specific configuration for `run_continuous_test` + # @return [::Gapic::Config::Method] + # + attr_reader :run_continuous_test + ## + # RPC-specific configuration for `list_continuous_test_results` + # @return [::Gapic::Config::Method] + # + attr_reader :list_continuous_test_results + ## + # RPC-specific configuration for `deploy_flow` + # @return [::Gapic::Config::Method] + # + attr_reader :deploy_flow + + # @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 + lookup_environment_history_config = parent_rpcs.lookup_environment_history if parent_rpcs.respond_to? :lookup_environment_history + @lookup_environment_history = ::Gapic::Config::Method.new lookup_environment_history_config + run_continuous_test_config = parent_rpcs.run_continuous_test if parent_rpcs.respond_to? :run_continuous_test + @run_continuous_test = ::Gapic::Config::Method.new run_continuous_test_config + list_continuous_test_results_config = parent_rpcs.list_continuous_test_results if parent_rpcs.respond_to? :list_continuous_test_results + @list_continuous_test_results = ::Gapic::Config::Method.new list_continuous_test_results_config + deploy_flow_config = parent_rpcs.deploy_flow if parent_rpcs.respond_to? :deploy_flow + @deploy_flow = ::Gapic::Config::Method.new deploy_flow_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb new file mode 100644 index 000000000000..ec944a6d50c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/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 CX + module V3 + module Environments + 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 Environments 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 Environments 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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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. + # * `: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: "/v3/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{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: "/v3/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb new file mode 100644 index 000000000000..dbd50c2ebd70 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb @@ -0,0 +1,636 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/environment_pb" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + 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::CX::V3::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::CX::V3::ListEnvironmentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::Environment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # 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::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_environment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # 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::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_environment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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 lookup_environment_history REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::LookupEnvironmentHistoryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryResponse] + # A result object deserialized from the server's reply + def lookup_environment_history request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_lookup_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: "lookup_environment_history", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the run_continuous_test REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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 run_continuous_test request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_run_continuous_test_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "run_continuous_test", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_continuous_test_results REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::ListContinuousTestResultsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsResponse] + # A result object deserialized from the server's reply + def list_continuous_test_results request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_continuous_test_results_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_continuous_test_results", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsResponse.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_flow REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_flow request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_deploy_flow_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_flow", + 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_environments REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{parent}/environments", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_environment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_environment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{parent}/environments", + body: "environment", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_environment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{environment.name}", + body: "environment", + matches: [ + ["environment.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_environment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the lookup_environment_history REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_lookup_environment_history_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}:lookupEnvironmentHistory", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the run_continuous_test REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_run_continuous_test_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{environment}:runContinuousTest", + body: "*", + matches: [ + ["environment", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_continuous_test_results REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest] + # 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_continuous_test_results_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/continuousTestResults", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the deploy_flow REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest] + # 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_flow_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{environment}:deployFlow", + body: "*", + matches: [ + ["environment", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/example_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/example_pb.rb new file mode 100644 index 000000000000..b7c38d8a8efd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/example_pb.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/example.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/cx/v3/trace_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n+google/cloud/dialogflow/cx/v3/example.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/trace.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8f\x01\n\x14\x43reateExampleRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Example\x12<\n\x07\x65xample\x18\x02 \x01(\x0b\x32&.google.cloud.dialogflow.cx.v3.ExampleB\x03\xe0\x41\x02\"O\n\x14\x44\x65leteExampleRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Example\"\x9d\x01\n\x13ListExamplesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Example\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\x1a\n\rlanguage_code\x18\x04 \x01(\tB\x03\xe0\x41\x01\"i\n\x14ListExamplesResponse\x12\x38\n\x08\x65xamples\x18\x01 \x03(\x0b\x32&.google.cloud.dialogflow.cx.v3.Example\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x11GetExampleRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Example\"\x8a\x01\n\x14UpdateExampleRequest\x12<\n\x07\x65xample\x18\x01 \x01(\x0b\x32&.google.cloud.dialogflow.cx.v3.ExampleB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\xad\x05\n\x07\x45xample\x12\x0c\n\x04name\x18\x01 \x01(\t\x12I\n\x0eplaybook_input\x18\x03 \x01(\x0b\x32,.google.cloud.dialogflow.cx.v3.PlaybookInputB\x03\xe0\x41\x01\x12K\n\x0fplaybook_output\x18\x04 \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.PlaybookOutputB\x03\xe0\x41\x01\x12;\n\x07\x61\x63tions\x18\x02 \x03(\x0b\x32%.google.cloud.dialogflow.cx.v3.ActionB\x03\xe0\x41\x02\x12\x19\n\x0c\x64isplay_name\x18\x06 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0btoken_count\x18\t \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12K\n\x12\x63onversation_state\x18\x0c \x01(\x0e\x32*.google.cloud.dialogflow.cx.v3.OutputStateB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\r \x01(\tB\x03\xe0\x41\x01:\x9a\x01\xea\x41\x96\x01\n!dialogflow.googleapis.com/Example\x12^projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}*\x08\x65xamples2\x07\x65xample2\xf3\x08\n\x08\x45xamples\x12\xd1\x01\n\rCreateExample\x12\x33.google.cloud.dialogflow.cx.v3.CreateExampleRequest\x1a&.google.cloud.dialogflow.cx.v3.Example\"c\xda\x41\x0eparent,example\x82\xd3\xe4\x93\x02L\"A/v3/{parent=projects/*/locations/*/agents/*/playbooks/*}/examples:\x07\x65xample\x12\xae\x01\n\rDeleteExample\x12\x33.google.cloud.dialogflow.cx.v3.DeleteExampleRequest\x1a\x16.google.protobuf.Empty\"P\xda\x41\x04name\x82\xd3\xe4\x93\x02\x43*A/v3/{name=projects/*/locations/*/agents/*/playbooks/*/examples/*}\x12\xcb\x01\n\x0cListExamples\x12\x32.google.cloud.dialogflow.cx.v3.ListExamplesRequest\x1a\x33.google.cloud.dialogflow.cx.v3.ListExamplesResponse\"R\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x43\x12\x41/v3/{parent=projects/*/locations/*/agents/*/playbooks/*}/examples\x12\xb8\x01\n\nGetExample\x12\x30.google.cloud.dialogflow.cx.v3.GetExampleRequest\x1a&.google.cloud.dialogflow.cx.v3.Example\"P\xda\x41\x04name\x82\xd3\xe4\x93\x02\x43\x12\x41/v3/{name=projects/*/locations/*/agents/*/playbooks/*/examples/*}\x12\xde\x01\n\rUpdateExample\x12\x33.google.cloud.dialogflow.cx.v3.UpdateExampleRequest\x1a&.google.cloud.dialogflow.cx.v3.Example\"p\xda\x41\x13\x65xample,update_mask\x82\xd3\xe4\x93\x02T2I/v3/{example.name=projects/*/locations/*/agents/*/playbooks/*/examples/*}:\x07\x65xample\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x8b\x01\n!com.google.cloud.dialogflow.cx.v3B\x0c\x45xampleProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.dialogflow.cx.v3.PlaybookInput", "google/cloud/dialogflow/cx/v3/trace.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module Cx + module V3 + CreateExampleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateExampleRequest").msgclass + DeleteExampleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteExampleRequest").msgclass + ListExamplesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListExamplesRequest").msgclass + ListExamplesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListExamplesResponse").msgclass + GetExampleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetExampleRequest").msgclass + UpdateExampleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateExampleRequest").msgclass + Example = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Example").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/example_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/example_services_pb.rb new file mode 100644 index 000000000000..2bc228d8a079 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/example_services_pb.rb @@ -0,0 +1,55 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/cx/v3/example.proto for package 'google.cloud.dialogflow.cx.v3' +# 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/cx/v3/example_pb' + +module Google + module Cloud + module Dialogflow + module Cx + module V3 + module Examples + # Service for managing [Examples][google.cloud.dialogflow.cx.v3.Example]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.cx.v3.Examples' + + # Creates an example in the specified playbook. + rpc :CreateExample, ::Google::Cloud::Dialogflow::Cx::V3::CreateExampleRequest, ::Google::Cloud::Dialogflow::Cx::V3::Example + # Deletes the specified example. + rpc :DeleteExample, ::Google::Cloud::Dialogflow::Cx::V3::DeleteExampleRequest, ::Google::Protobuf::Empty + # Returns a list of examples in the specified playbook. + rpc :ListExamples, ::Google::Cloud::Dialogflow::Cx::V3::ListExamplesRequest, ::Google::Cloud::Dialogflow::Cx::V3::ListExamplesResponse + # Retrieves the specified example. + rpc :GetExample, ::Google::Cloud::Dialogflow::Cx::V3::GetExampleRequest, ::Google::Cloud::Dialogflow::Cx::V3::Example + # Update the specified example. + rpc :UpdateExample, ::Google::Cloud::Dialogflow::Cx::V3::UpdateExampleRequest, ::Google::Cloud::Dialogflow::Cx::V3::Example + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples.rb new file mode 100644 index 000000000000..008a57257146 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples.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/cx/v3/version" + +require "google/cloud/dialogflow/cx/v3/examples/credentials" +require "google/cloud/dialogflow/cx/v3/examples/paths" +require "google/cloud/dialogflow/cx/v3/examples/client" +require "google/cloud/dialogflow/cx/v3/examples/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Example Examples}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/cx/v3/examples" + # client = ::Google::Cloud::Dialogflow::CX::V3::Examples::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/cx/v3/examples/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Examples::Rest::Client.new + # + module Examples + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "examples", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/examples/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/client.rb new file mode 100644 index 000000000000..354e55c6b4f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/client.rb @@ -0,0 +1,894 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/example_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Examples + ## + # Client for the Examples service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Example Examples}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :examples_stub + + ## + # Configure the Examples Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::Examples::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Examples clients + # ::Google::Cloud::Dialogflow::CX::V3::Examples::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", "CX", "V3"] + 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 Examples 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::CX::V3::Examples::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 + @examples_stub.universe_domain + end + + ## + # Create a new Examples client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Examples::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Examples::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Examples 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/cx/v3/example_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 + + @examples_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::Cx::V3::Examples::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 + ) + + @examples_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 = @examples_stub.endpoint + config.universe_domain = @examples_stub.universe_domain + config.logger = @examples_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 + @examples_stub.logger + end + + # Service calls + + ## + # Creates an example in the specified playbook. + # + # @overload create_example(request, options = nil) + # Pass arguments to `create_example` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateExampleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateExampleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_example(parent: nil, example: nil) + # Pass arguments to `create_example` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The playbook to create an example for. + # Format: + # `projects//locations//agents//playbooks/`. + # @param example [::Google::Cloud::Dialogflow::CX::V3::Example, ::Hash] + # Required. The example to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Example] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Example] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Examples::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateExampleRequest.new + # + # # Call the create_example method. + # result = client.create_example request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Example. + # p result + # + def create_example request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateExampleRequest + + # Converts hash and nil to 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_example.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_example.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_example.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @examples_stub.call_rpc :create_example, request, 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 example. + # + # @overload delete_example(request, options = nil) + # Pass arguments to `delete_example` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteExampleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteExampleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_example(name: nil) + # Pass arguments to `delete_example` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 example to delete. + # Format: + # `projects//locations//agents//playbooks//examples/`. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Examples::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteExampleRequest.new + # + # # Call the delete_example method. + # result = client.delete_example request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_example request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteExampleRequest + + # Converts hash and nil to 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_example.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_example.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_example.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @examples_stub.call_rpc :delete_example, request, 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 examples in the specified playbook. + # + # @overload list_examples(request, options = nil) + # Pass arguments to `list_examples` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_examples(parent: nil, page_size: nil, page_token: nil, language_code: nil) + # Pass arguments to `list_examples` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The playbook to list the examples from. + # Format: + # `projects//locations//agents//playbooks/`. + # @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][ListExampleResponse.next_page_token] value + # returned from a previous list request. + # @param language_code [::String] + # Optional. The language to list examples for. + # If not specified, list all examples under the playbook. + # 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 [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Example>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Example>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Examples::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest.new + # + # # Call the list_examples method. + # result = client.list_examples request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Example. + # p item + # end + # + def list_examples request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest + + # Converts hash and nil to 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_examples.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_examples.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_examples.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @examples_stub.call_rpc :list_examples, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @examples_stub, :list_examples, 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 example. + # + # @overload get_example(request, options = nil) + # Pass arguments to `get_example` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetExampleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetExampleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_example(name: nil) + # Pass arguments to `get_example` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 example. + # Format: + # `projects//locations//agents//playbooks//examples/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Example] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Example] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Examples::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetExampleRequest.new + # + # # Call the get_example method. + # result = client.get_example request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Example. + # p result + # + def get_example request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetExampleRequest + + # Converts hash and nil to 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_example.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_example.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_example.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @examples_stub.call_rpc :get_example, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update the specified example. + # + # @overload update_example(request, options = nil) + # Pass arguments to `update_example` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateExampleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateExampleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_example(example: nil, update_mask: nil) + # Pass arguments to `update_example` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param example [::Google::Cloud::Dialogflow::CX::V3::Example, ::Hash] + # Required. The example 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::CX::V3::Example] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Example] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Examples::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateExampleRequest.new + # + # # Call the update_example method. + # result = client.update_example request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Example. + # p result + # + def update_example request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateExampleRequest + + # Converts hash and nil to 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_example.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.example&.name + header_params["example.name"] = request.example.name + end + + request_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_example.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_example.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @examples_stub.call_rpc :update_example, request, 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 Examples API. + # + # This class represents the configuration for Examples, + # 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::CX::V3::Examples::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_example to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::Examples::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_example.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::Examples::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_example.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::CX::V3::Examples::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 Examples API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_example` + # @return [::Gapic::Config::Method] + # + attr_reader :create_example + ## + # RPC-specific configuration for `delete_example` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_example + ## + # RPC-specific configuration for `list_examples` + # @return [::Gapic::Config::Method] + # + attr_reader :list_examples + ## + # RPC-specific configuration for `get_example` + # @return [::Gapic::Config::Method] + # + attr_reader :get_example + ## + # RPC-specific configuration for `update_example` + # @return [::Gapic::Config::Method] + # + attr_reader :update_example + + # @private + def initialize parent_rpcs = nil + create_example_config = parent_rpcs.create_example if parent_rpcs.respond_to? :create_example + @create_example = ::Gapic::Config::Method.new create_example_config + delete_example_config = parent_rpcs.delete_example if parent_rpcs.respond_to? :delete_example + @delete_example = ::Gapic::Config::Method.new delete_example_config + list_examples_config = parent_rpcs.list_examples if parent_rpcs.respond_to? :list_examples + @list_examples = ::Gapic::Config::Method.new list_examples_config + get_example_config = parent_rpcs.get_example if parent_rpcs.respond_to? :get_example + @get_example = ::Gapic::Config::Method.new get_example_config + update_example_config = parent_rpcs.update_example if parent_rpcs.respond_to? :update_example + @update_example = ::Gapic::Config::Method.new update_example_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/credentials.rb new file mode 100644 index 000000000000..9a75185471dc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Examples + # Credentials for the Examples 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/paths.rb new file mode 100644 index 000000000000..7f61f0f24840 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/paths.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + module Examples + # Path helper methods for the Examples API. + module Paths + ## + # Create a fully-qualified Example resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param playbook [String] + # @param example [String] + # + # @return [::String] + def example_path project:, location:, agent:, playbook:, example: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "playbook cannot contain /" if playbook.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}/examples/#{example}" + end + + ## + # Create a fully-qualified Flow resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # + # @return [::String] + def flow_path project:, location:, agent:, flow: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}" + end + + ## + # Create a fully-qualified Playbook resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param playbook [String] + # + # @return [::String] + def playbook_path project:, location:, agent:, playbook: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}" + end + + ## + # Create a fully-qualified Tool resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param tool [String] + # + # @return [::String] + def tool_path project:, location:, agent:, tool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/tools/#{tool}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest.rb new file mode 100644 index 000000000000..c0868d850da3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/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/cx/v3/version" +require "google/cloud/dialogflow/cx/v3/bindings_override" + +require "google/cloud/dialogflow/cx/v3/examples/credentials" +require "google/cloud/dialogflow/cx/v3/examples/paths" +require "google/cloud/dialogflow/cx/v3/examples/rest/client" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Example Examples}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/cx/v3/examples/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Examples::Rest::Client.new + # + module Examples + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/examples/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest/client.rb new file mode 100644 index 000000000000..409fe40f81f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest/client.rb @@ -0,0 +1,824 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/example_pb" +require "google/cloud/dialogflow/cx/v3/examples/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Examples + module Rest + ## + # REST client for the Examples service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Example Examples}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :examples_stub + + ## + # Configure the Examples Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::Examples::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Examples clients + # ::Google::Cloud::Dialogflow::CX::V3::Examples::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", "CX", "V3"] + 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 Examples 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::CX::V3::Examples::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 + @examples_stub.universe_domain + end + + ## + # Create a new Examples REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Examples::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Examples::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Examples 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 + + @examples_stub = ::Google::Cloud::Dialogflow::CX::V3::Examples::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @examples_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 = @examples_stub.endpoint + config.universe_domain = @examples_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @examples_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 + @examples_stub.logger + end + + # Service calls + + ## + # Creates an example in the specified playbook. + # + # @overload create_example(request, options = nil) + # Pass arguments to `create_example` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateExampleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateExampleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_example(parent: nil, example: nil) + # Pass arguments to `create_example` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The playbook to create an example for. + # Format: + # `projects//locations//agents//playbooks/`. + # @param example [::Google::Cloud::Dialogflow::CX::V3::Example, ::Hash] + # Required. The example to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Example] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Example] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Examples::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateExampleRequest.new + # + # # Call the create_example method. + # result = client.create_example request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Example. + # p result + # + def create_example request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateExampleRequest + + # Converts hash and nil to an 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_example.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_example.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_example.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @examples_stub.create_example request, 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 example. + # + # @overload delete_example(request, options = nil) + # Pass arguments to `delete_example` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteExampleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteExampleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_example(name: nil) + # Pass arguments to `delete_example` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 example to delete. + # Format: + # `projects//locations//agents//playbooks//examples/`. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Examples::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteExampleRequest.new + # + # # Call the delete_example method. + # result = client.delete_example request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_example request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteExampleRequest + + # Converts hash and nil to an 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_example.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_example.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_example.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @examples_stub.delete_example request, 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 examples in the specified playbook. + # + # @overload list_examples(request, options = nil) + # Pass arguments to `list_examples` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_examples(parent: nil, page_size: nil, page_token: nil, language_code: nil) + # Pass arguments to `list_examples` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The playbook to list the examples from. + # Format: + # `projects//locations//agents//playbooks/`. + # @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][ListExampleResponse.next_page_token] value + # returned from a previous list request. + # @param language_code [::String] + # Optional. The language to list examples for. + # If not specified, list all examples under the playbook. + # 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 [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Example>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Example>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Examples::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest.new + # + # # Call the list_examples method. + # result = client.list_examples request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Example. + # p item + # end + # + def list_examples request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest + + # Converts hash and nil to an 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_examples.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_examples.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_examples.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @examples_stub.list_examples request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @examples_stub, :list_examples, "examples", 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 example. + # + # @overload get_example(request, options = nil) + # Pass arguments to `get_example` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetExampleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetExampleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_example(name: nil) + # Pass arguments to `get_example` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 example. + # Format: + # `projects//locations//agents//playbooks//examples/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Example] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Example] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Examples::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetExampleRequest.new + # + # # Call the get_example method. + # result = client.get_example request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Example. + # p result + # + def get_example request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetExampleRequest + + # Converts hash and nil to an 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_example.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_example.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_example.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @examples_stub.get_example request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update the specified example. + # + # @overload update_example(request, options = nil) + # Pass arguments to `update_example` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateExampleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateExampleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_example(example: nil, update_mask: nil) + # Pass arguments to `update_example` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param example [::Google::Cloud::Dialogflow::CX::V3::Example, ::Hash] + # Required. The example 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::CX::V3::Example] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Example] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Examples::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateExampleRequest.new + # + # # Call the update_example method. + # result = client.update_example request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Example. + # p result + # + def update_example request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateExampleRequest + + # Converts hash and nil to an 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_example.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_example.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_example.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @examples_stub.update_example request, 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 Examples REST API. + # + # This class represents the configuration for Examples 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::CX::V3::Examples::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_example to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::Examples::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_example.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::Examples::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_example.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 Examples API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_example` + # @return [::Gapic::Config::Method] + # + attr_reader :create_example + ## + # RPC-specific configuration for `delete_example` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_example + ## + # RPC-specific configuration for `list_examples` + # @return [::Gapic::Config::Method] + # + attr_reader :list_examples + ## + # RPC-specific configuration for `get_example` + # @return [::Gapic::Config::Method] + # + attr_reader :get_example + ## + # RPC-specific configuration for `update_example` + # @return [::Gapic::Config::Method] + # + attr_reader :update_example + + # @private + def initialize parent_rpcs = nil + create_example_config = parent_rpcs.create_example if parent_rpcs.respond_to? :create_example + @create_example = ::Gapic::Config::Method.new create_example_config + delete_example_config = parent_rpcs.delete_example if parent_rpcs.respond_to? :delete_example + @delete_example = ::Gapic::Config::Method.new delete_example_config + list_examples_config = parent_rpcs.list_examples if parent_rpcs.respond_to? :list_examples + @list_examples = ::Gapic::Config::Method.new list_examples_config + get_example_config = parent_rpcs.get_example if parent_rpcs.respond_to? :get_example + @get_example = ::Gapic::Config::Method.new get_example_config + update_example_config = parent_rpcs.update_example if parent_rpcs.respond_to? :update_example + @update_example = ::Gapic::Config::Method.new update_example_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest/service_stub.rb new file mode 100644 index 000000000000..a8cc1d3e2fab --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest/service_stub.rb @@ -0,0 +1,390 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/example_pb" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Examples + module Rest + ## + # REST service stub for the Examples 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_example REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateExampleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Example] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Example] + # A result object deserialized from the server's reply + def create_example request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_example_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_example", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Example.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_example REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteExampleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_example request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_example_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_example", + 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_examples REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::ListExamplesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ListExamplesResponse] + # A result object deserialized from the server's reply + def list_examples request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_examples_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_examples", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::ListExamplesResponse.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_example REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetExampleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Example] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Example] + # A result object deserialized from the server's reply + def get_example request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_example_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_example", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Example.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_example REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateExampleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Example] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Example] + # A result object deserialized from the server's reply + def update_example request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_example_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_example", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Example.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_example REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateExampleRequest] + # 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_example_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/examples", + body: "example", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/playbooks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_example REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteExampleRequest] + # 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_example_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/playbooks/[^/]+/examples/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_examples REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest] + # 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_examples_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/examples", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/playbooks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_example REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetExampleRequest] + # 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_example_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/playbooks/[^/]+/examples/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_example REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateExampleRequest] + # 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_example_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v3/{example.name}", + body: "example", + matches: [ + ["example.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/playbooks/[^/]+/examples/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiment_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiment_pb.rb new file mode 100644 index 000000000000..a220d3bd0185 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiment_pb.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/experiment.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/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n.google/cloud/dialogflow/cx/v3/experiment.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xfb\x10\n\nExperiment\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12>\n\x05state\x18\x04 \x01(\x0e\x32/.google.cloud.dialogflow.cx.v3.Experiment.State\x12H\n\ndefinition\x18\x05 \x01(\x0b\x32\x34.google.cloud.dialogflow.cx.v3.Experiment.Definition\x12\x44\n\x0erollout_config\x18\x0e \x01(\x0b\x32,.google.cloud.dialogflow.cx.v3.RolloutConfig\x12\x42\n\rrollout_state\x18\x0f \x01(\x0b\x32+.google.cloud.dialogflow.cx.v3.RolloutState\x12\x1e\n\x16rollout_failure_reason\x18\x10 \x01(\t\x12@\n\x06result\x18\x06 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.Experiment.Result\x12/\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nstart_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x10last_update_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x11\x65xperiment_length\x18\x0b \x01(\x0b\x32\x19.google.protobuf.Duration\x12H\n\x10variants_history\x18\x0c \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.VariantsHistory\x1aw\n\nDefinition\x12\x11\n\tcondition\x18\x01 \x01(\t\x12J\n\x10version_variants\x18\x02 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.VersionVariantsH\x00\x42\n\n\x08variants\x1a\x8b\x08\n\x06Result\x12X\n\x0fversion_metrics\x18\x01 \x03(\x0b\x32?.google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics\x12\x34\n\x10last_update_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1ag\n\x12\x43onfidenceInterval\x12\x18\n\x10\x63onfidence_level\x18\x01 \x01(\x01\x12\r\n\x05ratio\x18\x02 \x01(\x01\x12\x13\n\x0blower_bound\x18\x03 \x01(\x01\x12\x13\n\x0bupper_bound\x18\x04 \x01(\x01\x1a\xb0\x02\n\x06Metric\x12I\n\x04type\x18\x01 \x01(\x0e\x32;.google.cloud.dialogflow.cx.v3.Experiment.Result.MetricType\x12N\n\ncount_type\x18\x05 \x01(\x0e\x32:.google.cloud.dialogflow.cx.v3.Experiment.Result.CountType\x12\x0f\n\x05ratio\x18\x02 \x01(\x01H\x00\x12\x0f\n\x05\x63ount\x18\x04 \x01(\x01H\x00\x12`\n\x13\x63onfidence_interval\x18\x03 \x01(\x0b\x32\x43.google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceIntervalB\x07\n\x05value\x1a\xaa\x01\n\x0eVersionMetrics\x12\x37\n\x07version\x18\x01 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Version\x12H\n\x07metrics\x18\x02 \x03(\x0b\x32\x37.google.cloud.dialogflow.cx.v3.Experiment.Result.Metric\x12\x15\n\rsession_count\x18\x03 \x01(\x05\"\xb6\x01\n\nMetricType\x12\x16\n\x12METRIC_UNSPECIFIED\x10\x00\x12&\n\"CONTAINED_SESSION_NO_CALLBACK_RATE\x10\x01\x12\x1b\n\x17LIVE_AGENT_HANDOFF_RATE\x10\x02\x12\x19\n\x15\x43\x41LLBACK_SESSION_RATE\x10\x03\x12\x1a\n\x16\x41\x42\x41NDONED_SESSION_RATE\x10\x04\x12\x14\n\x10SESSION_END_RATE\x10\x05\"o\n\tCountType\x12\x1a\n\x16\x43OUNT_TYPE_UNSPECIFIED\x10\x00\x12\x18\n\x14TOTAL_NO_MATCH_COUNT\x10\x01\x12\x14\n\x10TOTAL_TURN_COUNT\x10\x02\x12\x16\n\x12\x41VERAGE_TURN_COUNT\x10\x03\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05\x44RAFT\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x08\n\x04\x44ONE\x10\x03\x12\x12\n\x0eROLLOUT_FAILED\x10\x04:\x96\x01\xea\x41\x92\x01\n$dialogflow.googleapis.com/Experiment\x12jprojects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}\"\xad\x01\n\x0fVersionVariants\x12H\n\x08variants\x18\x01 \x03(\x0b\x32\x36.google.cloud.dialogflow.cx.v3.VersionVariants.Variant\x1aP\n\x07Variant\x12\x0f\n\x07version\x18\x01 \x01(\t\x12\x1a\n\x12traffic_allocation\x18\x02 \x01(\x02\x12\x18\n\x10is_control_group\x18\x03 \x01(\x08\"\x9a\x01\n\x0fVariantsHistory\x12J\n\x10version_variants\x18\x01 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.VersionVariantsH\x00\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\n\n\x08variants\"\x85\x02\n\rRolloutConfig\x12O\n\rrollout_steps\x18\x01 \x03(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep\x12\x19\n\x11rollout_condition\x18\x02 \x01(\t\x12\x19\n\x11\x66\x61ilure_condition\x18\x03 \x01(\t\x1am\n\x0bRolloutStep\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x17\n\x0ftraffic_percent\x18\x02 \x01(\x05\x12/\n\x0cmin_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\"`\n\x0cRolloutState\x12\x0c\n\x04step\x18\x01 \x01(\t\x12\x12\n\nstep_index\x18\x03 \x01(\x05\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"}\n\x16ListExperimentsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/Experiment\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"r\n\x17ListExperimentsResponse\x12>\n\x0b\x65xperiments\x18\x01 \x03(\x0b\x32).google.cloud.dialogflow.cx.v3.Experiment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"R\n\x14GetExperimentRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/Experiment\"\x9b\x01\n\x17\x43reateExperimentRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/Experiment\x12\x42\n\nexperiment\x18\x02 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.ExperimentB\x03\xe0\x41\x02\"\x93\x01\n\x17UpdateExperimentRequest\x12\x42\n\nexperiment\x18\x01 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.ExperimentB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"U\n\x17\x44\x65leteExperimentRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/Experiment\"T\n\x16StartExperimentRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/Experiment\"S\n\x15StopExperimentRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/Experiment2\xf8\x0c\n\x0b\x45xperiments\x12\xda\x01\n\x0fListExperiments\x12\x35.google.cloud.dialogflow.cx.v3.ListExperimentsRequest\x1a\x36.google.cloud.dialogflow.cx.v3.ListExperimentsResponse\"X\xda\x41\x06parent\x82\xd3\xe4\x93\x02I\x12G/v3/{parent=projects/*/locations/*/agents/*/environments/*}/experiments\x12\xc7\x01\n\rGetExperiment\x12\x33.google.cloud.dialogflow.cx.v3.GetExperimentRequest\x1a).google.cloud.dialogflow.cx.v3.Experiment\"V\xda\x41\x04name\x82\xd3\xe4\x93\x02I\x12G/v3/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}\x12\xe6\x01\n\x10\x43reateExperiment\x12\x36.google.cloud.dialogflow.cx.v3.CreateExperimentRequest\x1a).google.cloud.dialogflow.cx.v3.Experiment\"o\xda\x41\x11parent,experiment\x82\xd3\xe4\x93\x02U\"G/v3/{parent=projects/*/locations/*/agents/*/environments/*}/experiments:\nexperiment\x12\xf6\x01\n\x10UpdateExperiment\x12\x36.google.cloud.dialogflow.cx.v3.UpdateExperimentRequest\x1a).google.cloud.dialogflow.cx.v3.Experiment\"\x7f\xda\x41\x16\x65xperiment,update_mask\x82\xd3\xe4\x93\x02`2R/v3/{experiment.name=projects/*/locations/*/agents/*/environments/*/experiments/*}:\nexperiment\x12\xba\x01\n\x10\x44\x65leteExperiment\x12\x36.google.cloud.dialogflow.cx.v3.DeleteExperimentRequest\x1a\x16.google.protobuf.Empty\"V\xda\x41\x04name\x82\xd3\xe4\x93\x02I*G/v3/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}\x12\xd4\x01\n\x0fStartExperiment\x12\x35.google.cloud.dialogflow.cx.v3.StartExperimentRequest\x1a).google.cloud.dialogflow.cx.v3.Experiment\"_\xda\x41\x04name\x82\xd3\xe4\x93\x02R\"M/v3/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}:start:\x01*\x12\xd1\x01\n\x0eStopExperiment\x12\x34.google.cloud.dialogflow.cx.v3.StopExperimentRequest\x1a).google.cloud.dialogflow.cx.v3.Experiment\"^\xda\x41\x04name\x82\xd3\xe4\x93\x02Q\"L/v3/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}:stop:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xb2\x01\n!com.google.cloud.dialogflow.cx.v3B\x0f\x45xperimentProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + Experiment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Experiment").msgclass + Experiment::Definition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Experiment.Definition").msgclass + Experiment::Result = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Experiment.Result").msgclass + Experiment::Result::ConfidenceInterval = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval").msgclass + Experiment::Result::Metric = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Experiment.Result.Metric").msgclass + Experiment::Result::VersionMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics").msgclass + Experiment::Result::MetricType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Experiment.Result.MetricType").enummodule + Experiment::Result::CountType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Experiment.Result.CountType").enummodule + Experiment::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Experiment.State").enummodule + VersionVariants = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.VersionVariants").msgclass + VersionVariants::Variant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.VersionVariants.Variant").msgclass + VariantsHistory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.VariantsHistory").msgclass + RolloutConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RolloutConfig").msgclass + RolloutConfig::RolloutStep = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep").msgclass + RolloutState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RolloutState").msgclass + ListExperimentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListExperimentsRequest").msgclass + ListExperimentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListExperimentsResponse").msgclass + GetExperimentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetExperimentRequest").msgclass + CreateExperimentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateExperimentRequest").msgclass + UpdateExperimentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateExperimentRequest").msgclass + DeleteExperimentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteExperimentRequest").msgclass + StartExperimentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.StartExperimentRequest").msgclass + StopExperimentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.StopExperimentRequest").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiment_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiment_services_pb.rb new file mode 100644 index 000000000000..afd96cb6974a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiment_services_pb.rb @@ -0,0 +1,67 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/cx/v3/experiment.proto for package 'Google.Cloud.Dialogflow.CX.V3' +# 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/cx/v3/experiment_pb' + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Experiments + # Service for managing [Experiments][google.cloud.dialogflow.cx.v3.Experiment]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.cx.v3.Experiments' + + # Returns the list of all experiments in the specified + # [Environment][google.cloud.dialogflow.cx.v3.Environment]. + rpc :ListExperiments, ::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListExperimentsResponse + # Retrieves the specified + # [Experiment][google.cloud.dialogflow.cx.v3.Experiment]. + rpc :GetExperiment, ::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest, ::Google::Cloud::Dialogflow::CX::V3::Experiment + # Creates an [Experiment][google.cloud.dialogflow.cx.v3.Experiment] in the + # specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. + rpc :CreateExperiment, ::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest, ::Google::Cloud::Dialogflow::CX::V3::Experiment + # Updates the specified + # [Experiment][google.cloud.dialogflow.cx.v3.Experiment]. + rpc :UpdateExperiment, ::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest, ::Google::Cloud::Dialogflow::CX::V3::Experiment + # Deletes the specified + # [Experiment][google.cloud.dialogflow.cx.v3.Experiment]. + rpc :DeleteExperiment, ::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest, ::Google::Protobuf::Empty + # Starts the specified + # [Experiment][google.cloud.dialogflow.cx.v3.Experiment]. This rpc only + # changes the state of experiment from PENDING to RUNNING. + rpc :StartExperiment, ::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest, ::Google::Cloud::Dialogflow::CX::V3::Experiment + # Stops the specified [Experiment][google.cloud.dialogflow.cx.v3.Experiment]. + # This rpc only changes the state of experiment from RUNNING to DONE. + rpc :StopExperiment, ::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest, ::Google::Cloud::Dialogflow::CX::V3::Experiment + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments.rb new file mode 100644 index 000000000000..fcb71b9d6eac --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments.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/cx/v3/version" + +require "google/cloud/dialogflow/cx/v3/experiments/credentials" +require "google/cloud/dialogflow/cx/v3/experiments/paths" +require "google/cloud/dialogflow/cx/v3/experiments/client" +require "google/cloud/dialogflow/cx/v3/experiments/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiments}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/cx/v3/experiments" + # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/cx/v3/experiments/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new + # + module Experiments + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "experiments", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/experiments/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb new file mode 100644 index 000000000000..e353ed0de832 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb @@ -0,0 +1,1084 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/experiment_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Experiments + ## + # Client for the Experiments service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiments}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :experiments_stub + + ## + # Configure the Experiments Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::Experiments::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Experiments clients + # ::Google::Cloud::Dialogflow::CX::V3::Experiments::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", "CX", "V3"] + 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 Experiments 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::CX::V3::Experiments::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 + @experiments_stub.universe_domain + end + + ## + # Create a new Experiments client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Experiments 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/cx/v3/experiment_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 + + @experiments_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::CX::V3::Experiments::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 + ) + + @experiments_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 = @experiments_stub.endpoint + config.universe_domain = @experiments_stub.universe_domain + config.logger = @experiments_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 + @experiments_stub.logger + end + + # Service calls + + ## + # Returns the list of all experiments in the specified + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. + # + # @overload list_experiments(request, options = nil) + # Pass arguments to `list_experiments` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_experiments(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_experiments` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to + # list all environments for. Format: + # `projects//locations//agents//environments/`. + # @param page_size [::Integer] + # The maximum number of items to return in a single page. By default 20 and + # at most 100. + # @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::CX::V3::Experiment>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Experiment>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest.new + # + # # Call the list_experiments method. + # result = client.list_experiments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Experiment. + # p item + # end + # + def list_experiments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest + + # Converts hash and nil to 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_experiments.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_experiments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_experiments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @experiments_stub.call_rpc :list_experiments, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @experiments_stub, :list_experiments, 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 + # {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}. + # + # @overload get_experiment(request, options = nil) + # Pass arguments to `get_experiment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_experiment(name: nil) + # Pass arguments to `get_experiment` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. Format: + # `projects//locations//agents//environments//experiments/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest.new + # + # # Call the get_experiment method. + # result = client.get_experiment request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + # p result + # + def get_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest + + # Converts hash and nil to 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_experiment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_experiment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @experiments_stub.call_rpc :get_experiment, request, 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 {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment} in the + # specified {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. + # + # @overload create_experiment(request, options = nil) + # Pass arguments to `create_experiment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_experiment(parent: nil, experiment: nil) + # Pass arguments to `create_experiment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The {::Google::Cloud::Dialogflow::CX::V3::Agent Agent} to create an + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} for. Format: + # `projects//locations//agents//environments/`. + # @param experiment [::Google::Cloud::Dialogflow::CX::V3::Experiment, ::Hash] + # Required. The experiment to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest.new + # + # # Call the create_experiment method. + # result = client.create_experiment request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + # p result + # + def create_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest + + # Converts hash and nil to 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_experiment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_experiment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @experiments_stub.call_rpc :create_experiment, request, 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 + # {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}. + # + # @overload update_experiment(request, options = nil) + # Pass arguments to `update_experiment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_experiment(experiment: nil, update_mask: nil) + # Pass arguments to `update_experiment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param experiment [::Google::Cloud::Dialogflow::CX::V3::Experiment, ::Hash] + # Required. The experiment 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::CX::V3::Experiment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest.new + # + # # Call the update_experiment method. + # result = client.update_experiment request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + # p result + # + def update_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest + + # Converts hash and nil to 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_experiment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.experiment&.name + header_params["experiment.name"] = request.experiment.name + end + + request_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_experiment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @experiments_stub.call_rpc :update_experiment, request, 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 + # {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}. + # + # @overload delete_experiment(request, options = nil) + # Pass arguments to `delete_experiment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_experiment(name: nil) + # Pass arguments to `delete_experiment` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to delete. Format: + # `projects//locations//agents//environments//experiments/`. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest.new + # + # # Call the delete_experiment method. + # result = client.delete_experiment request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest + + # Converts hash and nil to 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_experiment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_experiment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @experiments_stub.call_rpc :delete_experiment, request, 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 the specified + # {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}. This rpc only + # changes the state of experiment from PENDING to RUNNING. + # + # @overload start_experiment(request, options = nil) + # Pass arguments to `start_experiment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload start_experiment(name: nil) + # Pass arguments to `start_experiment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the experiment to start. + # Format: + # `projects//locations//agents//environments//experiments/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest.new + # + # # Call the start_experiment method. + # result = client.start_experiment request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + # p result + # + def start_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.start_experiment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.start_experiment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.start_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @experiments_stub.call_rpc :start_experiment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Stops the specified {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}. + # This rpc only changes the state of experiment from RUNNING to DONE. + # + # @overload stop_experiment(request, options = nil) + # Pass arguments to `stop_experiment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload stop_experiment(name: nil) + # Pass arguments to `stop_experiment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the experiment to stop. + # Format: + # `projects//locations//agents//environments//experiments/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest.new + # + # # Call the stop_experiment method. + # result = client.stop_experiment request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + # p result + # + def stop_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.stop_experiment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.stop_experiment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.stop_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @experiments_stub.call_rpc :stop_experiment, request, 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 Experiments API. + # + # This class represents the configuration for Experiments, + # 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::CX::V3::Experiments::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_experiments to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_experiments.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_experiments.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::CX::V3::Experiments::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 Experiments API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_experiments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_experiments + ## + # RPC-specific configuration for `get_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_experiment + ## + # RPC-specific configuration for `create_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_experiment + ## + # RPC-specific configuration for `update_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :update_experiment + ## + # RPC-specific configuration for `delete_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_experiment + ## + # RPC-specific configuration for `start_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :start_experiment + ## + # RPC-specific configuration for `stop_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :stop_experiment + + # @private + def initialize parent_rpcs = nil + list_experiments_config = parent_rpcs.list_experiments if parent_rpcs.respond_to? :list_experiments + @list_experiments = ::Gapic::Config::Method.new list_experiments_config + get_experiment_config = parent_rpcs.get_experiment if parent_rpcs.respond_to? :get_experiment + @get_experiment = ::Gapic::Config::Method.new get_experiment_config + create_experiment_config = parent_rpcs.create_experiment if parent_rpcs.respond_to? :create_experiment + @create_experiment = ::Gapic::Config::Method.new create_experiment_config + update_experiment_config = parent_rpcs.update_experiment if parent_rpcs.respond_to? :update_experiment + @update_experiment = ::Gapic::Config::Method.new update_experiment_config + delete_experiment_config = parent_rpcs.delete_experiment if parent_rpcs.respond_to? :delete_experiment + @delete_experiment = ::Gapic::Config::Method.new delete_experiment_config + start_experiment_config = parent_rpcs.start_experiment if parent_rpcs.respond_to? :start_experiment + @start_experiment = ::Gapic::Config::Method.new start_experiment_config + stop_experiment_config = parent_rpcs.stop_experiment if parent_rpcs.respond_to? :stop_experiment + @stop_experiment = ::Gapic::Config::Method.new stop_experiment_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/credentials.rb new file mode 100644 index 000000000000..bb206cf0f8e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Experiments + # Credentials for the Experiments 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/paths.rb new file mode 100644 index 000000000000..6f27b01cbe2a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/paths.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + module Experiments + # Path helper methods for the Experiments API. + module Paths + ## + # Create a fully-qualified Environment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param environment [String] + # + # @return [::String] + def environment_path project:, location:, agent:, environment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}" + end + + ## + # Create a fully-qualified Experiment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param environment [String] + # @param experiment [String] + # + # @return [::String] + def experiment_path project:, location:, agent:, environment:, experiment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}/experiments/#{experiment}" + end + + ## + # Create a fully-qualified Version resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # @param version [String] + # + # @return [::String] + def version_path project:, location:, agent:, flow:, version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/versions/#{version}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest.rb new file mode 100644 index 000000000000..ac87d5b8b271 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/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/cx/v3/version" +require "google/cloud/dialogflow/cx/v3/bindings_override" + +require "google/cloud/dialogflow/cx/v3/experiments/credentials" +require "google/cloud/dialogflow/cx/v3/experiments/paths" +require "google/cloud/dialogflow/cx/v3/experiments/rest/client" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiments}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/cx/v3/experiments/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new + # + module Experiments + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/experiments/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb new file mode 100644 index 000000000000..375da07d267e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb @@ -0,0 +1,1000 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/dialogflow/cx/v3/experiment_pb" +require "google/cloud/dialogflow/cx/v3/experiments/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Experiments + module Rest + ## + # REST client for the Experiments service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiments}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :experiments_stub + + ## + # Configure the Experiments Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Experiments clients + # ::Google::Cloud::Dialogflow::CX::V3::Experiments::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", "CX", "V3"] + 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 Experiments 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::CX::V3::Experiments::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 + @experiments_stub.universe_domain + end + + ## + # Create a new Experiments REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Experiments 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 + + @experiments_stub = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @experiments_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 = @experiments_stub.endpoint + config.universe_domain = @experiments_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @experiments_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 + @experiments_stub.logger + end + + # Service calls + + ## + # Returns the list of all experiments in the specified + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. + # + # @overload list_experiments(request, options = nil) + # Pass arguments to `list_experiments` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_experiments(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_experiments` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to + # list all environments for. Format: + # `projects//locations//agents//environments/`. + # @param page_size [::Integer] + # The maximum number of items to return in a single page. By default 20 and + # at most 100. + # @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::CX::V3::Experiment>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Experiment>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest.new + # + # # Call the list_experiments method. + # result = client.list_experiments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Experiment. + # p item + # end + # + def list_experiments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest + + # Converts hash and nil to an 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_experiments.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_experiments.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_experiments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @experiments_stub.list_experiments request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @experiments_stub, :list_experiments, "experiments", 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 + # {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}. + # + # @overload get_experiment(request, options = nil) + # Pass arguments to `get_experiment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_experiment(name: nil) + # Pass arguments to `get_experiment` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. Format: + # `projects//locations//agents//environments//experiments/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest.new + # + # # Call the get_experiment method. + # result = client.get_experiment request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + # p result + # + def get_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest + + # Converts hash and nil to an 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_experiment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_experiment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @experiments_stub.get_experiment request, 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 {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment} in the + # specified {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. + # + # @overload create_experiment(request, options = nil) + # Pass arguments to `create_experiment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_experiment(parent: nil, experiment: nil) + # Pass arguments to `create_experiment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The {::Google::Cloud::Dialogflow::CX::V3::Agent Agent} to create an + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} for. Format: + # `projects//locations//agents//environments/`. + # @param experiment [::Google::Cloud::Dialogflow::CX::V3::Experiment, ::Hash] + # Required. The experiment to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest.new + # + # # Call the create_experiment method. + # result = client.create_experiment request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + # p result + # + def create_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest + + # Converts hash and nil to an 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_experiment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_experiment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @experiments_stub.create_experiment request, 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 + # {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}. + # + # @overload update_experiment(request, options = nil) + # Pass arguments to `update_experiment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_experiment(experiment: nil, update_mask: nil) + # Pass arguments to `update_experiment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param experiment [::Google::Cloud::Dialogflow::CX::V3::Experiment, ::Hash] + # Required. The experiment 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::CX::V3::Experiment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest.new + # + # # Call the update_experiment method. + # result = client.update_experiment request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + # p result + # + def update_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest + + # Converts hash and nil to an 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_experiment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_experiment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @experiments_stub.update_experiment request, 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 + # {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}. + # + # @overload delete_experiment(request, options = nil) + # Pass arguments to `delete_experiment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_experiment(name: nil) + # Pass arguments to `delete_experiment` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to delete. Format: + # `projects//locations//agents//environments//experiments/`. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest.new + # + # # Call the delete_experiment method. + # result = client.delete_experiment request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest + + # Converts hash and nil to an 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_experiment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_experiment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @experiments_stub.delete_experiment request, 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 the specified + # {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}. This rpc only + # changes the state of experiment from PENDING to RUNNING. + # + # @overload start_experiment(request, options = nil) + # Pass arguments to `start_experiment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload start_experiment(name: nil) + # Pass arguments to `start_experiment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the experiment to start. + # Format: + # `projects//locations//agents//environments//experiments/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest.new + # + # # Call the start_experiment method. + # result = client.start_experiment request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + # p result + # + def start_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.start_experiment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.start_experiment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.start_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @experiments_stub.start_experiment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Stops the specified {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}. + # This rpc only changes the state of experiment from RUNNING to DONE. + # + # @overload stop_experiment(request, options = nil) + # Pass arguments to `stop_experiment` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload stop_experiment(name: nil) + # Pass arguments to `stop_experiment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the experiment to stop. + # Format: + # `projects//locations//agents//environments//experiments/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest.new + # + # # Call the stop_experiment method. + # result = client.stop_experiment request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + # p result + # + def stop_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.stop_experiment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.stop_experiment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.stop_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @experiments_stub.stop_experiment request, 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 Experiments REST API. + # + # This class represents the configuration for Experiments 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::CX::V3::Experiments::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_experiments to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_experiments.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_experiments.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 Experiments API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_experiments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_experiments + ## + # RPC-specific configuration for `get_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_experiment + ## + # RPC-specific configuration for `create_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_experiment + ## + # RPC-specific configuration for `update_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :update_experiment + ## + # RPC-specific configuration for `delete_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_experiment + ## + # RPC-specific configuration for `start_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :start_experiment + ## + # RPC-specific configuration for `stop_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :stop_experiment + + # @private + def initialize parent_rpcs = nil + list_experiments_config = parent_rpcs.list_experiments if parent_rpcs.respond_to? :list_experiments + @list_experiments = ::Gapic::Config::Method.new list_experiments_config + get_experiment_config = parent_rpcs.get_experiment if parent_rpcs.respond_to? :get_experiment + @get_experiment = ::Gapic::Config::Method.new get_experiment_config + create_experiment_config = parent_rpcs.create_experiment if parent_rpcs.respond_to? :create_experiment + @create_experiment = ::Gapic::Config::Method.new create_experiment_config + update_experiment_config = parent_rpcs.update_experiment if parent_rpcs.respond_to? :update_experiment + @update_experiment = ::Gapic::Config::Method.new update_experiment_config + delete_experiment_config = parent_rpcs.delete_experiment if parent_rpcs.respond_to? :delete_experiment + @delete_experiment = ::Gapic::Config::Method.new delete_experiment_config + start_experiment_config = parent_rpcs.start_experiment if parent_rpcs.respond_to? :start_experiment + @start_experiment = ::Gapic::Config::Method.new start_experiment_config + stop_experiment_config = parent_rpcs.stop_experiment if parent_rpcs.respond_to? :stop_experiment + @stop_experiment = ::Gapic::Config::Method.new stop_experiment_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb new file mode 100644 index 000000000000..d804a036cc3a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb @@ -0,0 +1,514 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/experiment_pb" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Experiments + module Rest + ## + # REST service stub for the Experiments 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_experiments REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::ListExperimentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ListExperimentsResponse] + # A result object deserialized from the server's reply + def list_experiments request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_experiments_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_experiments", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::ListExperimentsResponse.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_experiment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Experiment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # A result object deserialized from the server's reply + def get_experiment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_experiment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_experiment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Experiment.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_experiment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Experiment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # A result object deserialized from the server's reply + def create_experiment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_experiment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_experiment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Experiment.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_experiment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Experiment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # A result object deserialized from the server's reply + def update_experiment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_experiment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_experiment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Experiment.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_experiment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_experiment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_experiment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_experiment", + 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 start_experiment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Experiment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # A result object deserialized from the server's reply + def start_experiment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_start_experiment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "start_experiment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Experiment.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the stop_experiment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Experiment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # A result object deserialized from the server's reply + def stop_experiment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_stop_experiment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "stop_experiment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Experiment.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_experiments REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest] + # 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_experiments_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/experiments", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_experiment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest] + # 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_experiment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_experiment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest] + # 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_experiment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/experiments", + body: "experiment", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_experiment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest] + # 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_experiment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v3/{experiment.name}", + body: "experiment", + matches: [ + ["experiment.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_experiment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest] + # 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_experiment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the start_experiment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_start_experiment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:start", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the stop_experiment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_stop_experiment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:stop", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb new file mode 100644 index 000000000000..60fc2400f4c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/flow.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/cx/v3/advanced_settings_pb' +require 'google/cloud/dialogflow/cx/v3/import_strategy_pb' +require 'google/cloud/dialogflow/cx/v3/page_pb' +require 'google/cloud/dialogflow/cx/v3/parameter_definition_pb' +require 'google/cloud/dialogflow/cx/v3/validation_message_pb' +require 'google/longrunning/operations_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/cx/v3/flow.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/advanced_settings.proto\x1a\x33google/cloud/dialogflow/cx/v3/import_strategy.proto\x1a(google/cloud/dialogflow/cx/v3/page.proto\x1a\x38google/cloud/dialogflow/cx/v3/parameter_definition.proto\x1a\x36google/cloud/dialogflow/cx/v3/validation_message.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xac\x03\n\x0bNluSettings\x12H\n\nmodel_type\x18\x01 \x01(\x0e\x32\x34.google.cloud.dialogflow.cx.v3.NluSettings.ModelType\x12 \n\x18\x63lassification_threshold\x18\x03 \x01(\x02\x12Y\n\x13model_training_mode\x18\x04 \x01(\x0e\x32<.google.cloud.dialogflow.cx.v3.NluSettings.ModelTrainingMode\"Y\n\tModelType\x12\x1a\n\x16MODEL_TYPE_UNSPECIFIED\x10\x00\x12\x17\n\x13MODEL_TYPE_STANDARD\x10\x01\x12\x17\n\x13MODEL_TYPE_ADVANCED\x10\x03\"{\n\x11ModelTrainingMode\x12#\n\x1fMODEL_TRAINING_MODE_UNSPECIFIED\x10\x00\x12!\n\x1dMODEL_TRAINING_MODE_AUTOMATIC\x10\x01\x12\x1e\n\x1aMODEL_TRAINING_MODE_MANUAL\x10\x02\"\xad\x08\n\x04\x46low\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12I\n\x11transition_routes\x18\x04 \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.TransitionRoute\x12\x43\n\x0e\x65vent_handlers\x18\n \x03(\x0b\x32+.google.cloud.dialogflow.cx.v3.EventHandler\x12T\n\x17transition_route_groups\x18\x0f \x03(\tB3\xfa\x41\x30\n.dialogflow.googleapis.com/TransitionRouteGroup\x12@\n\x0cnlu_settings\x18\x0b \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.NluSettings\x12J\n\x11\x61\x64vanced_settings\x18\x0e \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x12\x64\n\x1cknowledge_connector_settings\x18\x12 \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettingsB\x03\xe0\x41\x01\x12\\\n\x1binput_parameter_definitions\x18\x1a \x03(\x0b\x32\x32.google.cloud.dialogflow.cx.v3.ParameterDefinitionB\x03\xe0\x41\x01\x12]\n\x1coutput_parameter_definitions\x18\x1b \x03(\x0b\x32\x32.google.cloud.dialogflow.cx.v3.ParameterDefinitionB\x03\xe0\x41\x01\x12_\n\x17multi_language_settings\x18\x1c \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettingsB\x03\xe0\x41\x01\x12\x0e\n\x06locked\x18\x1e \x01(\x08\x1au\n\x15MultiLanguageSettings\x12,\n\x1f\x65nable_multi_language_detection\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12.\n!supported_response_language_codes\x18\x02 \x03(\tB\x03\xe0\x41\x01:h\xea\x41\x65\n\x1e\x64ialogflow.googleapis.com/Flow\x12\x43projects/{project}/locations/{location}/agents/{agent}/flows/{flow}\"\x9a\x01\n\x11\x43reateFlowRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Flow\x12\x36\n\x04\x66low\x18\x02 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.FlowB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"X\n\x11\x44\x65leteFlowRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\"\x88\x01\n\x10ListFlowsRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Flow\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x15\n\rlanguage_code\x18\x04 \x01(\t\"`\n\x11ListFlowsResponse\x12\x32\n\x05\x66lows\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.cx.v3.Flow\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"]\n\x0eGetFlowRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\x93\x01\n\x11UpdateFlowRequest\x12\x36\n\x04\x66low\x18\x01 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.FlowB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"H\n\x10TrainFlowRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\"b\n\x13ValidateFlowRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"}\n\x1eGetFlowValidationResultRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.dialogflow.googleapis.com/FlowValidationResult\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\xb1\x02\n\x14\x46lowValidationResult\x12\x0c\n\x04name\x18\x01 \x01(\t\x12M\n\x13validation_messages\x18\x02 \x03(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.ValidationMessage\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp:\x8a\x01\xea\x41\x86\x01\n.dialogflow.googleapis.com/FlowValidationResult\x12Tprojects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult\"\xf2\x02\n\x11ImportFlowRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Flow\x12\x12\n\x08\x66low_uri\x18\x02 \x01(\tH\x00\x12\x16\n\x0c\x66low_content\x18\x03 \x01(\x0cH\x00\x12T\n\rimport_option\x18\x04 \x01(\x0e\x32=.google.cloud.dialogflow.cx.v3.ImportFlowRequest.ImportOption\x12T\n\x14\x66low_import_strategy\x18\x05 \x01(\x0b\x32\x31.google.cloud.dialogflow.cx.v3.FlowImportStrategyB\x03\xe0\x41\x01\"E\n\x0cImportOption\x12\x1d\n\x19IMPORT_OPTION_UNSPECIFIED\x10\x00\x12\x08\n\x04KEEP\x10\x01\x12\x0c\n\x08\x46\x41LLBACK\x10\x02\x42\x06\n\x04\x66low\"h\n\x12\x46lowImportStrategy\x12R\n\x16global_import_strategy\x18\x01 \x01(\x0e\x32-.google.cloud.dialogflow.cx.v3.ImportStrategyB\x03\xe0\x41\x01\"G\n\x12ImportFlowResponse\x12\x31\n\x04\x66low\x18\x01 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\"\x87\x01\n\x11\x45xportFlowRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12\x15\n\x08\x66low_uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18include_referenced_flows\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"H\n\x12\x45xportFlowResponse\x12\x12\n\x08\x66low_uri\x18\x01 \x01(\tH\x00\x12\x16\n\x0c\x66low_content\x18\x02 \x01(\x0cH\x00\x42\x06\n\x04\x66low2\x98\x10\n\x05\x46lows\x12\xb3\x01\n\nCreateFlow\x12\x30.google.cloud.dialogflow.cx.v3.CreateFlowRequest\x1a#.google.cloud.dialogflow.cx.v3.Flow\"N\xda\x41\x0bparent,flow\x82\xd3\xe4\x93\x02:\"2/v3/{parent=projects/*/locations/*/agents/*}/flows:\x04\x66low\x12\x99\x01\n\nDeleteFlow\x12\x30.google.cloud.dialogflow.cx.v3.DeleteFlowRequest\x1a\x16.google.protobuf.Empty\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34*2/v3/{name=projects/*/locations/*/agents/*/flows/*}\x12\xb3\x01\n\tListFlows\x12/.google.cloud.dialogflow.cx.v3.ListFlowsRequest\x1a\x30.google.cloud.dialogflow.cx.v3.ListFlowsResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v3/{parent=projects/*/locations/*/agents/*}/flows\x12\xa0\x01\n\x07GetFlow\x12-.google.cloud.dialogflow.cx.v3.GetFlowRequest\x1a#.google.cloud.dialogflow.cx.v3.Flow\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v3/{name=projects/*/locations/*/agents/*/flows/*}\x12\xbd\x01\n\nUpdateFlow\x12\x30.google.cloud.dialogflow.cx.v3.UpdateFlowRequest\x1a#.google.cloud.dialogflow.cx.v3.Flow\"X\xda\x41\x10\x66low,update_mask\x82\xd3\xe4\x93\x02?27/v3/{flow.name=projects/*/locations/*/agents/*/flows/*}:\x04\x66low\x12\xd9\x01\n\tTrainFlow\x12/.google.cloud.dialogflow.cx.v3.TrainFlowRequest\x1a\x1d.google.longrunning.Operation\"|\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xda\x41\x04name\x82\xd3\xe4\x93\x02=\"8/v3/{name=projects/*/locations/*/agents/*/flows/*}:train:\x01*\x12\xbf\x01\n\x0cValidateFlow\x12\x32.google.cloud.dialogflow.cx.v3.ValidateFlowRequest\x1a\x33.google.cloud.dialogflow.cx.v3.FlowValidationResult\"F\x82\xd3\xe4\x93\x02@\";/v3/{name=projects/*/locations/*/agents/*/flows/*}:validate:\x01*\x12\xe1\x01\n\x17GetFlowValidationResult\x12=.google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest\x1a\x33.google.cloud.dialogflow.cx.v3.FlowValidationResult\"R\xda\x41\x04name\x82\xd3\xe4\x93\x02\x45\x12\x43/v3/{name=projects/*/locations/*/agents/*/flows/*/validationResult}\x12\xd2\x01\n\nImportFlow\x12\x30.google.cloud.dialogflow.cx.v3.ImportFlowRequest\x1a\x1d.google.longrunning.Operation\"s\xca\x41,\n\x12ImportFlowResponse\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02>\"9/v3/{parent=projects/*/locations/*/agents/*}/flows:import:\x01*\x12\xd2\x01\n\nExportFlow\x12\x30.google.cloud.dialogflow.cx.v3.ExportFlowRequest\x1a\x1d.google.longrunning.Operation\"s\xca\x41,\n\x12\x45xportFlowResponse\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02>\"9/v3/{name=projects/*/locations/*/agents/*/flows/*}:export:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xac\x01\n!com.google.cloud.dialogflow.cx.v3B\tFlowProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.dialogflow.cx.v3.TransitionRoute", "google/cloud/dialogflow/cx/v3/page.proto"], + ["google.cloud.dialogflow.cx.v3.AdvancedSettings", "google/cloud/dialogflow/cx/v3/advanced_settings.proto"], + ["google.cloud.dialogflow.cx.v3.ParameterDefinition", "google/cloud/dialogflow/cx/v3/parameter_definition.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.dialogflow.cx.v3.ValidationMessage", "google/cloud/dialogflow/cx/v3/validation_message.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + NluSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.NluSettings").msgclass + NluSettings::ModelType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.NluSettings.ModelType").enummodule + NluSettings::ModelTrainingMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.NluSettings.ModelTrainingMode").enummodule + Flow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Flow").msgclass + Flow::MultiLanguageSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings").msgclass + CreateFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateFlowRequest").msgclass + DeleteFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteFlowRequest").msgclass + ListFlowsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListFlowsRequest").msgclass + ListFlowsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListFlowsResponse").msgclass + GetFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetFlowRequest").msgclass + UpdateFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateFlowRequest").msgclass + TrainFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TrainFlowRequest").msgclass + ValidateFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ValidateFlowRequest").msgclass + GetFlowValidationResultRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest").msgclass + FlowValidationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.FlowValidationResult").msgclass + ImportFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportFlowRequest").msgclass + ImportFlowRequest::ImportOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportFlowRequest.ImportOption").enummodule + FlowImportStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.FlowImportStrategy").msgclass + ImportFlowResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportFlowResponse").msgclass + ExportFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportFlowRequest").msgclass + ExportFlowResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportFlowResponse").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flow_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flow_services_pb.rb new file mode 100644 index 000000000000..3bd1fa467b74 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flow_services_pb.rb @@ -0,0 +1,115 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/cx/v3/flow.proto for package 'Google.Cloud.Dialogflow.CX.V3' +# 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/cx/v3/flow_pb' + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Flows + # Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.cx.v3.Flows' + + # Creates a flow in the specified agent. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc :CreateFlow, ::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest, ::Google::Cloud::Dialogflow::CX::V3::Flow + # Deletes a specified flow. + rpc :DeleteFlow, ::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest, ::Google::Protobuf::Empty + # Returns the list of all flows in the specified agent. + rpc :ListFlows, ::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListFlowsResponse + # Retrieves the specified flow. + rpc :GetFlow, ::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest, ::Google::Cloud::Dialogflow::CX::V3::Flow + # Updates the specified flow. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc :UpdateFlow, ::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest, ::Google::Cloud::Dialogflow::CX::V3::Flow + # Trains the specified flow. Note that only the flow in 'draft' environment + # is trained. + # + # 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`: 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 a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc :TrainFlow, ::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest, ::Google::Longrunning::Operation + # Validates the specified flow and creates or updates validation results. + # Please call this API after the training is completed to get the complete + # validation results. + rpc :ValidateFlow, ::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest, ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult + # Gets the latest flow validation result. Flow validation is performed + # when ValidateFlow is called. + rpc :GetFlowValidationResult, ::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest, ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult + # Imports the specified flow to the specified agent from a binary file. + # + # 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`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: + # [ImportFlowResponse][google.cloud.dialogflow.cx.v3.ImportFlowResponse] + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc :ImportFlow, ::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest, ::Google::Longrunning::Operation + # Exports the specified flow to a binary file. + # + # 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`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: + # [ExportFlowResponse][google.cloud.dialogflow.cx.v3.ExportFlowResponse] + # + # Note that resources (e.g. intents, entities, webhooks) that the flow + # references will also be exported. + rpc :ExportFlow, ::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows.rb new file mode 100644 index 000000000000..774ff03bdb27 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows.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/cx/v3/version" + +require "google/cloud/dialogflow/cx/v3/flows/credentials" +require "google/cloud/dialogflow/cx/v3/flows/paths" +require "google/cloud/dialogflow/cx/v3/flows/operations" +require "google/cloud/dialogflow/cx/v3/flows/client" +require "google/cloud/dialogflow/cx/v3/flows/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Flow Flows}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/cx/v3/flows" + # client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/cx/v3/flows/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + module Flows + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "flows", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/flows/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/client.rb new file mode 100644 index 000000000000..ed5fc86f80f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/client.rb @@ -0,0 +1,1550 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/flow_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Flows + ## + # Client for the Flows service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Flow Flows}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :flows_stub + + ## + # Configure the Flows Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::Flows::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Flows clients + # ::Google::Cloud::Dialogflow::CX::V3::Flows::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", "CX", "V3"] + 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 Flows 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::CX::V3::Flows::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 + @flows_stub.universe_domain + end + + ## + # Create a new Flows client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Flows 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/cx/v3/flow_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 + + @flows_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::CX::V3::Flows::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 + ) + + @flows_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 = @flows_stub.endpoint + config.universe_domain = @flows_stub.universe_domain + config.logger = @flows_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Flows::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 + @flows_stub.logger + end + + # Service calls + + ## + # Creates a flow in the specified agent. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload create_flow(request, options = nil) + # Pass arguments to `create_flow` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_flow(parent: nil, flow: nil, language_code: nil) + # Pass arguments to `create_flow` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 flow for. + # Format: `projects//locations//agents/`. + # @param flow [::Google::Cloud::Dialogflow::CX::V3::Flow, ::Hash] + # Required. The flow to create. + # @param language_code [::String] + # The language of the following fields in `flow`: + # + # * `Flow.event_handlers.trigger_fulfillment.messages` + # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + # * `Flow.transition_routes.trigger_fulfillment.messages` + # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Flow] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest.new + # + # # Call the create_flow method. + # result = client.create_flow request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. + # p result + # + def create_flow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest + + # Converts hash and nil to 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_flow.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_flow.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_flow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @flows_stub.call_rpc :create_flow, request, 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 flow. + # + # @overload delete_flow(request, options = nil) + # Pass arguments to `delete_flow` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_flow(name: nil, force: nil) + # Pass arguments to `delete_flow` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 flow to delete. + # Format: + # `projects//locations//agents//flows/`. + # @param force [::Boolean] + # This field has no effect for flows with no incoming transitions. + # For flows with incoming transitions: + # + # * If `force` is set to false, an error will be returned with message + # indicating the incoming transitions. + # * If `force` is set to true, Dialogflow will remove the flow, as well as + # any transitions to the flow (i.e. [Target + # flow][EventHandler.target_flow] in event handlers or [Target + # flow][TransitionRoute.target_flow] in transition routes that point to + # this flow will be cleared). + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest.new + # + # # Call the delete_flow method. + # result = client.delete_flow request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_flow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest + + # Converts hash and nil to 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_flow.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_flow.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_flow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @flows_stub.call_rpc :delete_flow, request, 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 flows in the specified agent. + # + # @overload list_flows(request, options = nil) + # Pass arguments to `list_flows` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_flows(parent: nil, page_size: nil, page_token: nil, language_code: nil) + # Pass arguments to `list_flows` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 containing the flows. + # Format: `projects//locations//agents/`. + # @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. + # @param language_code [::String] + # The language to list flows for. The following fields are language + # dependent: + # + # * `Flow.event_handlers.trigger_fulfillment.messages` + # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + # * `Flow.transition_routes.trigger_fulfillment.messages` + # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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 [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Flow>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Flow>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest.new + # + # # Call the list_flows method. + # result = client.list_flows request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Flow. + # p item + # end + # + def list_flows request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest + + # Converts hash and nil to 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_flows.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_flows.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_flows.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @flows_stub.call_rpc :list_flows, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @flows_stub, :list_flows, 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 flow. + # + # @overload get_flow(request, options = nil) + # Pass arguments to `get_flow` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_flow(name: nil, language_code: nil) + # Pass arguments to `get_flow` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 flow to get. + # Format: + # `projects//locations//agents//flows/`. + # @param language_code [::String] + # The language to retrieve the flow for. The following fields are language + # dependent: + # + # * `Flow.event_handlers.trigger_fulfillment.messages` + # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + # * `Flow.transition_routes.trigger_fulfillment.messages` + # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Flow] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetFlowRequest.new + # + # # Call the get_flow method. + # result = client.get_flow request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. + # p result + # + def get_flow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest + + # Converts hash and nil to 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_flow.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_flow.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_flow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @flows_stub.call_rpc :get_flow, request, 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 flow. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload update_flow(request, options = nil) + # Pass arguments to `update_flow` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_flow(flow: nil, update_mask: nil, language_code: nil) + # Pass arguments to `update_flow` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param flow [::Google::Cloud::Dialogflow::CX::V3::Flow, ::Hash] + # Required. The flow to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The mask to control which fields get updated. If the mask is not present, + # all fields will be updated. + # @param language_code [::String] + # The language of the following fields in `flow`: + # + # * `Flow.event_handlers.trigger_fulfillment.messages` + # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + # * `Flow.transition_routes.trigger_fulfillment.messages` + # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Flow] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest.new + # + # # Call the update_flow method. + # result = client.update_flow request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. + # p result + # + def update_flow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest + + # Converts hash and nil to 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_flow.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.flow&.name + header_params["flow.name"] = request.flow.name + end + + request_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_flow.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_flow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @flows_stub.call_rpc :update_flow, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Trains the specified flow. Note that only the flow in 'draft' environment + # is trained. + # + # 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`: 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 a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload train_flow(request, options = nil) + # Pass arguments to `train_flow` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_flow(name: nil) + # Pass arguments to `train_flow` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 flow to train. + # Format: + # `projects//locations//agents//flows/`. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest.new + # + # # Call the train_flow method. + # result = client.train_flow request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_flow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest + + # Converts hash and nil to 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_flow.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_flow.timeout, + metadata: metadata, + retry_policy: @config.rpcs.train_flow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @flows_stub.call_rpc :train_flow, 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 + + ## + # Validates the specified flow and creates or updates validation results. + # Please call this API after the training is completed to get the complete + # validation results. + # + # @overload validate_flow(request, options = nil) + # Pass arguments to `validate_flow` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload validate_flow(name: nil, language_code: nil) + # Pass arguments to `validate_flow` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 flow to validate. + # Format: + # `projects//locations//agents//flows/`. + # @param language_code [::String] + # If not specified, the agent's default language is used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest.new + # + # # Call the validate_flow method. + # result = client.validate_flow request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FlowValidationResult. + # p result + # + def validate_flow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.validate_flow.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.validate_flow.timeout, + metadata: metadata, + retry_policy: @config.rpcs.validate_flow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @flows_stub.call_rpc :validate_flow, request, 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 latest flow validation result. Flow validation is performed + # when ValidateFlow is called. + # + # @overload get_flow_validation_result(request, options = nil) + # Pass arguments to `get_flow_validation_result` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_flow_validation_result(name: nil, language_code: nil) + # Pass arguments to `get_flow_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 name [::String] + # Required. The flow name. + # Format: + # `projects//locations//agents//flows//validationResult`. + # @param language_code [::String] + # If not specified, the agent's default language is used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest.new + # + # # Call the get_flow_validation_result method. + # result = client.get_flow_validation_result request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FlowValidationResult. + # p result + # + def get_flow_validation_result request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest + + # Converts hash and nil to 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_flow_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_flow_validation_result.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_flow_validation_result.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @flows_stub.call_rpc :get_flow_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 + + ## + # Imports the specified flow to the specified agent from a binary file. + # + # 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`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::ImportFlowResponse ImportFlowResponse} + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload import_flow(request, options = nil) + # Pass arguments to `import_flow` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_flow(parent: nil, flow_uri: nil, flow_content: nil, import_option: nil, flow_import_strategy: nil) + # Pass arguments to `import_flow` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 import the flow into. + # Format: `projects//locations//agents/`. + # @param flow_uri [::String] + # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + # to import flow from. The format of this URI must be + # `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: `flow_uri`, `flow_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 flow_content [::String] + # Uncompressed raw byte content for flow. + # + # Note: The following parameters are mutually exclusive: `flow_content`, `flow_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 import_option [::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest::ImportOption] + # Flow import mode. If not specified, `KEEP` is assumed. + # @param flow_import_strategy [::Google::Cloud::Dialogflow::CX::V3::FlowImportStrategy, ::Hash] + # Optional. Specifies the import strategy used when resolving resource + # conflicts. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest.new + # + # # Call the import_flow method. + # result = client.import_flow request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_flow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest + + # Converts hash and nil to 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_flow.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_flow.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_flow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @flows_stub.call_rpc :import_flow, 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 flow to a binary file. + # + # 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`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::ExportFlowResponse ExportFlowResponse} + # + # Note that resources (e.g. intents, entities, webhooks) that the flow + # references will also be exported. + # + # @overload export_flow(request, options = nil) + # Pass arguments to `export_flow` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_flow(name: nil, flow_uri: nil, include_referenced_flows: nil) + # Pass arguments to `export_flow` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 flow to export. + # Format: + # `projects//locations//agents//flows/`. + # @param flow_uri [::String] + # Optional. The [Google Cloud + # Storage](https://cloud.google.com/storage/docs/) URI to export the flow to. + # The format of this URI must be `gs:///`. If left + # unspecified, the serialized flow 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). + # @param include_referenced_flows [::Boolean] + # Optional. Whether to export flows referenced by the specified flow. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest.new + # + # # Call the export_flow method. + # result = client.export_flow request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_flow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest + + # Converts hash and nil to 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_flow.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_flow.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_flow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @flows_stub.call_rpc :export_flow, 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 Flows API. + # + # This class represents the configuration for Flows, + # 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::CX::V3::Flows::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_flow to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_flow.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_flow.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::CX::V3::Flows::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 Flows API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_flow` + # @return [::Gapic::Config::Method] + # + attr_reader :create_flow + ## + # RPC-specific configuration for `delete_flow` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_flow + ## + # RPC-specific configuration for `list_flows` + # @return [::Gapic::Config::Method] + # + attr_reader :list_flows + ## + # RPC-specific configuration for `get_flow` + # @return [::Gapic::Config::Method] + # + attr_reader :get_flow + ## + # RPC-specific configuration for `update_flow` + # @return [::Gapic::Config::Method] + # + attr_reader :update_flow + ## + # RPC-specific configuration for `train_flow` + # @return [::Gapic::Config::Method] + # + attr_reader :train_flow + ## + # RPC-specific configuration for `validate_flow` + # @return [::Gapic::Config::Method] + # + attr_reader :validate_flow + ## + # RPC-specific configuration for `get_flow_validation_result` + # @return [::Gapic::Config::Method] + # + attr_reader :get_flow_validation_result + ## + # RPC-specific configuration for `import_flow` + # @return [::Gapic::Config::Method] + # + attr_reader :import_flow + ## + # RPC-specific configuration for `export_flow` + # @return [::Gapic::Config::Method] + # + attr_reader :export_flow + + # @private + def initialize parent_rpcs = nil + create_flow_config = parent_rpcs.create_flow if parent_rpcs.respond_to? :create_flow + @create_flow = ::Gapic::Config::Method.new create_flow_config + delete_flow_config = parent_rpcs.delete_flow if parent_rpcs.respond_to? :delete_flow + @delete_flow = ::Gapic::Config::Method.new delete_flow_config + list_flows_config = parent_rpcs.list_flows if parent_rpcs.respond_to? :list_flows + @list_flows = ::Gapic::Config::Method.new list_flows_config + get_flow_config = parent_rpcs.get_flow if parent_rpcs.respond_to? :get_flow + @get_flow = ::Gapic::Config::Method.new get_flow_config + update_flow_config = parent_rpcs.update_flow if parent_rpcs.respond_to? :update_flow + @update_flow = ::Gapic::Config::Method.new update_flow_config + train_flow_config = parent_rpcs.train_flow if parent_rpcs.respond_to? :train_flow + @train_flow = ::Gapic::Config::Method.new train_flow_config + validate_flow_config = parent_rpcs.validate_flow if parent_rpcs.respond_to? :validate_flow + @validate_flow = ::Gapic::Config::Method.new validate_flow_config + get_flow_validation_result_config = parent_rpcs.get_flow_validation_result if parent_rpcs.respond_to? :get_flow_validation_result + @get_flow_validation_result = ::Gapic::Config::Method.new get_flow_validation_result_config + import_flow_config = parent_rpcs.import_flow if parent_rpcs.respond_to? :import_flow + @import_flow = ::Gapic::Config::Method.new import_flow_config + export_flow_config = parent_rpcs.export_flow if parent_rpcs.respond_to? :export_flow + @export_flow = ::Gapic::Config::Method.new export_flow_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/credentials.rb new file mode 100644 index 000000000000..cbc1e1ab30e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Flows + # Credentials for the Flows 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb new file mode 100644 index 000000000000..6ebaf85a1cf2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/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 CX + module V3 + module Flows + # 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 Flows 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 Flows 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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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. + # * `: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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/paths.rb new file mode 100644 index 000000000000..e7ef0215d2fa --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/paths.rb @@ -0,0 +1,273 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Flows + # Path helper methods for the Flows API. + module Paths + ## + # Create a fully-qualified Agent resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # + # @return [::String] + def agent_path project:, location:, agent: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}" + end + + ## + # Create a fully-qualified Flow resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # + # @return [::String] + def flow_path project:, location:, agent:, flow: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}" + end + + ## + # Create a fully-qualified FlowValidationResult resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # + # @return [::String] + def flow_validation_result_path project:, location:, agent:, flow: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/validationResult" + end + + ## + # Create a fully-qualified Generator resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/generators/{generator}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param generator [String] + # + # @return [::String] + def generator_path project:, location:, agent:, generator: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/generators/#{generator}" + end + + ## + # Create a fully-qualified Intent resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/intents/{intent}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param intent [String] + # + # @return [::String] + def intent_path project:, location:, agent:, intent: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/intents/#{intent}" + end + + ## + # Create a fully-qualified Page resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # @param page [String] + # + # @return [::String] + def page_path project:, location:, agent:, flow:, page: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/pages/#{page}" + end + + ## + # Create a fully-qualified Playbook resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param playbook [String] + # + # @return [::String] + def playbook_path project:, location:, agent:, playbook: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}" + end + + ## + # Create a fully-qualified Tool resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param tool [String] + # + # @return [::String] + def tool_path project:, location:, agent:, tool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/tools/#{tool}" + end + + ## + # Create a fully-qualified TransitionRouteGroup resource string. + # + # @overload transition_route_group_path(project:, location:, agent:, flow:, transition_route_group:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # @param transition_route_group [String] + # + # @overload transition_route_group_path(project:, location:, agent:, transition_route_group:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param transition_route_group [String] + # + # @return [::String] + def transition_route_group_path **args + resources = { + "agent:flow:location:project:transition_route_group" => (proc do |project:, location:, agent:, flow:, transition_route_group:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/transitionRouteGroups/#{transition_route_group}" + end), + "agent:location:project:transition_route_group" => (proc do |project:, location:, agent:, transition_route_group:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/transitionRouteGroups/#{transition_route_group}" + 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 Webhook resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param webhook [String] + # + # @return [::String] + def webhook_path project:, location:, agent:, webhook: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/webhooks/#{webhook}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest.rb new file mode 100644 index 000000000000..f216c0c31665 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/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/cx/v3/version" +require "google/cloud/dialogflow/cx/v3/bindings_override" + +require "google/cloud/dialogflow/cx/v3/flows/credentials" +require "google/cloud/dialogflow/cx/v3/flows/paths" +require "google/cloud/dialogflow/cx/v3/flows/rest/operations" +require "google/cloud/dialogflow/cx/v3/flows/rest/client" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Flow Flows}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/cx/v3/flows/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + module Flows + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/flows/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb new file mode 100644 index 000000000000..70e1f5ba77e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb @@ -0,0 +1,1445 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/flow_pb" +require "google/cloud/dialogflow/cx/v3/flows/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Flows + module Rest + ## + # REST client for the Flows service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Flow Flows}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :flows_stub + + ## + # Configure the Flows Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Flows clients + # ::Google::Cloud::Dialogflow::CX::V3::Flows::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", "CX", "V3"] + 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 Flows 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::CX::V3::Flows::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 + @flows_stub.universe_domain + end + + ## + # Create a new Flows REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Flows 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::CX::V3::Flows::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 + + @flows_stub = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @flows_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 = @flows_stub.endpoint + config.universe_domain = @flows_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @flows_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Flows::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 + @flows_stub.logger + end + + # Service calls + + ## + # Creates a flow in the specified agent. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload create_flow(request, options = nil) + # Pass arguments to `create_flow` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_flow(parent: nil, flow: nil, language_code: nil) + # Pass arguments to `create_flow` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 flow for. + # Format: `projects//locations//agents/`. + # @param flow [::Google::Cloud::Dialogflow::CX::V3::Flow, ::Hash] + # Required. The flow to create. + # @param language_code [::String] + # The language of the following fields in `flow`: + # + # * `Flow.event_handlers.trigger_fulfillment.messages` + # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + # * `Flow.transition_routes.trigger_fulfillment.messages` + # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Flow] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest.new + # + # # Call the create_flow method. + # result = client.create_flow request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. + # p result + # + def create_flow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest + + # Converts hash and nil to an 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_flow.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_flow.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_flow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @flows_stub.create_flow request, 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 flow. + # + # @overload delete_flow(request, options = nil) + # Pass arguments to `delete_flow` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_flow(name: nil, force: nil) + # Pass arguments to `delete_flow` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 flow to delete. + # Format: + # `projects//locations//agents//flows/`. + # @param force [::Boolean] + # This field has no effect for flows with no incoming transitions. + # For flows with incoming transitions: + # + # * If `force` is set to false, an error will be returned with message + # indicating the incoming transitions. + # * If `force` is set to true, Dialogflow will remove the flow, as well as + # any transitions to the flow (i.e. [Target + # flow][EventHandler.target_flow] in event handlers or [Target + # flow][TransitionRoute.target_flow] in transition routes that point to + # this flow will be cleared). + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest.new + # + # # Call the delete_flow method. + # result = client.delete_flow request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_flow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest + + # Converts hash and nil to an 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_flow.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_flow.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_flow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @flows_stub.delete_flow request, 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 flows in the specified agent. + # + # @overload list_flows(request, options = nil) + # Pass arguments to `list_flows` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_flows(parent: nil, page_size: nil, page_token: nil, language_code: nil) + # Pass arguments to `list_flows` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 containing the flows. + # Format: `projects//locations//agents/`. + # @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. + # @param language_code [::String] + # The language to list flows for. The following fields are language + # dependent: + # + # * `Flow.event_handlers.trigger_fulfillment.messages` + # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + # * `Flow.transition_routes.trigger_fulfillment.messages` + # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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 [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Flow>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Flow>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest.new + # + # # Call the list_flows method. + # result = client.list_flows request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Flow. + # p item + # end + # + def list_flows request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest + + # Converts hash and nil to an 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_flows.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_flows.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_flows.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @flows_stub.list_flows request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @flows_stub, :list_flows, "flows", 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 flow. + # + # @overload get_flow(request, options = nil) + # Pass arguments to `get_flow` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_flow(name: nil, language_code: nil) + # Pass arguments to `get_flow` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 flow to get. + # Format: + # `projects//locations//agents//flows/`. + # @param language_code [::String] + # The language to retrieve the flow for. The following fields are language + # dependent: + # + # * `Flow.event_handlers.trigger_fulfillment.messages` + # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + # * `Flow.transition_routes.trigger_fulfillment.messages` + # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Flow] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetFlowRequest.new + # + # # Call the get_flow method. + # result = client.get_flow request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. + # p result + # + def get_flow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest + + # Converts hash and nil to an 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_flow.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_flow.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_flow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @flows_stub.get_flow request, 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 flow. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload update_flow(request, options = nil) + # Pass arguments to `update_flow` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_flow(flow: nil, update_mask: nil, language_code: nil) + # Pass arguments to `update_flow` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param flow [::Google::Cloud::Dialogflow::CX::V3::Flow, ::Hash] + # Required. The flow to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The mask to control which fields get updated. If the mask is not present, + # all fields will be updated. + # @param language_code [::String] + # The language of the following fields in `flow`: + # + # * `Flow.event_handlers.trigger_fulfillment.messages` + # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + # * `Flow.transition_routes.trigger_fulfillment.messages` + # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Flow] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest.new + # + # # Call the update_flow method. + # result = client.update_flow request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. + # p result + # + def update_flow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest + + # Converts hash and nil to an 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_flow.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_flow.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_flow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @flows_stub.update_flow request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Trains the specified flow. Note that only the flow in 'draft' environment + # is trained. + # + # 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`: 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 a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload train_flow(request, options = nil) + # Pass arguments to `train_flow` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_flow(name: nil) + # Pass arguments to `train_flow` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 flow to train. + # Format: + # `projects//locations//agents//flows/`. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest.new + # + # # Call the train_flow method. + # result = client.train_flow request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_flow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest + + # Converts hash and nil to an 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_flow.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_flow.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.train_flow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @flows_stub.train_flow 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 + + ## + # Validates the specified flow and creates or updates validation results. + # Please call this API after the training is completed to get the complete + # validation results. + # + # @overload validate_flow(request, options = nil) + # Pass arguments to `validate_flow` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload validate_flow(name: nil, language_code: nil) + # Pass arguments to `validate_flow` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 flow to validate. + # Format: + # `projects//locations//agents//flows/`. + # @param language_code [::String] + # If not specified, the agent's default language is used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest.new + # + # # Call the validate_flow method. + # result = client.validate_flow request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FlowValidationResult. + # p result + # + def validate_flow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.validate_flow.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.validate_flow.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.validate_flow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @flows_stub.validate_flow request, 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 latest flow validation result. Flow validation is performed + # when ValidateFlow is called. + # + # @overload get_flow_validation_result(request, options = nil) + # Pass arguments to `get_flow_validation_result` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_flow_validation_result(name: nil, language_code: nil) + # Pass arguments to `get_flow_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 name [::String] + # Required. The flow name. + # Format: + # `projects//locations//agents//flows//validationResult`. + # @param language_code [::String] + # If not specified, the agent's default language is used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest.new + # + # # Call the get_flow_validation_result method. + # result = client.get_flow_validation_result request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FlowValidationResult. + # p result + # + def get_flow_validation_result request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest + + # Converts hash and nil to an 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_flow_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_flow_validation_result.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_flow_validation_result.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @flows_stub.get_flow_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 + + ## + # Imports the specified flow to the specified agent from a binary file. + # + # 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`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::ImportFlowResponse ImportFlowResponse} + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload import_flow(request, options = nil) + # Pass arguments to `import_flow` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_flow(parent: nil, flow_uri: nil, flow_content: nil, import_option: nil, flow_import_strategy: nil) + # Pass arguments to `import_flow` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 import the flow into. + # Format: `projects//locations//agents/`. + # @param flow_uri [::String] + # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + # to import flow from. The format of this URI must be + # `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: `flow_uri`, `flow_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 flow_content [::String] + # Uncompressed raw byte content for flow. + # + # Note: The following parameters are mutually exclusive: `flow_content`, `flow_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 import_option [::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest::ImportOption] + # Flow import mode. If not specified, `KEEP` is assumed. + # @param flow_import_strategy [::Google::Cloud::Dialogflow::CX::V3::FlowImportStrategy, ::Hash] + # Optional. Specifies the import strategy used when resolving resource + # conflicts. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest.new + # + # # Call the import_flow method. + # result = client.import_flow request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_flow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest + + # Converts hash and nil to an 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_flow.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_flow.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_flow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @flows_stub.import_flow 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 flow to a binary file. + # + # 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`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::ExportFlowResponse ExportFlowResponse} + # + # Note that resources (e.g. intents, entities, webhooks) that the flow + # references will also be exported. + # + # @overload export_flow(request, options = nil) + # Pass arguments to `export_flow` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_flow(name: nil, flow_uri: nil, include_referenced_flows: nil) + # Pass arguments to `export_flow` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 flow to export. + # Format: + # `projects//locations//agents//flows/`. + # @param flow_uri [::String] + # Optional. The [Google Cloud + # Storage](https://cloud.google.com/storage/docs/) URI to export the flow to. + # The format of this URI must be `gs:///`. If left + # unspecified, the serialized flow 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). + # @param include_referenced_flows [::Boolean] + # Optional. Whether to export flows referenced by the specified flow. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest.new + # + # # Call the export_flow method. + # result = client.export_flow request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_flow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest + + # Converts hash and nil to an 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_flow.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_flow.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_flow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @flows_stub.export_flow 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 Flows REST API. + # + # This class represents the configuration for Flows 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::CX::V3::Flows::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_flow to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_flow.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_flow.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 Flows API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_flow` + # @return [::Gapic::Config::Method] + # + attr_reader :create_flow + ## + # RPC-specific configuration for `delete_flow` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_flow + ## + # RPC-specific configuration for `list_flows` + # @return [::Gapic::Config::Method] + # + attr_reader :list_flows + ## + # RPC-specific configuration for `get_flow` + # @return [::Gapic::Config::Method] + # + attr_reader :get_flow + ## + # RPC-specific configuration for `update_flow` + # @return [::Gapic::Config::Method] + # + attr_reader :update_flow + ## + # RPC-specific configuration for `train_flow` + # @return [::Gapic::Config::Method] + # + attr_reader :train_flow + ## + # RPC-specific configuration for `validate_flow` + # @return [::Gapic::Config::Method] + # + attr_reader :validate_flow + ## + # RPC-specific configuration for `get_flow_validation_result` + # @return [::Gapic::Config::Method] + # + attr_reader :get_flow_validation_result + ## + # RPC-specific configuration for `import_flow` + # @return [::Gapic::Config::Method] + # + attr_reader :import_flow + ## + # RPC-specific configuration for `export_flow` + # @return [::Gapic::Config::Method] + # + attr_reader :export_flow + + # @private + def initialize parent_rpcs = nil + create_flow_config = parent_rpcs.create_flow if parent_rpcs.respond_to? :create_flow + @create_flow = ::Gapic::Config::Method.new create_flow_config + delete_flow_config = parent_rpcs.delete_flow if parent_rpcs.respond_to? :delete_flow + @delete_flow = ::Gapic::Config::Method.new delete_flow_config + list_flows_config = parent_rpcs.list_flows if parent_rpcs.respond_to? :list_flows + @list_flows = ::Gapic::Config::Method.new list_flows_config + get_flow_config = parent_rpcs.get_flow if parent_rpcs.respond_to? :get_flow + @get_flow = ::Gapic::Config::Method.new get_flow_config + update_flow_config = parent_rpcs.update_flow if parent_rpcs.respond_to? :update_flow + @update_flow = ::Gapic::Config::Method.new update_flow_config + train_flow_config = parent_rpcs.train_flow if parent_rpcs.respond_to? :train_flow + @train_flow = ::Gapic::Config::Method.new train_flow_config + validate_flow_config = parent_rpcs.validate_flow if parent_rpcs.respond_to? :validate_flow + @validate_flow = ::Gapic::Config::Method.new validate_flow_config + get_flow_validation_result_config = parent_rpcs.get_flow_validation_result if parent_rpcs.respond_to? :get_flow_validation_result + @get_flow_validation_result = ::Gapic::Config::Method.new get_flow_validation_result_config + import_flow_config = parent_rpcs.import_flow if parent_rpcs.respond_to? :import_flow + @import_flow = ::Gapic::Config::Method.new import_flow_config + export_flow_config = parent_rpcs.export_flow if parent_rpcs.respond_to? :export_flow + @export_flow = ::Gapic::Config::Method.new export_flow_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb new file mode 100644 index 000000000000..2a8fb909b5ad --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/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 CX + module V3 + module Flows + 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 Flows 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 Flows 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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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. + # * `: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: "/v3/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{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: "/v3/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb new file mode 100644 index 000000000000..02942aecb8a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb @@ -0,0 +1,699 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/flow_pb" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Flows + module Rest + ## + # REST service stub for the Flows 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_flow REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Flow] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] + # A result object deserialized from the server's reply + def create_flow request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_flow_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_flow", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Flow.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_flow REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_flow request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_flow_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_flow", + 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_flows REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::ListFlowsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ListFlowsResponse] + # A result object deserialized from the server's reply + def list_flows request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_flows_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_flows", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::ListFlowsResponse.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_flow REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Flow] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] + # A result object deserialized from the server's reply + def get_flow request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_flow_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_flow", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Flow.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_flow REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Flow] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] + # A result object deserialized from the server's reply + def update_flow request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_flow_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_flow", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Flow.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_flow REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_flow request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_train_flow_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_flow", + 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 validate_flow REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::FlowValidationResult] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] + # A result object deserialized from the server's reply + def validate_flow request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_validate_flow_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "validate_flow", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult.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_flow_validation_result REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::FlowValidationResult] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] + # A result object deserialized from the server's reply + def get_flow_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_flow_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_flow_validation_result", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult.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_flow REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_flow request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_flow_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_flow", + 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_flow REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_flow request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_flow_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_flow", + 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_flow REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest] + # 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_flow_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/flows", + body: "flow", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_flow REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest] + # 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_flow_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_flows REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest] + # 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_flows_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/flows", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_flow REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest] + # 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_flow_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_flow REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest] + # 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_flow_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v3/{flow.name}", + body: "flow", + matches: [ + ["flow.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the train_flow REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest] + # 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_flow_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:train", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the validate_flow REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_validate_flow_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:validate", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_flow_validation_result REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest] + # 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_flow_validation_result_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/validationResult/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_flow REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest] + # 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_flow_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/flows:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_flow REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest] + # 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_flow_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:export", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/fulfillment_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/fulfillment_pb.rb new file mode 100644 index 000000000000..93aa68ce32a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/fulfillment_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/fulfillment.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/dialogflow/cx/v3/advanced_settings_pb' +require 'google/cloud/dialogflow/cx/v3/response_message_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n/google/cloud/dialogflow/cx/v3/fulfillment.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x35google/cloud/dialogflow/cx/v3/advanced_settings.proto\x1a\x34google/cloud/dialogflow/cx/v3/response_message.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xbf\n\n\x0b\x46ulfillment\x12@\n\x08messages\x18\x01 \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.ResponseMessage\x12\x37\n\x07webhook\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Webhook\x12 \n\x18return_partial_responses\x18\x08 \x01(\x08\x12\x0b\n\x03tag\x18\x03 \x01(\t\x12\\\n\x15set_parameter_actions\x18\x04 \x03(\x0b\x32=.google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction\x12V\n\x11\x63onditional_cases\x18\x05 \x03(\x0b\x32;.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases\x12J\n\x11\x61\x64vanced_settings\x18\x07 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x12\"\n\x1a\x65nable_generative_fallback\x18\x0c \x01(\x08\x12P\n\ngenerators\x18\r \x03(\x0b\x32<.google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings\x1aN\n\x12SetParameterAction\x12\x11\n\tparameter\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value\x1a\xa3\x03\n\x10\x43onditionalCases\x12O\n\x05\x63\x61ses\x18\x01 \x03(\x0b\x32@.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case\x1a\xbd\x02\n\x04\x43\x61se\x12\x11\n\tcondition\x18\x01 \x01(\t\x12\x62\n\x0c\x63\x61se_content\x18\x02 \x03(\x0b\x32L.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent\x1a\xbd\x01\n\x0b\x43\x61seContent\x12\x41\n\x07message\x18\x01 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.ResponseMessageH\x00\x12W\n\x10\x61\x64\x64itional_cases\x18\x02 \x01(\x0b\x32;.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCasesH\x00\x42\x12\n\x10\x63\x61ses_or_message\x1a\x97\x02\n\x11GeneratorSettings\x12>\n\tgenerator\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#dialogflow.googleapis.com/Generator\x12k\n\x10input_parameters\x18\x02 \x03(\x0b\x32Q.google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings.InputParametersEntry\x12\x1d\n\x10output_parameter\x18\x03 \x01(\tB\x03\xe0\x41\x02\x1a\x36\n\x14InputParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\xb3\x01\n!com.google.cloud.dialogflow.cx.v3B\x10\x46ulfillmentProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.dialogflow.cx.v3.ResponseMessage", "google/cloud/dialogflow/cx/v3/response_message.proto"], + ["google.cloud.dialogflow.cx.v3.AdvancedSettings", "google/cloud/dialogflow/cx/v3/advanced_settings.proto"], + ["google.protobuf.Value", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + Fulfillment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Fulfillment").msgclass + Fulfillment::SetParameterAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction").msgclass + Fulfillment::ConditionalCases = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases").msgclass + Fulfillment::ConditionalCases::Case = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case").msgclass + Fulfillment::ConditionalCases::Case::CaseContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent").msgclass + Fulfillment::GeneratorSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/gcs_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/gcs_pb.rb new file mode 100644 index 000000000000..fbc23e0bf3cc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/gcs_pb.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/gcs.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n\'google/cloud/dialogflow/cx/v3/gcs.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\"\"\n\x0eGcsDestination\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x42\xab\x01\n!com.google.cloud.dialogflow.cx.v3B\x08GcsProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + GcsDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GcsDestination").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generative_settings_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generative_settings_pb.rb new file mode 100644 index 000000000000..3738fddbe12b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generative_settings_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/generative_settings.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/cloud/dialogflow/cx/v3/safety_settings_pb' + + +descriptor_data = "\n7google/cloud/dialogflow/cx/v3/generative_settings.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x19google/api/resource.proto\x1a\x33google/cloud/dialogflow/cx/v3/safety_settings.proto\"\xc8\x07\n\x12GenerativeSettings\x12\x0c\n\x04name\x18\x05 \x01(\t\x12]\n\x11\x66\x61llback_settings\x18\x01 \x01(\x0b\x32\x42.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings\x12Q\n\x1agenerative_safety_settings\x18\x03 \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.SafetySettings\x12r\n\x1cknowledge_connector_settings\x18\x07 \x01(\x0b\x32L.google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings\x12\x15\n\rlanguage_code\x18\x04 \x01(\t\x12K\n\x12llm_model_settings\x18\x08 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.LlmModelSettings\x1a\xe5\x01\n\x10\x46\x61llbackSettings\x12\x17\n\x0fselected_prompt\x18\x03 \x01(\t\x12k\n\x10prompt_templates\x18\x04 \x03(\x0b\x32Q.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate\x1aK\n\x0ePromptTemplate\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x13\n\x0bprompt_text\x18\x02 \x01(\t\x12\x0e\n\x06\x66rozen\x18\x03 \x01(\x08\x1a\xad\x01\n\x1aKnowledgeConnectorSettings\x12\x10\n\x08\x62usiness\x18\x01 \x01(\t\x12\r\n\x05\x61gent\x18\x02 \x01(\t\x12\x16\n\x0e\x61gent_identity\x18\x03 \x01(\t\x12\x1c\n\x14\x62usiness_description\x18\x04 \x01(\t\x12\x13\n\x0b\x61gent_scope\x18\x05 \x01(\t\x12#\n\x1b\x64isable_data_store_fallback\x18\x08 \x01(\x08:\x81\x01\xea\x41~\n1dialogflow.googleapis.com/AgentGenerativeSettings\x12Iprojects/{project}/locations/{location}/agents/{agent}/generativeSettings\"6\n\x10LlmModelSettings\x12\r\n\x05model\x18\x01 \x01(\t\x12\x13\n\x0bprompt_text\x18\x02 \x01(\tB\xba\x01\n!com.google.cloud.dialogflow.cx.v3B\x17GenerativeSettingsProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.dialogflow.cx.v3.SafetySettings", "google/cloud/dialogflow/cx/v3/safety_settings.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + GenerativeSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GenerativeSettings").msgclass + GenerativeSettings::FallbackSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings").msgclass + GenerativeSettings::FallbackSettings::PromptTemplate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate").msgclass + GenerativeSettings::KnowledgeConnectorSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings").msgclass + LlmModelSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.LlmModelSettings").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generator_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generator_pb.rb new file mode 100644 index 000000000000..d058a7f513e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generator_pb.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/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/cx/v3/generative_settings_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n-google/cloud/dialogflow/cx/v3/generator.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x37google/cloud/dialogflow/cx/v3/generative_settings.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xb4\x05\n\tGenerator\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12?\n\x0bprompt_text\x18\x03 \x01(\x0b\x32%.google.cloud.dialogflow.cx.v3.PhraseB\x03\xe0\x41\x02\x12O\n\x0cplaceholders\x18\x05 \x03(\x0b\x32\x34.google.cloud.dialogflow.cx.v3.Generator.PlaceholderB\x03\xe0\x41\x01\x12K\n\x12llm_model_settings\x18\t \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.LlmModelSettings\x12P\n\x0fmodel_parameter\x18\x08 \x01(\x0b\x32\x37.google.cloud.dialogflow.cx.v3.Generator.ModelParameter\x1a\'\n\x0bPlaceholder\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x1a\xaa\x01\n\x0eModelParameter\x12\x18\n\x0btemperature\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x1d\n\x10max_decode_steps\x18\x02 \x01(\x05H\x01\x88\x01\x01\x12\x12\n\x05top_p\x18\x03 \x01(\x02H\x02\x88\x01\x01\x12\x12\n\x05top_k\x18\x04 \x01(\x05H\x03\x88\x01\x01\x42\x0e\n\x0c_temperatureB\x13\n\x11_max_decode_stepsB\x08\n\x06_top_pB\x08\n\x06_top_k:w\xea\x41t\n#dialogflow.googleapis.com/Generator\x12Mprojects/{project}/locations/{location}/agents/{agent}/generators/{generator}\"\x1b\n\x06Phrase\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\x92\x01\n\x15ListGeneratorsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#dialogflow.googleapis.com/Generator\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"o\n\x16ListGeneratorsResponse\x12<\n\ngenerators\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.cx.v3.Generator\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"g\n\x13GetGeneratorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#dialogflow.googleapis.com/Generator\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\xae\x01\n\x16\x43reateGeneratorRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#dialogflow.googleapis.com/Generator\x12@\n\tgenerator\x18\x02 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.GeneratorB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"\xa2\x01\n\x16UpdateGeneratorRequest\x12@\n\tgenerator\x18\x01 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.GeneratorB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"b\n\x16\x44\x65leteGeneratorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#dialogflow.googleapis.com/Generator\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\x32\xe9\x08\n\nGenerators\x12\xc7\x01\n\x0eListGenerators\x12\x34.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest\x1a\x35.google.cloud.dialogflow.cx.v3.ListGeneratorsResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v3/{parent=projects/*/locations/*/agents/*}/generators\x12\xb4\x01\n\x0cGetGenerator\x12\x32.google.cloud.dialogflow.cx.v3.GetGeneratorRequest\x1a(.google.cloud.dialogflow.cx.v3.Generator\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\x12\x37/v3/{name=projects/*/locations/*/agents/*/generators/*}\x12\xd1\x01\n\x0f\x43reateGenerator\x12\x35.google.cloud.dialogflow.cx.v3.CreateGeneratorRequest\x1a(.google.cloud.dialogflow.cx.v3.Generator\"]\xda\x41\x10parent,generator\x82\xd3\xe4\x93\x02\x44\"7/v3/{parent=projects/*/locations/*/agents/*}/generators:\tgenerator\x12\xe0\x01\n\x0fUpdateGenerator\x12\x35.google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest\x1a(.google.cloud.dialogflow.cx.v3.Generator\"l\xda\x41\x15generator,update_mask\x82\xd3\xe4\x93\x02N2A/v3/{generator.name=projects/*/locations/*/agents/*/generators/*}:\tgenerator\x12\xa8\x01\n\x0f\x44\x65leteGenerator\x12\x35.google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest\x1a\x16.google.protobuf.Empty\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39*7/v3/{name=projects/*/locations/*/agents/*/generators/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xb1\x01\n!com.google.cloud.dialogflow.cx.v3B\x0eGeneratorProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.dialogflow.cx.v3.LlmModelSettings", "google/cloud/dialogflow/cx/v3/generative_settings.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + Generator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Generator").msgclass + Generator::Placeholder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Generator.Placeholder").msgclass + Generator::ModelParameter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Generator.ModelParameter").msgclass + Phrase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Phrase").msgclass + ListGeneratorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListGeneratorsRequest").msgclass + ListGeneratorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListGeneratorsResponse").msgclass + GetGeneratorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetGeneratorRequest").msgclass + CreateGeneratorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateGeneratorRequest").msgclass + UpdateGeneratorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest").msgclass + DeleteGeneratorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generator_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generator_services_pb.rb new file mode 100644 index 000000000000..b48bcdd42dc3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generator_services_pb.rb @@ -0,0 +1,55 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/cx/v3/generator.proto for package 'Google.Cloud.Dialogflow.CX.V3' +# 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/cx/v3/generator_pb' + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Generators + # Service for managing [Generators][google.cloud.dialogflow.cx.v3.Generator] + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.cx.v3.Generators' + + # Returns the list of all generators in the specified agent. + rpc :ListGenerators, ::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsResponse + # Retrieves the specified generator. + rpc :GetGenerator, ::Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest, ::Google::Cloud::Dialogflow::CX::V3::Generator + # Creates a generator in the specified agent. + rpc :CreateGenerator, ::Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest, ::Google::Cloud::Dialogflow::CX::V3::Generator + # Update the specified generator. + rpc :UpdateGenerator, ::Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest, ::Google::Cloud::Dialogflow::CX::V3::Generator + # Deletes the specified generators. + rpc :DeleteGenerator, ::Google::Cloud::Dialogflow::CX::V3::DeleteGeneratorRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators.rb new file mode 100644 index 000000000000..8026dc792fcf --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators.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/cx/v3/version" + +require "google/cloud/dialogflow/cx/v3/generators/credentials" +require "google/cloud/dialogflow/cx/v3/generators/paths" +require "google/cloud/dialogflow/cx/v3/generators/client" +require "google/cloud/dialogflow/cx/v3/generators/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Generator Generators} + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/cx/v3/generators" + # client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/cx/v3/generators/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new + # + module Generators + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "generators", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/generators/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/client.rb new file mode 100644 index 000000000000..17f30e754d70 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/client.rb @@ -0,0 +1,906 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/generator_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Generators + ## + # Client for the Generators service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Generator Generators} + # + 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::CX::V3::Generators::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Generators clients + # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] + 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::CX::V3::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::CX::V3::Generators::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::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/cx/v3/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::CX::V3::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 + + ## + # Returns the list of all generators in the specified agent. + # + # @overload list_generators(request, options = nil) + # Pass arguments to `list_generators` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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, language_code: 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 agent to list all generators for. + # Format: `projects//locations//agents/`. + # @param language_code [::String] + # The language to list generators for. + # @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::CX::V3::Generator>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Generator>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Generators::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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 + + ## + # Retrieves the specified generator. + # + # @overload get_generator(request, options = nil) + # Pass arguments to `get_generator` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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, language_code: 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 name of the generator. + # Format: + # `projects//locations//agents//generators/`. + # @param language_code [::String] + # The language to list generators for. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Generator] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Generator] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Generators::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest.new + # + # # Call the get_generator method. + # result = client.get_generator request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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 + + ## + # Creates a generator in the specified agent. + # + # @overload create_generator(request, options = nil) + # Pass arguments to `create_generator` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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, language_code: 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 agent to create a generator for. + # Format: `projects//locations//agents/`. + # @param generator [::Google::Cloud::Dialogflow::CX::V3::Generator, ::Hash] + # Required. The generator to create. + # @param language_code [::String] + # The language to create generators for the following fields: + # * `Generator.prompt_text.text` + # If not specified, the agent's default language is used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Generator] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Generator] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Generators::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest.new + # + # # Call the create_generator method. + # result = client.create_generator request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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 + + ## + # Update the specified generator. + # + # @overload update_generator(request, options = nil) + # Pass arguments to `update_generator` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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, language_code: 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::CX::V3::Generator, ::Hash] + # Required. The generator to update. + # @param language_code [::String] + # The language to list generators for. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # 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::CX::V3::Generator] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Generator] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Generators::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest.new + # + # # Call the update_generator method. + # result = client.update_generator request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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 + + ## + # Deletes the specified generators. + # + # @overload delete_generator(request, options = nil) + # Pass arguments to `delete_generator` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteGeneratorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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, force: 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 name of the generator to delete. + # Format: + # `projects//locations//agents//generators/`. + # @param force [::Boolean] + # This field has no effect for generators not being used. + # For generators that are used by pages/flows/transition route groups: + # + # * If `force` is set to false, an error will be returned with message + # indicating the referenced resources. + # * If `force` is set to true, Dialogflow will remove the generator, as well + # as any references to the generator (i.e. + # [Generator][Fulfillment.generator]) in fulfillments. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Generators::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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 + + ## + # 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::CX::V3::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 + # # list_generators to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::Generators::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_generators.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_generators.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::CX::V3::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. + # * `: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. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_generators` + # @return [::Gapic::Config::Method] + # + attr_reader :list_generators + ## + # RPC-specific configuration for `get_generator` + # @return [::Gapic::Config::Method] + # + attr_reader :get_generator + ## + # RPC-specific configuration for `create_generator` + # @return [::Gapic::Config::Method] + # + attr_reader :create_generator + ## + # RPC-specific configuration for `update_generator` + # @return [::Gapic::Config::Method] + # + attr_reader :update_generator + ## + # RPC-specific configuration for `delete_generator` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_generator + + # @private + def initialize parent_rpcs = nil + list_generators_config = parent_rpcs.list_generators if parent_rpcs.respond_to? :list_generators + @list_generators = ::Gapic::Config::Method.new list_generators_config + get_generator_config = parent_rpcs.get_generator if parent_rpcs.respond_to? :get_generator + @get_generator = ::Gapic::Config::Method.new get_generator_config + create_generator_config = parent_rpcs.create_generator if parent_rpcs.respond_to? :create_generator + @create_generator = ::Gapic::Config::Method.new create_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 + delete_generator_config = parent_rpcs.delete_generator if parent_rpcs.respond_to? :delete_generator + @delete_generator = ::Gapic::Config::Method.new delete_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/credentials.rb new file mode 100644 index 000000000000..f2281ff02688 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/paths.rb new file mode 100644 index 000000000000..10dc7ef20ae4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/paths.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! + + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Generators + # Path helper methods for the Generators API. + module Paths + ## + # Create a fully-qualified Agent resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # + # @return [::String] + def agent_path project:, location:, agent: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}" + end + + ## + # Create a fully-qualified Generator resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/generators/{generator}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param generator [String] + # + # @return [::String] + def generator_path project:, location:, agent:, generator: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/generators/#{generator}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest.rb new file mode 100644 index 000000000000..9ded45d58f2e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/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/cx/v3/version" +require "google/cloud/dialogflow/cx/v3/bindings_override" + +require "google/cloud/dialogflow/cx/v3/generators/credentials" +require "google/cloud/dialogflow/cx/v3/generators/paths" +require "google/cloud/dialogflow/cx/v3/generators/rest/client" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Generator Generators} + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/cx/v3/generators/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new + # + module Generators + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/generators/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb new file mode 100644 index 000000000000..c17d663fda66 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb @@ -0,0 +1,836 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/generator_pb" +require "google/cloud/dialogflow/cx/v3/generators/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Generators + module Rest + ## + # REST client for the Generators service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Generator Generators} + # + 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::CX::V3::Generators::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Generators clients + # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] + 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::CX::V3::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::CX::V3::Generators::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 + + ## + # Returns the list of all generators in the specified agent. + # + # @overload list_generators(request, options = nil) + # Pass arguments to `list_generators` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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, language_code: 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 agent to list all generators for. + # Format: `projects//locations//agents/`. + # @param language_code [::String] + # The language to list generators for. + # @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::CX::V3::Generator>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Generator>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # Retrieves the specified generator. + # + # @overload get_generator(request, options = nil) + # Pass arguments to `get_generator` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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, language_code: 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 name of the generator. + # Format: + # `projects//locations//agents//generators/`. + # @param language_code [::String] + # The language to list generators for. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Generator] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Generator] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest.new + # + # # Call the get_generator method. + # result = client.get_generator request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # Creates a generator in the specified agent. + # + # @overload create_generator(request, options = nil) + # Pass arguments to `create_generator` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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, language_code: 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 agent to create a generator for. + # Format: `projects//locations//agents/`. + # @param generator [::Google::Cloud::Dialogflow::CX::V3::Generator, ::Hash] + # Required. The generator to create. + # @param language_code [::String] + # The language to create generators for the following fields: + # * `Generator.prompt_text.text` + # If not specified, the agent's default language is used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Generator] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Generator] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest.new + # + # # Call the create_generator method. + # result = client.create_generator request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # Update the specified generator. + # + # @overload update_generator(request, options = nil) + # Pass arguments to `update_generator` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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, language_code: 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::CX::V3::Generator, ::Hash] + # Required. The generator to update. + # @param language_code [::String] + # The language to list generators for. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # 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::CX::V3::Generator] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Generator] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest.new + # + # # Call the update_generator method. + # result = client.update_generator request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # Deletes the specified generators. + # + # @overload delete_generator(request, options = nil) + # Pass arguments to `delete_generator` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteGeneratorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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, force: 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 name of the generator to delete. + # Format: + # `projects//locations//agents//generators/`. + # @param force [::Boolean] + # This field has no effect for generators not being used. + # For generators that are used by pages/flows/transition route groups: + # + # * If `force` is set to false, an error will be returned with message + # indicating the referenced resources. + # * If `force` is set to true, Dialogflow will remove the generator, as well + # as any references to the generator (i.e. + # [Generator][Fulfillment.generator]) in fulfillments. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # 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::CX::V3::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 + # # list_generators to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_generators.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_generators.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_generators` + # @return [::Gapic::Config::Method] + # + attr_reader :list_generators + ## + # RPC-specific configuration for `get_generator` + # @return [::Gapic::Config::Method] + # + attr_reader :get_generator + ## + # RPC-specific configuration for `create_generator` + # @return [::Gapic::Config::Method] + # + attr_reader :create_generator + ## + # RPC-specific configuration for `update_generator` + # @return [::Gapic::Config::Method] + # + attr_reader :update_generator + ## + # RPC-specific configuration for `delete_generator` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_generator + + # @private + def initialize parent_rpcs = nil + list_generators_config = parent_rpcs.list_generators if parent_rpcs.respond_to? :list_generators + @list_generators = ::Gapic::Config::Method.new list_generators_config + get_generator_config = parent_rpcs.get_generator if parent_rpcs.respond_to? :get_generator + @get_generator = ::Gapic::Config::Method.new get_generator_config + create_generator_config = parent_rpcs.create_generator if parent_rpcs.respond_to? :create_generator + @create_generator = ::Gapic::Config::Method.new create_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 + delete_generator_config = parent_rpcs.delete_generator if parent_rpcs.respond_to? :delete_generator + @delete_generator = ::Gapic::Config::Method.new delete_generator_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/service_stub.rb new file mode 100644 index 000000000000..834b60aea2f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/service_stub.rb @@ -0,0 +1,390 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/generator_pb" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + 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 list_generators REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::ListGeneratorsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 get_generator REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Generator] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 create_generator REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Generator] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 update_generator REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Generator] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 delete_generator REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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 + + ## + # @private + # + # GRPC transcoding helper method for the list_generators REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{parent}/generators", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_generator REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/generators/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_generator REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{parent}/generators", + body: "generator", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_generator REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{generator.name}", + body: "generator", + matches: [ + ["generator.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/generators/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_generator REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/generators/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/import_strategy_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/import_strategy_pb.rb new file mode 100644 index 000000000000..96cd7e3eae83 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/import_strategy_pb.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/import_strategy.proto + +require 'google/protobuf' + + +descriptor_data = "\n3google/cloud/dialogflow/cx/v3/import_strategy.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3*\xc4\x01\n\x0eImportStrategy\x12\x1f\n\x1bIMPORT_STRATEGY_UNSPECIFIED\x10\x00\x12\x1e\n\x1aIMPORT_STRATEGY_CREATE_NEW\x10\x01\x12\x1b\n\x17IMPORT_STRATEGY_REPLACE\x10\x02\x12\x18\n\x14IMPORT_STRATEGY_KEEP\x10\x03\x12\x19\n\x15IMPORT_STRATEGY_MERGE\x10\x04\x12\x1f\n\x1bIMPORT_STRATEGY_THROW_ERROR\x10\x05\x42\xb6\x01\n!com.google.cloud.dialogflow.cx.v3B\x13ImportStrategyProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ImportStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportStrategy").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/inline_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/inline_pb.rb new file mode 100644 index 000000000000..7a2160b7ef43 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/inline_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/inline.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n*google/cloud/dialogflow/cx/v3/inline.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\")\n\x11InlineDestination\x12\x14\n\x07\x63ontent\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x03\"\x1f\n\x0cInlineSource\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x42\xae\x01\n!com.google.cloud.dialogflow.cx.v3B\x0bInlineProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + InlineDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.InlineDestination").msgclass + InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.InlineSource").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intent_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intent_pb.rb new file mode 100644 index 000000000000..220663b4cd95 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intent_pb.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/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/cx/v3/inline_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n*google/cloud/dialogflow/cx/v3/intent.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/inline.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xa1\x06\n\x06Intent\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12N\n\x10training_phrases\x18\x03 \x03(\x0b\x32\x34.google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase\x12\x43\n\nparameters\x18\x04 \x03(\x0b\x32/.google.cloud.dialogflow.cx.v3.Intent.Parameter\x12\x10\n\x08priority\x18\x05 \x01(\x05\x12\x13\n\x0bis_fallback\x18\x06 \x01(\x08\x12\x41\n\x06labels\x18\x07 \x03(\x0b\x32\x31.google.cloud.dialogflow.cx.v3.Intent.LabelsEntry\x12\x13\n\x0b\x64\x65scription\x18\x08 \x01(\t\x1a\xb7\x01\n\x0eTrainingPhrase\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12M\n\x05parts\x18\x02 \x03(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.PartB\x03\xe0\x41\x02\x12\x14\n\x0crepeat_count\x18\x03 \x01(\x05\x1a/\n\x04Part\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0cparameter_id\x18\x02 \x01(\t\x1a\x80\x01\n\tParameter\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x0b\x65ntity_type\x18\x02 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/EntityType\x12\x0f\n\x07is_list\x18\x03 \x01(\x08\x12\x0e\n\x06redact\x18\x04 \x01(\x08\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:n\xea\x41k\n dialogflow.googleapis.com/Intent\x12Gprojects/{project}/locations/{location}/agents/{agent}/intents/{intent}\"\xcc\x01\n\x12ListIntentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 dialogflow.googleapis.com/Intent\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12>\n\x0bintent_view\x18\x05 \x01(\x0e\x32).google.cloud.dialogflow.cx.v3.IntentView\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"f\n\x13ListIntentsResponse\x12\x36\n\x07intents\x18\x01 \x03(\x0b\x32%.google.cloud.dialogflow.cx.v3.Intent\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"a\n\x10GetIntentRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n dialogflow.googleapis.com/Intent\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\xa2\x01\n\x13\x43reateIntentRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 dialogflow.googleapis.com/Intent\x12:\n\x06intent\x18\x02 \x01(\x0b\x32%.google.cloud.dialogflow.cx.v3.IntentB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"\x99\x01\n\x13UpdateIntentRequest\x12:\n\x06intent\x18\x01 \x01(\x0b\x32%.google.cloud.dialogflow.cx.v3.IntentB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"M\n\x13\x44\x65leteIntentRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n dialogflow.googleapis.com/Intent\"\x91\x03\n\x14ImportIntentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 dialogflow.googleapis.com/Intent\x12\x15\n\x0bintents_uri\x18\x02 \x01(\tH\x00\x12\x46\n\x0fintents_content\x18\x03 \x01(\x0b\x32+.google.cloud.dialogflow.cx.v3.InlineSourceH\x00\x12U\n\x0cmerge_option\x18\x04 \x01(\x0e\x32?.google.cloud.dialogflow.cx.v3.ImportIntentsRequest.MergeOption\"~\n\x0bMergeOption\x12\x1c\n\x18MERGE_OPTION_UNSPECIFIED\x10\x00\x12\x0e\n\x06REJECT\x10\x01\x1a\x02\x08\x01\x12\x0b\n\x07REPLACE\x10\x02\x12\t\n\x05MERGE\x10\x03\x12\n\n\x06RENAME\x10\x04\x12\x13\n\x0fREPORT_CONFLICT\x10\x05\x12\x08\n\x04KEEP\x10\x06\x42\t\n\x07intents\"\x8d\x02\n\x15ImportIntentsResponse\x12\x36\n\x07intents\x18\x01 \x03(\tB%\xfa\x41\"\n dialogflow.googleapis.com/Intent\x12h\n\x15\x63onflicting_resources\x18\x02 \x01(\x0b\x32I.google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources\x1aR\n\x14\x43onflictingResources\x12\x1c\n\x14intent_display_names\x18\x01 \x03(\t\x12\x1c\n\x14\x65ntity_display_names\x18\x02 \x03(\t\"\x17\n\x15ImportIntentsMetadata\"\xda\x02\n\x14\x45xportIntentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 dialogflow.googleapis.com/Intent\x12\x14\n\x07intents\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12\x1a\n\x0bintents_uri\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x12%\n\x16intents_content_inline\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x12X\n\x0b\x64\x61ta_format\x18\x05 \x01(\x0e\x32>.google.cloud.dialogflow.cx.v3.ExportIntentsRequest.DataFormatB\x03\xe0\x41\x01\"F\n\nDataFormat\x12\x1b\n\x17\x44\x41TA_FORMAT_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42LOB\x10\x01\x12\x08\n\x04JSON\x10\x02\x12\x07\n\x03\x43SV\x10\x03\x42\r\n\x0b\x64\x65stination\"\x86\x01\n\x15\x45xportIntentsResponse\x12\x15\n\x0bintents_uri\x18\x01 \x01(\tH\x00\x12K\n\x0fintents_content\x18\x02 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.InlineDestinationH\x00\x42\t\n\x07intents\"\x17\n\x15\x45xportIntentsMetadata*X\n\nIntentView\x12\x1b\n\x17INTENT_VIEW_UNSPECIFIED\x10\x00\x12\x17\n\x13INTENT_VIEW_PARTIAL\x10\x01\x12\x14\n\x10INTENT_VIEW_FULL\x10\x02\x32\xdc\x0b\n\x07Intents\x12\xbb\x01\n\x0bListIntents\x12\x31.google.cloud.dialogflow.cx.v3.ListIntentsRequest\x1a\x32.google.cloud.dialogflow.cx.v3.ListIntentsResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v3/{parent=projects/*/locations/*/agents/*}/intents\x12\xa8\x01\n\tGetIntent\x12/.google.cloud.dialogflow.cx.v3.GetIntentRequest\x1a%.google.cloud.dialogflow.cx.v3.Intent\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v3/{name=projects/*/locations/*/agents/*/intents/*}\x12\xbf\x01\n\x0c\x43reateIntent\x12\x32.google.cloud.dialogflow.cx.v3.CreateIntentRequest\x1a%.google.cloud.dialogflow.cx.v3.Intent\"T\xda\x41\rparent,intent\x82\xd3\xe4\x93\x02>\"4/v3/{parent=projects/*/locations/*/agents/*}/intents:\x06intent\x12\xcb\x01\n\x0cUpdateIntent\x12\x32.google.cloud.dialogflow.cx.v3.UpdateIntentRequest\x1a%.google.cloud.dialogflow.cx.v3.Intent\"`\xda\x41\x12intent,update_mask\x82\xd3\xe4\x93\x02\x45\x32;/v3/{intent.name=projects/*/locations/*/agents/*/intents/*}:\x06intent\x12\x9f\x01\n\x0c\x44\x65leteIntent\x12\x32.google.cloud.dialogflow.cx.v3.DeleteIntentRequest\x1a\x16.google.protobuf.Empty\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36*4/v3/{name=projects/*/locations/*/agents/*/intents/*}\x12\xdc\x01\n\rImportIntents\x12\x33.google.cloud.dialogflow.cx.v3.ImportIntentsRequest\x1a\x1d.google.longrunning.Operation\"w\xca\x41.\n\x15ImportIntentsResponse\x12\x15ImportIntentsMetadata\x82\xd3\xe4\x93\x02@\";/v3/{parent=projects/*/locations/*/agents/*}/intents:import:\x01*\x12\xdc\x01\n\rExportIntents\x12\x33.google.cloud.dialogflow.cx.v3.ExportIntentsRequest\x1a\x1d.google.longrunning.Operation\"w\xca\x41.\n\x15\x45xportIntentsResponse\x12\x15\x45xportIntentsMetadata\x82\xd3\xe4\x93\x02@\";/v3/{parent=projects/*/locations/*/agents/*}/intents:export:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xae\x01\n!com.google.cloud.dialogflow.cx.v3B\x0bIntentProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.dialogflow.cx.v3.InlineSource", "google/cloud/dialogflow/cx/v3/inline.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + Intent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Intent").msgclass + Intent::TrainingPhrase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase").msgclass + Intent::TrainingPhrase::Part = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part").msgclass + Intent::Parameter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Intent.Parameter").msgclass + ListIntentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListIntentsRequest").msgclass + ListIntentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListIntentsResponse").msgclass + GetIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetIntentRequest").msgclass + CreateIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateIntentRequest").msgclass + UpdateIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateIntentRequest").msgclass + DeleteIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteIntentRequest").msgclass + ImportIntentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportIntentsRequest").msgclass + ImportIntentsRequest::MergeOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportIntentsRequest.MergeOption").enummodule + ImportIntentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportIntentsResponse").msgclass + ImportIntentsResponse::ConflictingResources = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources").msgclass + ImportIntentsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportIntentsMetadata").msgclass + ExportIntentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportIntentsRequest").msgclass + ExportIntentsRequest::DataFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportIntentsRequest.DataFormat").enummodule + ExportIntentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportIntentsResponse").msgclass + ExportIntentsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportIntentsMetadata").msgclass + IntentView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.IntentView").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intent_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intent_services_pb.rb new file mode 100644 index 000000000000..e138edac0379 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intent_services_pb.rb @@ -0,0 +1,89 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/cx/v3/intent.proto for package 'Google.Cloud.Dialogflow.CX.V3' +# 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/cx/v3/intent_pb' + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Intents + # Service for managing [Intents][google.cloud.dialogflow.cx.v3.Intent]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.cx.v3.Intents' + + # Returns the list of all intents in the specified agent. + rpc :ListIntents, ::Google::Cloud::Dialogflow::CX::V3::ListIntentsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListIntentsResponse + # Retrieves the specified intent. + rpc :GetIntent, ::Google::Cloud::Dialogflow::CX::V3::GetIntentRequest, ::Google::Cloud::Dialogflow::CX::V3::Intent + # Creates an intent in the specified agent. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc :CreateIntent, ::Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest, ::Google::Cloud::Dialogflow::CX::V3::Intent + # Updates the specified intent. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc :UpdateIntent, ::Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest, ::Google::Cloud::Dialogflow::CX::V3::Intent + # Deletes the specified intent. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc :DeleteIntent, ::Google::Cloud::Dialogflow::CX::V3::DeleteIntentRequest, ::Google::Protobuf::Empty + # Imports the specified intents into the agent. + # + # 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`: + # [ImportIntentsMetadata][google.cloud.dialogflow.cx.v3.ImportIntentsMetadata] + # - `response`: + # [ImportIntentsResponse][google.cloud.dialogflow.cx.v3.ImportIntentsResponse] + rpc :ImportIntents, ::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest, ::Google::Longrunning::Operation + # Exports the selected intents. + # + # 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`: + # [ExportIntentsMetadata][google.cloud.dialogflow.cx.v3.ExportIntentsMetadata] + # - `response`: + # [ExportIntentsResponse][google.cloud.dialogflow.cx.v3.ExportIntentsResponse] + rpc :ExportIntents, ::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents.rb new file mode 100644 index 000000000000..e7d896e6dffd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents.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/cx/v3/version" + +require "google/cloud/dialogflow/cx/v3/intents/credentials" +require "google/cloud/dialogflow/cx/v3/intents/paths" +require "google/cloud/dialogflow/cx/v3/intents/operations" +require "google/cloud/dialogflow/cx/v3/intents/client" +require "google/cloud/dialogflow/cx/v3/intents/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Intent Intents}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/cx/v3/intents" + # client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/cx/v3/intents/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new + # + module Intents + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "intents", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/intents/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/client.rb new file mode 100644 index 000000000000..806cd72bd2a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/client.rb @@ -0,0 +1,1221 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/intent_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Intents + ## + # Client for the Intents service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Intents::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Intents clients + # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] + 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::CX::V3::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::CX::V3::Intents::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::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/cx/v3/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::CX::V3::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::CX::V3::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::CX::V3::ListIntentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 for. + # Format: `projects//locations//agents/`. + # @param language_code [::String] + # The language to list intents for. The following fields are language + # dependent: + # + # * `Intent.training_phrases.parts.text` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + # @param intent_view [::Google::Cloud::Dialogflow::CX::V3::IntentView] + # The resource view to apply to the returned intent. + # @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::CX::V3::Intent>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Intent>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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::CX::V3::GetIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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) + # 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//locations//agents//intents/`. + # @param language_code [::String] + # The language to retrieve the intent for. The following fields are language + # dependent: + # + # * `Intent.training_phrases.parts.text` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Intent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetIntentRequest.new + # + # # Call the get_intent method. + # result = client.get_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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 a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload create_intent(request, options = nil) + # Pass arguments to `create_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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) + # 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 an intent for. + # Format: `projects//locations//agents/`. + # @param intent [::Google::Cloud::Dialogflow::CX::V3::Intent, ::Hash] + # Required. The intent to create. + # @param language_code [::String] + # The language of the following fields in `intent`: + # + # * `Intent.training_phrases.parts.text` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Intent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest.new + # + # # Call the create_intent method. + # result = client.create_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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 a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload update_intent(request, options = nil) + # Pass arguments to `update_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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) + # 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::CX::V3::Intent, ::Hash] + # Required. The intent to update. + # @param language_code [::String] + # The language of the following fields in `intent`: + # + # * `Intent.training_phrases.parts.text` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # 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::CX::V3::Intent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest.new + # + # # Call the update_intent method. + # result = client.update_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload delete_intent(request, options = nil) + # Pass arguments to `delete_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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. + # Format: + # `projects//locations//agents//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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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 + + ## + # Imports the specified intents into the agent. + # + # 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::CX::V3::ImportIntentsMetadata ImportIntentsMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::ImportIntentsResponse ImportIntentsResponse} + # + # @overload import_intents(request, options = nil) + # Pass arguments to `import_intents` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_intents(parent: nil, intents_uri: nil, intents_content: nil, merge_option: nil) + # Pass arguments to `import_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 import the intents into. + # Format: `projects//locations//agents/`. + # @param intents_uri [::String] + # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + # to import intents from. The format of this URI must be + # `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: `intents_uri`, `intents_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 intents_content [::Google::Cloud::Dialogflow::CX::V3::InlineSource, ::Hash] + # Uncompressed byte content of intents. + # + # Note: The following parameters are mutually exclusive: `intents_content`, `intents_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 merge_option [::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest::MergeOption] + # Merge option for importing intents. If not specified, `REJECT` is assumed. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest.new + # + # # Call the import_intents method. + # result = client.import_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 import_intents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest + + # Converts hash and nil to 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_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::CX::V3::VERSION + metadata[:"x-goog-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_intents.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_intents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @intents_stub.call_rpc :import_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 + + ## + # Exports the selected intents. + # + # 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::CX::V3::ExportIntentsMetadata ExportIntentsMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::ExportIntentsResponse ExportIntentsResponse} + # + # @overload export_intents(request, options = nil) + # Pass arguments to `export_intents` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_intents(parent: nil, intents: nil, intents_uri: nil, intents_content_inline: nil, data_format: nil) + # Pass arguments to `export_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 parent agent to export intents. + # Format: `projects//locations//agents/`. + # @param intents [::Array<::String>] + # Required. The name of the intents to export. + # Format: + # `projects//locations//agents//intents/`. + # @param intents_uri [::String] + # Optional. The [Google Cloud + # Storage](https://cloud.google.com/storage/docs/) URI to export the + # intents to. The format of this URI must be + # `gs:///`. + # + # 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). + # + # Note: The following parameters are mutually exclusive: `intents_uri`, `intents_content_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 intents_content_inline [::Boolean] + # Optional. The option to return the serialized intents inline. + # + # Note: The following parameters are mutually exclusive: `intents_content_inline`, `intents_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 data_format [::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest::DataFormat] + # Optional. The data format of the exported intents. If not specified, `BLOB` + # is assumed. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest.new + # + # # Call the export_intents method. + # result = client.export_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 export_intents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest + + # Converts hash and nil to 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_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::CX::V3::VERSION + metadata[:"x-goog-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_intents.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_intents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @intents_stub.call_rpc :export_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::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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. + # * `: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. + # * `: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 `import_intents` + # @return [::Gapic::Config::Method] + # + attr_reader :import_intents + ## + # RPC-specific configuration for `export_intents` + # @return [::Gapic::Config::Method] + # + attr_reader :export_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 + import_intents_config = parent_rpcs.import_intents if parent_rpcs.respond_to? :import_intents + @import_intents = ::Gapic::Config::Method.new import_intents_config + export_intents_config = parent_rpcs.export_intents if parent_rpcs.respond_to? :export_intents + @export_intents = ::Gapic::Config::Method.new export_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/credentials.rb new file mode 100644 index 000000000000..17666cab9cb4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/operations.rb new file mode 100644 index 000000000000..adf8fc7869b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/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 CX + module V3 + 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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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. + # * `: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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/paths.rb new file mode 100644 index 000000000000..ccee74067453 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/paths.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + module Intents + # Path helper methods for the Intents API. + module Paths + ## + # Create a fully-qualified Agent resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # + # @return [::String] + def agent_path project:, location:, agent: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}" + end + + ## + # Create a fully-qualified EntityType resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param entity_type [String] + # + # @return [::String] + def entity_type_path project:, location:, agent:, entity_type: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/entityTypes/#{entity_type}" + end + + ## + # Create a fully-qualified Intent resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/intents/{intent}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param intent [String] + # + # @return [::String] + def intent_path project:, location:, agent:, intent: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/intents/#{intent}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest.rb new file mode 100644 index 000000000000..fcdfb8b5fea5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/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/cx/v3/version" +require "google/cloud/dialogflow/cx/v3/bindings_override" + +require "google/cloud/dialogflow/cx/v3/intents/credentials" +require "google/cloud/dialogflow/cx/v3/intents/paths" +require "google/cloud/dialogflow/cx/v3/intents/rest/operations" +require "google/cloud/dialogflow/cx/v3/intents/rest/client" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Intent Intents}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/cx/v3/intents/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new + # + module Intents + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/intents/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb new file mode 100644 index 000000000000..f46dc8ef8223 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb @@ -0,0 +1,1137 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/intent_pb" +require "google/cloud/dialogflow/cx/v3/intents/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Intents + module Rest + ## + # REST client for the Intents service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Intents::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Intents clients + # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] + 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::CX::V3::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::CX::V3::Intents::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::ListIntentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 for. + # Format: `projects//locations//agents/`. + # @param language_code [::String] + # The language to list intents for. The following fields are language + # dependent: + # + # * `Intent.training_phrases.parts.text` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + # @param intent_view [::Google::Cloud::Dialogflow::CX::V3::IntentView] + # The resource view to apply to the returned intent. + # @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::CX::V3::Intent>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Intent>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::GetIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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) + # 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//locations//agents//intents/`. + # @param language_code [::String] + # The language to retrieve the intent for. The following fields are language + # dependent: + # + # * `Intent.training_phrases.parts.text` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Intent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetIntentRequest.new + # + # # Call the get_intent method. + # result = client.get_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload create_intent(request, options = nil) + # Pass arguments to `create_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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) + # 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 an intent for. + # Format: `projects//locations//agents/`. + # @param intent [::Google::Cloud::Dialogflow::CX::V3::Intent, ::Hash] + # Required. The intent to create. + # @param language_code [::String] + # The language of the following fields in `intent`: + # + # * `Intent.training_phrases.parts.text` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Intent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest.new + # + # # Call the create_intent method. + # result = client.create_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload update_intent(request, options = nil) + # Pass arguments to `update_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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) + # 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::CX::V3::Intent, ::Hash] + # Required. The intent to update. + # @param language_code [::String] + # The language of the following fields in `intent`: + # + # * `Intent.training_phrases.parts.text` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # 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::CX::V3::Intent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest.new + # + # # Call the update_intent method. + # result = client.update_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload delete_intent(request, options = nil) + # Pass arguments to `delete_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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. + # Format: + # `projects//locations//agents//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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # Imports the specified intents into the agent. + # + # 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::CX::V3::ImportIntentsMetadata ImportIntentsMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::ImportIntentsResponse ImportIntentsResponse} + # + # @overload import_intents(request, options = nil) + # Pass arguments to `import_intents` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_intents(parent: nil, intents_uri: nil, intents_content: nil, merge_option: nil) + # Pass arguments to `import_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 import the intents into. + # Format: `projects//locations//agents/`. + # @param intents_uri [::String] + # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + # to import intents from. The format of this URI must be + # `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: `intents_uri`, `intents_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 intents_content [::Google::Cloud::Dialogflow::CX::V3::InlineSource, ::Hash] + # Uncompressed byte content of intents. + # + # Note: The following parameters are mutually exclusive: `intents_content`, `intents_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 merge_option [::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest::MergeOption] + # Merge option for importing intents. If not specified, `REJECT` is assumed. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest.new + # + # # Call the import_intents method. + # result = client.import_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 import_intents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest + + # Converts hash and nil to an 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_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_intents.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_intents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @intents_stub.import_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 + + ## + # Exports the selected intents. + # + # 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::CX::V3::ExportIntentsMetadata ExportIntentsMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::ExportIntentsResponse ExportIntentsResponse} + # + # @overload export_intents(request, options = nil) + # Pass arguments to `export_intents` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_intents(parent: nil, intents: nil, intents_uri: nil, intents_content_inline: nil, data_format: nil) + # Pass arguments to `export_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 parent agent to export intents. + # Format: `projects//locations//agents/`. + # @param intents [::Array<::String>] + # Required. The name of the intents to export. + # Format: + # `projects//locations//agents//intents/`. + # @param intents_uri [::String] + # Optional. The [Google Cloud + # Storage](https://cloud.google.com/storage/docs/) URI to export the + # intents to. The format of this URI must be + # `gs:///`. + # + # 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). + # + # Note: The following parameters are mutually exclusive: `intents_uri`, `intents_content_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 intents_content_inline [::Boolean] + # Optional. The option to return the serialized intents inline. + # + # Note: The following parameters are mutually exclusive: `intents_content_inline`, `intents_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 data_format [::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest::DataFormat] + # Optional. The data format of the exported intents. If not specified, `BLOB` + # is assumed. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest.new + # + # # Call the export_intents method. + # result = client.export_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 export_intents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest + + # Converts hash and nil to an 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_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_intents.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_intents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @intents_stub.export_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::CX::V3::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::CX::V3::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::CX::V3::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. + # * `: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. + # * `: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 `import_intents` + # @return [::Gapic::Config::Method] + # + attr_reader :import_intents + ## + # RPC-specific configuration for `export_intents` + # @return [::Gapic::Config::Method] + # + attr_reader :export_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 + import_intents_config = parent_rpcs.import_intents if parent_rpcs.respond_to? :import_intents + @import_intents = ::Gapic::Config::Method.new import_intents_config + export_intents_config = parent_rpcs.export_intents if parent_rpcs.respond_to? :export_intents + @export_intents = ::Gapic::Config::Method.new export_intents_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/operations.rb new file mode 100644 index 000000000000..819f9b26d6e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/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 CX + module V3 + 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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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. + # * `: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: "/v3/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{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: "/v3/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb new file mode 100644 index 000000000000..0025171de07b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb @@ -0,0 +1,514 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/intent_pb" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + 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::CX::V3::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::CX::V3::ListIntentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::Intent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::Intent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::Intent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 import_intents REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_intents request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_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: "import_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 export_intents REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_intents request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_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: "export_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::CX::V3::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: "/v3/{parent}/intents", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_intent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/intents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_intent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{parent}/intents", + body: "intent", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_intent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{intent.name}", + body: "intent", + matches: [ + ["intent.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/intents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_intent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/intents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_intents REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest] + # 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_intents_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/intents:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_intents REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest] + # 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_intents_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/intents:export", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/page_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/page_pb.rb new file mode 100644 index 000000000000..1ae09710a286 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/page_pb.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/page.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/cx/v3/advanced_settings_pb' +require 'google/cloud/dialogflow/cx/v3/data_store_connection_pb' +require 'google/cloud/dialogflow/cx/v3/fulfillment_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n(google/cloud/dialogflow/cx/v3/page.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/advanced_settings.proto\x1a\x39google/cloud/dialogflow/cx/v3/data_store_connection.proto\x1a/google/cloud/dialogflow/cx/v3/fulfillment.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xcd\x05\n\x04Page\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x13 \x01(\t\x12\x45\n\x11\x65ntry_fulfillment\x18\x07 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.Fulfillment\x12\x31\n\x04\x66orm\x18\x04 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.Form\x12T\n\x17transition_route_groups\x18\x0b \x03(\tB3\xfa\x41\x30\n.dialogflow.googleapis.com/TransitionRouteGroup\x12I\n\x11transition_routes\x18\t \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.TransitionRoute\x12\x43\n\x0e\x65vent_handlers\x18\n \x03(\x0b\x32+.google.cloud.dialogflow.cx.v3.EventHandler\x12J\n\x11\x61\x64vanced_settings\x18\r \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x12\x64\n\x1cknowledge_connector_settings\x18\x12 \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettingsB\x03\xe0\x41\x01:u\xea\x41r\n\x1e\x64ialogflow.googleapis.com/Page\x12Pprojects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}\"\xef\x04\n\x04\x46orm\x12\x41\n\nparameters\x18\x01 \x03(\x0b\x32-.google.cloud.dialogflow.cx.v3.Form.Parameter\x1a\xa3\x04\n\tParameter\x12\x19\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x08required\x18\x02 \x01(\x08\x12\x41\n\x0b\x65ntity_type\x18\x03 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/EntityType\x12\x0f\n\x07is_list\x18\x04 \x01(\x08\x12V\n\rfill_behavior\x18\x07 \x01(\x0b\x32:.google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehaviorB\x03\xe0\x41\x02\x12-\n\rdefault_value\x18\t \x01(\x0b\x32\x16.google.protobuf.Value\x12\x0e\n\x06redact\x18\x0b \x01(\x08\x12J\n\x11\x61\x64vanced_settings\x18\x0c \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x1a\xb1\x01\n\x0c\x46illBehavior\x12S\n\x1ainitial_prompt_fulfillment\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.FulfillmentB\x03\xe0\x41\x02\x12L\n\x17reprompt_event_handlers\x18\x05 \x03(\x0b\x32+.google.cloud.dialogflow.cx.v3.EventHandler\"\xc4\x02\n\x0c\x45ventHandler\x12\x11\n\x04name\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05\x65vent\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12G\n\x13trigger_fulfillment\x18\x05 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.Fulfillment\x12:\n\x0btarget_page\x18\x02 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/PageH\x00\x12:\n\x0btarget_flow\x18\x03 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/FlowH\x00\x12\x42\n\x0ftarget_playbook\x18\x07 \x01(\tB\'\xfa\x41$\n\"dialogflow.googleapis.com/PlaybookH\x00\x42\x08\n\x06target\"\xd3\x02\n\x0fTransitionRoute\x12\x11\n\x04name\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12\x35\n\x06intent\x18\x01 \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/Intent\x12\x11\n\tcondition\x18\x02 \x01(\t\x12G\n\x13trigger_fulfillment\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.Fulfillment\x12:\n\x0btarget_page\x18\x04 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/PageH\x00\x12:\n\x0btarget_flow\x18\x05 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/FlowH\x00\x42\x08\n\x06target\"\x88\x01\n\x10ListPagesRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Page\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"`\n\x11ListPagesResponse\x12\x32\n\x05pages\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.cx.v3.Page\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"]\n\x0eGetPageRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Page\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\x9a\x01\n\x11\x43reatePageRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Page\x12\x36\n\x04page\x18\x02 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.PageB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"\x93\x01\n\x11UpdatePageRequest\x12\x36\n\x04page\x18\x01 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.PageB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"X\n\x11\x44\x65letePageRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Page\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\"\xd1\x02\n\x1aKnowledgeConnectorSettings\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12G\n\x13trigger_fulfillment\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.Fulfillment\x12:\n\x0btarget_page\x18\x04 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/PageH\x00\x12:\n\x0btarget_flow\x18\x05 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/FlowH\x00\x12W\n\x16\x64\x61ta_store_connections\x18\x06 \x03(\x0b\x32\x32.google.cloud.dialogflow.cx.v3.DataStoreConnectionB\x03\xe0\x41\x01\x42\x08\n\x06target2\x94\x08\n\x05Pages\x12\xbb\x01\n\tListPages\x12/.google.cloud.dialogflow.cx.v3.ListPagesRequest\x1a\x30.google.cloud.dialogflow.cx.v3.ListPagesResponse\"K\xda\x41\x06parent\x82\xd3\xe4\x93\x02<\x12:/v3/{parent=projects/*/locations/*/agents/*/flows/*}/pages\x12\xa8\x01\n\x07GetPage\x12-.google.cloud.dialogflow.cx.v3.GetPageRequest\x1a#.google.cloud.dialogflow.cx.v3.Page\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\x12:/v3/{name=projects/*/locations/*/agents/*/flows/*/pages/*}\x12\xbb\x01\n\nCreatePage\x12\x30.google.cloud.dialogflow.cx.v3.CreatePageRequest\x1a#.google.cloud.dialogflow.cx.v3.Page\"V\xda\x41\x0bparent,page\x82\xd3\xe4\x93\x02\x42\":/v3/{parent=projects/*/locations/*/agents/*/flows/*}/pages:\x04page\x12\xc5\x01\n\nUpdatePage\x12\x30.google.cloud.dialogflow.cx.v3.UpdatePageRequest\x1a#.google.cloud.dialogflow.cx.v3.Page\"`\xda\x41\x10page,update_mask\x82\xd3\xe4\x93\x02G2?/v3/{page.name=projects/*/locations/*/agents/*/flows/*/pages/*}:\x04page\x12\xa1\x01\n\nDeletePage\x12\x30.google.cloud.dialogflow.cx.v3.DeletePageRequest\x1a\x16.google.protobuf.Empty\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<*:/v3/{name=projects/*/locations/*/agents/*/flows/*/pages/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xac\x01\n!com.google.cloud.dialogflow.cx.v3B\tPageProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.dialogflow.cx.v3.Fulfillment", "google/cloud/dialogflow/cx/v3/fulfillment.proto"], + ["google.cloud.dialogflow.cx.v3.AdvancedSettings", "google/cloud/dialogflow/cx/v3/advanced_settings.proto"], + ["google.protobuf.Value", "google/protobuf/struct.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.dialogflow.cx.v3.DataStoreConnection", "google/cloud/dialogflow/cx/v3/data_store_connection.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + Page = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Page").msgclass + Form = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Form").msgclass + Form::Parameter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Form.Parameter").msgclass + Form::Parameter::FillBehavior = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior").msgclass + EventHandler = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.EventHandler").msgclass + TransitionRoute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TransitionRoute").msgclass + ListPagesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListPagesRequest").msgclass + ListPagesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListPagesResponse").msgclass + GetPageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetPageRequest").msgclass + CreatePageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreatePageRequest").msgclass + UpdatePageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdatePageRequest").msgclass + DeletePageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeletePageRequest").msgclass + KnowledgeConnectorSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/page_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/page_services_pb.rb new file mode 100644 index 000000000000..07d7822faa9c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/page_services_pb.rb @@ -0,0 +1,67 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/cx/v3/page.proto for package 'Google.Cloud.Dialogflow.CX.V3' +# 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/cx/v3/page_pb' + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Pages + # Service for managing [Pages][google.cloud.dialogflow.cx.v3.Page]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.cx.v3.Pages' + + # Returns the list of all pages in the specified flow. + rpc :ListPages, ::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest, ::Google::Cloud::Dialogflow::CX::V3::ListPagesResponse + # Retrieves the specified page. + rpc :GetPage, ::Google::Cloud::Dialogflow::CX::V3::GetPageRequest, ::Google::Cloud::Dialogflow::CX::V3::Page + # Creates a page in the specified flow. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc :CreatePage, ::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest, ::Google::Cloud::Dialogflow::CX::V3::Page + # Updates the specified page. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc :UpdatePage, ::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest, ::Google::Cloud::Dialogflow::CX::V3::Page + # Deletes the specified page. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc :DeletePage, ::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages.rb new file mode 100644 index 000000000000..024ce1d207ec --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages.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/cx/v3/version" + +require "google/cloud/dialogflow/cx/v3/pages/credentials" +require "google/cloud/dialogflow/cx/v3/pages/paths" +require "google/cloud/dialogflow/cx/v3/pages/client" +require "google/cloud/dialogflow/cx/v3/pages/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Page Pages}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/cx/v3/pages" + # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/cx/v3/pages/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new + # + module Pages + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "pages", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/pages/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/client.rb new file mode 100644 index 000000000000..92a5b764207a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/client.rb @@ -0,0 +1,998 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/page_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Pages + ## + # Client for the Pages service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Page Pages}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :pages_stub + + ## + # Configure the Pages Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::Pages::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Pages clients + # ::Google::Cloud::Dialogflow::CX::V3::Pages::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", "CX", "V3"] + 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 Pages 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::CX::V3::Pages::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 + @pages_stub.universe_domain + end + + ## + # Create a new Pages client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Pages 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/cx/v3/page_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 + + @pages_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::CX::V3::Pages::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 + ) + + @pages_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 = @pages_stub.endpoint + config.universe_domain = @pages_stub.universe_domain + config.logger = @pages_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 + @pages_stub.logger + end + + # Service calls + + ## + # Returns the list of all pages in the specified flow. + # + # @overload list_pages(request, options = nil) + # Pass arguments to `list_pages` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pages(parent: nil, language_code: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_pages` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The flow to list all pages for. + # Format: + # `projects//locations//agents//flows/`. + # @param language_code [::String] + # The language to list pages for. The following fields are language + # dependent: + # + # * `Page.entry_fulfillment.messages` + # * `Page.entry_fulfillment.conditional_cases` + # * `Page.event_handlers.trigger_fulfillment.messages` + # * `Page.event_handlers.trigger_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + # * + # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + # * + # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + # * `Page.transition_routes.trigger_fulfillment.messages` + # * `Page.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + # @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::CX::V3::Page>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Page>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListPagesRequest.new + # + # # Call the list_pages method. + # result = client.list_pages request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Page. + # p item + # end + # + def list_pages request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest + + # Converts hash and nil to 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_pages.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_pages.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_pages.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pages_stub.call_rpc :list_pages, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @pages_stub, :list_pages, 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 page. + # + # @overload get_page(request, options = nil) + # Pass arguments to `get_page` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetPageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetPageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_page(name: nil, language_code: nil) + # Pass arguments to `get_page` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 page. + # Format: + # `projects//locations//agents//flows//pages/`. + # @param language_code [::String] + # The language to retrieve the page for. The following fields are language + # dependent: + # + # * `Page.entry_fulfillment.messages` + # * `Page.entry_fulfillment.conditional_cases` + # * `Page.event_handlers.trigger_fulfillment.messages` + # * `Page.event_handlers.trigger_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + # * + # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + # * + # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + # * `Page.transition_routes.trigger_fulfillment.messages` + # * `Page.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Page] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Page] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetPageRequest.new + # + # # Call the get_page method. + # result = client.get_page request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. + # p result + # + def get_page request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetPageRequest + + # Converts hash and nil to 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_page.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_page.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_page.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pages_stub.call_rpc :get_page, request, 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 page in the specified flow. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload create_page(request, options = nil) + # Pass arguments to `create_page` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_page(parent: nil, page: nil, language_code: nil) + # Pass arguments to `create_page` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The flow to create a page for. + # Format: + # `projects//locations//agents//flows/`. + # @param page [::Google::Cloud::Dialogflow::CX::V3::Page, ::Hash] + # Required. The page to create. + # @param language_code [::String] + # The language of the following fields in `page`: + # + # * `Page.entry_fulfillment.messages` + # * `Page.entry_fulfillment.conditional_cases` + # * `Page.event_handlers.trigger_fulfillment.messages` + # * `Page.event_handlers.trigger_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + # * + # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + # * + # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + # * `Page.transition_routes.trigger_fulfillment.messages` + # * `Page.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Page] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Page] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreatePageRequest.new + # + # # Call the create_page method. + # result = client.create_page request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. + # p result + # + def create_page request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest + + # Converts hash and nil to 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_page.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_page.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_page.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pages_stub.call_rpc :create_page, request, 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 page. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload update_page(request, options = nil) + # Pass arguments to `update_page` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_page(page: nil, language_code: nil, update_mask: nil) + # Pass arguments to `update_page` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param page [::Google::Cloud::Dialogflow::CX::V3::Page, ::Hash] + # Required. The page to update. + # @param language_code [::String] + # The language of the following fields in `page`: + # + # * `Page.entry_fulfillment.messages` + # * `Page.entry_fulfillment.conditional_cases` + # * `Page.event_handlers.trigger_fulfillment.messages` + # * `Page.event_handlers.trigger_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + # * + # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + # * + # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + # * `Page.transition_routes.trigger_fulfillment.messages` + # * `Page.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # 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::CX::V3::Page] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Page] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest.new + # + # # Call the update_page method. + # result = client.update_page request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. + # p result + # + def update_page request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest + + # Converts hash and nil to 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_page.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.page&.name + header_params["page.name"] = request.page.name + end + + request_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_page.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_page.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pages_stub.call_rpc :update_page, request, 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 page. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload delete_page(request, options = nil) + # Pass arguments to `delete_page` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_page(name: nil, force: nil) + # Pass arguments to `delete_page` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 page to delete. + # Format: + # `projects//locations//agents//Flows//pages/`. + # @param force [::Boolean] + # This field has no effect for pages with no incoming transitions. + # For pages with incoming transitions: + # + # * If `force` is set to false, an error will be returned with message + # indicating the incoming transitions. + # * If `force` is set to true, Dialogflow will remove the page, as well as + # any transitions to the page (i.e. [Target + # page][EventHandler.target_page] in event handlers or [Target + # page][TransitionRoute.target_page] in transition routes that point to + # this page will be cleared). + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeletePageRequest.new + # + # # Call the delete_page method. + # result = client.delete_page request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_page request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest + + # Converts hash and nil to 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_page.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_page.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_page.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pages_stub.call_rpc :delete_page, request, 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 Pages API. + # + # This class represents the configuration for Pages, + # 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::CX::V3::Pages::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_pages to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_pages.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_pages.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::CX::V3::Pages::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 Pages API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_pages` + # @return [::Gapic::Config::Method] + # + attr_reader :list_pages + ## + # RPC-specific configuration for `get_page` + # @return [::Gapic::Config::Method] + # + attr_reader :get_page + ## + # RPC-specific configuration for `create_page` + # @return [::Gapic::Config::Method] + # + attr_reader :create_page + ## + # RPC-specific configuration for `update_page` + # @return [::Gapic::Config::Method] + # + attr_reader :update_page + ## + # RPC-specific configuration for `delete_page` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_page + + # @private + def initialize parent_rpcs = nil + list_pages_config = parent_rpcs.list_pages if parent_rpcs.respond_to? :list_pages + @list_pages = ::Gapic::Config::Method.new list_pages_config + get_page_config = parent_rpcs.get_page if parent_rpcs.respond_to? :get_page + @get_page = ::Gapic::Config::Method.new get_page_config + create_page_config = parent_rpcs.create_page if parent_rpcs.respond_to? :create_page + @create_page = ::Gapic::Config::Method.new create_page_config + update_page_config = parent_rpcs.update_page if parent_rpcs.respond_to? :update_page + @update_page = ::Gapic::Config::Method.new update_page_config + delete_page_config = parent_rpcs.delete_page if parent_rpcs.respond_to? :delete_page + @delete_page = ::Gapic::Config::Method.new delete_page_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/credentials.rb new file mode 100644 index 000000000000..09a036378445 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Pages + # Credentials for the Pages 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/paths.rb new file mode 100644 index 000000000000..802e31a05a7e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/paths.rb @@ -0,0 +1,254 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + module Pages + # Path helper methods for the Pages API. + module Paths + ## + # Create a fully-qualified EntityType resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param entity_type [String] + # + # @return [::String] + def entity_type_path project:, location:, agent:, entity_type: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/entityTypes/#{entity_type}" + end + + ## + # Create a fully-qualified Flow resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # + # @return [::String] + def flow_path project:, location:, agent:, flow: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}" + end + + ## + # Create a fully-qualified Generator resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/generators/{generator}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param generator [String] + # + # @return [::String] + def generator_path project:, location:, agent:, generator: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/generators/#{generator}" + end + + ## + # Create a fully-qualified Intent resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/intents/{intent}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param intent [String] + # + # @return [::String] + def intent_path project:, location:, agent:, intent: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/intents/#{intent}" + end + + ## + # Create a fully-qualified Page resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # @param page [String] + # + # @return [::String] + def page_path project:, location:, agent:, flow:, page: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/pages/#{page}" + end + + ## + # Create a fully-qualified Playbook resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param playbook [String] + # + # @return [::String] + def playbook_path project:, location:, agent:, playbook: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}" + end + + ## + # Create a fully-qualified Tool resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param tool [String] + # + # @return [::String] + def tool_path project:, location:, agent:, tool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/tools/#{tool}" + end + + ## + # Create a fully-qualified TransitionRouteGroup resource string. + # + # @overload transition_route_group_path(project:, location:, agent:, flow:, transition_route_group:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # @param transition_route_group [String] + # + # @overload transition_route_group_path(project:, location:, agent:, transition_route_group:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param transition_route_group [String] + # + # @return [::String] + def transition_route_group_path **args + resources = { + "agent:flow:location:project:transition_route_group" => (proc do |project:, location:, agent:, flow:, transition_route_group:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/transitionRouteGroups/#{transition_route_group}" + end), + "agent:location:project:transition_route_group" => (proc do |project:, location:, agent:, transition_route_group:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/transitionRouteGroups/#{transition_route_group}" + 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 Webhook resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param webhook [String] + # + # @return [::String] + def webhook_path project:, location:, agent:, webhook: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/webhooks/#{webhook}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest.rb new file mode 100644 index 000000000000..9964ecb67288 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/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/cx/v3/version" +require "google/cloud/dialogflow/cx/v3/bindings_override" + +require "google/cloud/dialogflow/cx/v3/pages/credentials" +require "google/cloud/dialogflow/cx/v3/pages/paths" +require "google/cloud/dialogflow/cx/v3/pages/rest/client" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Page Pages}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/cx/v3/pages/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new + # + module Pages + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/pages/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb new file mode 100644 index 000000000000..18ea3b406063 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb @@ -0,0 +1,928 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/page_pb" +require "google/cloud/dialogflow/cx/v3/pages/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Pages + module Rest + ## + # REST client for the Pages service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Page Pages}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :pages_stub + + ## + # Configure the Pages Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Pages clients + # ::Google::Cloud::Dialogflow::CX::V3::Pages::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", "CX", "V3"] + 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 Pages 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::CX::V3::Pages::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 + @pages_stub.universe_domain + end + + ## + # Create a new Pages REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Pages 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 + + @pages_stub = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @pages_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 = @pages_stub.endpoint + config.universe_domain = @pages_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @pages_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 + @pages_stub.logger + end + + # Service calls + + ## + # Returns the list of all pages in the specified flow. + # + # @overload list_pages(request, options = nil) + # Pass arguments to `list_pages` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pages(parent: nil, language_code: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_pages` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The flow to list all pages for. + # Format: + # `projects//locations//agents//flows/`. + # @param language_code [::String] + # The language to list pages for. The following fields are language + # dependent: + # + # * `Page.entry_fulfillment.messages` + # * `Page.entry_fulfillment.conditional_cases` + # * `Page.event_handlers.trigger_fulfillment.messages` + # * `Page.event_handlers.trigger_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + # * + # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + # * + # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + # * `Page.transition_routes.trigger_fulfillment.messages` + # * `Page.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + # @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::CX::V3::Page>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Page>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListPagesRequest.new + # + # # Call the list_pages method. + # result = client.list_pages request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Page. + # p item + # end + # + def list_pages request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest + + # Converts hash and nil to an 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_pages.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_pages.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_pages.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pages_stub.list_pages request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @pages_stub, :list_pages, "pages", 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 page. + # + # @overload get_page(request, options = nil) + # Pass arguments to `get_page` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetPageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetPageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_page(name: nil, language_code: nil) + # Pass arguments to `get_page` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 page. + # Format: + # `projects//locations//agents//flows//pages/`. + # @param language_code [::String] + # The language to retrieve the page for. The following fields are language + # dependent: + # + # * `Page.entry_fulfillment.messages` + # * `Page.entry_fulfillment.conditional_cases` + # * `Page.event_handlers.trigger_fulfillment.messages` + # * `Page.event_handlers.trigger_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + # * + # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + # * + # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + # * `Page.transition_routes.trigger_fulfillment.messages` + # * `Page.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Page] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Page] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetPageRequest.new + # + # # Call the get_page method. + # result = client.get_page request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. + # p result + # + def get_page request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetPageRequest + + # Converts hash and nil to an 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_page.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_page.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_page.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pages_stub.get_page request, 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 page in the specified flow. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload create_page(request, options = nil) + # Pass arguments to `create_page` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_page(parent: nil, page: nil, language_code: nil) + # Pass arguments to `create_page` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The flow to create a page for. + # Format: + # `projects//locations//agents//flows/`. + # @param page [::Google::Cloud::Dialogflow::CX::V3::Page, ::Hash] + # Required. The page to create. + # @param language_code [::String] + # The language of the following fields in `page`: + # + # * `Page.entry_fulfillment.messages` + # * `Page.entry_fulfillment.conditional_cases` + # * `Page.event_handlers.trigger_fulfillment.messages` + # * `Page.event_handlers.trigger_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + # * + # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + # * + # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + # * `Page.transition_routes.trigger_fulfillment.messages` + # * `Page.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Page] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Page] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreatePageRequest.new + # + # # Call the create_page method. + # result = client.create_page request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. + # p result + # + def create_page request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest + + # Converts hash and nil to an 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_page.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_page.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_page.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pages_stub.create_page request, 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 page. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload update_page(request, options = nil) + # Pass arguments to `update_page` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_page(page: nil, language_code: nil, update_mask: nil) + # Pass arguments to `update_page` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param page [::Google::Cloud::Dialogflow::CX::V3::Page, ::Hash] + # Required. The page to update. + # @param language_code [::String] + # The language of the following fields in `page`: + # + # * `Page.entry_fulfillment.messages` + # * `Page.entry_fulfillment.conditional_cases` + # * `Page.event_handlers.trigger_fulfillment.messages` + # * `Page.event_handlers.trigger_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + # * + # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + # * + # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + # * `Page.transition_routes.trigger_fulfillment.messages` + # * `Page.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # 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::CX::V3::Page] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Page] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest.new + # + # # Call the update_page method. + # result = client.update_page request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. + # p result + # + def update_page request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest + + # Converts hash and nil to an 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_page.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_page.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_page.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pages_stub.update_page request, 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 page. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload delete_page(request, options = nil) + # Pass arguments to `delete_page` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_page(name: nil, force: nil) + # Pass arguments to `delete_page` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 page to delete. + # Format: + # `projects//locations//agents//Flows//pages/`. + # @param force [::Boolean] + # This field has no effect for pages with no incoming transitions. + # For pages with incoming transitions: + # + # * If `force` is set to false, an error will be returned with message + # indicating the incoming transitions. + # * If `force` is set to true, Dialogflow will remove the page, as well as + # any transitions to the page (i.e. [Target + # page][EventHandler.target_page] in event handlers or [Target + # page][TransitionRoute.target_page] in transition routes that point to + # this page will be cleared). + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeletePageRequest.new + # + # # Call the delete_page method. + # result = client.delete_page request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_page request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest + + # Converts hash and nil to an 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_page.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_page.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_page.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pages_stub.delete_page request, 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 Pages REST API. + # + # This class represents the configuration for Pages 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::CX::V3::Pages::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_pages to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_pages.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_pages.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 Pages API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_pages` + # @return [::Gapic::Config::Method] + # + attr_reader :list_pages + ## + # RPC-specific configuration for `get_page` + # @return [::Gapic::Config::Method] + # + attr_reader :get_page + ## + # RPC-specific configuration for `create_page` + # @return [::Gapic::Config::Method] + # + attr_reader :create_page + ## + # RPC-specific configuration for `update_page` + # @return [::Gapic::Config::Method] + # + attr_reader :update_page + ## + # RPC-specific configuration for `delete_page` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_page + + # @private + def initialize parent_rpcs = nil + list_pages_config = parent_rpcs.list_pages if parent_rpcs.respond_to? :list_pages + @list_pages = ::Gapic::Config::Method.new list_pages_config + get_page_config = parent_rpcs.get_page if parent_rpcs.respond_to? :get_page + @get_page = ::Gapic::Config::Method.new get_page_config + create_page_config = parent_rpcs.create_page if parent_rpcs.respond_to? :create_page + @create_page = ::Gapic::Config::Method.new create_page_config + update_page_config = parent_rpcs.update_page if parent_rpcs.respond_to? :update_page + @update_page = ::Gapic::Config::Method.new update_page_config + delete_page_config = parent_rpcs.delete_page if parent_rpcs.respond_to? :delete_page + @delete_page = ::Gapic::Config::Method.new delete_page_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb new file mode 100644 index 000000000000..36af238bdcd3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb @@ -0,0 +1,390 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/page_pb" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Pages + module Rest + ## + # REST service stub for the Pages 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_pages REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::ListPagesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ListPagesResponse] + # A result object deserialized from the server's reply + def list_pages request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_pages_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_pages", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::ListPagesResponse.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_page REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetPageRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Page] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Page] + # A result object deserialized from the server's reply + def get_page request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_page_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_page", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Page.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_page REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Page] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Page] + # A result object deserialized from the server's reply + def create_page request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_page_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_page", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Page.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_page REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Page] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Page] + # A result object deserialized from the server's reply + def update_page request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_page_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_page", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Page.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_page REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_page request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_page_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_page", + 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_pages REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest] + # 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_pages_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/pages", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_page REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetPageRequest] + # 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_page_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/pages/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_page REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest] + # 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_page_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/pages", + body: "page", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_page REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest] + # 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_page_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v3/{page.name}", + body: "page", + matches: [ + ["page.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/pages/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_page REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest] + # 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_page_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/pages/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/parameter_definition_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/parameter_definition_pb.rb new file mode 100644 index 000000000000..70ae138b1bfc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/parameter_definition_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/parameter_definition.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n8google/cloud/dialogflow/cx/v3/parameter_definition.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\"\xcc\x02\n\x13ParameterDefinition\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12R\n\x04type\x18\x02 \x01(\x0e\x32@.google.cloud.dialogflow.cx.v3.ParameterDefinition.ParameterTypeB\x02\x18\x01\x12\x43\n\x0btype_schema\x18\x04 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.TypeSchemaB\x03\xe0\x41\x01\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\"t\n\rParameterType\x12\x1e\n\x1aPARAMETER_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06STRING\x10\x01\x12\n\n\x06NUMBER\x10\x02\x12\x0b\n\x07\x42OOLEAN\x10\x03\x12\x08\n\x04NULL\x10\x04\x12\n\n\x06OBJECT\x10\x05\x12\x08\n\x04LIST\x10\x06\"\xe4\x01\n\nTypeSchema\x12\x44\n\rinline_schema\x18\x01 \x01(\x0b\x32+.google.cloud.dialogflow.cx.v3.InlineSchemaH\x00\x12U\n\x10schema_reference\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReferenceH\x00\x1a/\n\x0fSchemaReference\x12\x0c\n\x04tool\x18\x01 \x01(\t\x12\x0e\n\x06schema\x18\x02 \x01(\tB\x08\n\x06schema\"\x7f\n\x0cInlineSchema\x12\x35\n\x04type\x18\x01 \x01(\x0e\x32\'.google.cloud.dialogflow.cx.v3.DataType\x12\x38\n\x05items\x18\x02 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.TypeSchema*U\n\x08\x44\x61taType\x12\x19\n\x15\x44\x41TA_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06STRING\x10\x01\x12\n\n\x06NUMBER\x10\x02\x12\x0b\n\x07\x42OOLEAN\x10\x03\x12\t\n\x05\x41RRAY\x10\x06\x42r\n!com.google.cloud.dialogflow.cx.v3B\x18ParameterDefinitionProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpbb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module Cx + module V3 + ParameterDefinition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ParameterDefinition").msgclass + ParameterDefinition::ParameterType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ParameterDefinition.ParameterType").enummodule + TypeSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TypeSchema").msgclass + TypeSchema::SchemaReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TypeSchema.SchemaReference").msgclass + InlineSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.InlineSchema").msgclass + DataType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataType").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbook_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbook_pb.rb new file mode 100644 index 000000000000..3caf3bc0659e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbook_pb.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/playbook.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/cx/v3/code_block_pb' +require 'google/cloud/dialogflow/cx/v3/example_pb' +require 'google/cloud/dialogflow/cx/v3/fulfillment_pb' +require 'google/cloud/dialogflow/cx/v3/generative_settings_pb' +require 'google/cloud/dialogflow/cx/v3/import_strategy_pb' +require 'google/cloud/dialogflow/cx/v3/parameter_definition_pb' +require 'google/longrunning/operations_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/cx/v3/playbook.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/code_block.proto\x1a+google/cloud/dialogflow/cx/v3/example.proto\x1a/google/cloud/dialogflow/cx/v3/fulfillment.proto\x1a\x37google/cloud/dialogflow/cx/v3/generative_settings.proto\x1a\x33google/cloud/dialogflow/cx/v3/import_strategy.proto\x1a\x38google/cloud/dialogflow/cx/v3/parameter_definition.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x93\x01\n\x15\x43reatePlaybookRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/Playbook\x12>\n\x08playbook\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.cx.v3.PlaybookB\x03\xe0\x41\x02\"Q\n\x15\x44\x65letePlaybookRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/Playbook\"y\n\x14ListPlaybooksRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/Playbook\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"l\n\x15ListPlaybooksResponse\x12:\n\tplaybooks\x18\x01 \x03(\x0b\x32\'.google.cloud.dialogflow.cx.v3.Playbook\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"N\n\x12GetPlaybookRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/Playbook\"\x88\x01\n\x15UpdatePlaybookRequest\x12>\n\x08playbook\x18\x01 \x01(\x0b\x32\'.google.cloud.dialogflow.cx.v3.PlaybookB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xe7\n\n\x08Playbook\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04goal\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\\\n\x1binput_parameter_definitions\x18\x05 \x03(\x0b\x32\x32.google.cloud.dialogflow.cx.v3.ParameterDefinitionB\x03\xe0\x41\x01\x12]\n\x1coutput_parameter_definitions\x18\x06 \x03(\x0b\x32\x32.google.cloud.dialogflow.cx.v3.ParameterDefinitionB\x03\xe0\x41\x01\x12H\n\x0binstruction\x18\x11 \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.Playbook.Instruction\x12\x18\n\x0btoken_count\x18\x08 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12H\n\x14referenced_playbooks\x18\x0b \x03(\tB*\xe0\x41\x03\xfa\x41$\n\"dialogflow.googleapis.com/Playbook\x12@\n\x10referenced_flows\x18\x0c \x03(\tB&\xe0\x41\x03\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12@\n\x10referenced_tools\x18\r \x03(\tB&\xe0\x41\x01\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Tool\x12\x1e\n\x0einline_actions\x18\x16 \x03(\tB\x06\xe0\x41\x01\xe0\x41\x03\x12\x41\n\ncode_block\x18\x15 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.CodeBlockB\x03\xe0\x41\x01\x12P\n\x12llm_model_settings\x18\x0e \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.LlmModelSettingsB\x03\xe0\x41\x01\x12=\n\x08handlers\x18\x10 \x03(\x0b\x32&.google.cloud.dialogflow.cx.v3.HandlerB\x03\xe0\x41\x01\x12P\n\rplaybook_type\x18\x13 \x01(\x0e\x32\x34.google.cloud.dialogflow.cx.v3.Playbook.PlaybookTypeB\x03\xe0\x41\x01\x1a\x62\n\x04Step\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12;\n\x05steps\x18\x02 \x03(\x0b\x32,.google.cloud.dialogflow.cx.v3.Playbook.StepB\r\n\x0binstruction\x1a^\n\x0bInstruction\x12\x12\n\nguidelines\x18\x01 \x01(\t\x12;\n\x05steps\x18\x02 \x03(\x0b\x32,.google.cloud.dialogflow.cx.v3.Playbook.Step\"D\n\x0cPlaybookType\x12\x1d\n\x19PLAYBOOK_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04TASK\x10\x01\x12\x0b\n\x07ROUTINE\x10\x03:t\xea\x41q\n\"dialogflow.googleapis.com/Playbook\x12Kprojects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}\"\xb0\x01\n\x1c\x43reatePlaybookVersionRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\x12)dialogflow.googleapis.com/PlaybookVersion\x12M\n\x10playbook_version\x18\x02 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.PlaybookVersionB\x03\xe0\x41\x02\"\xa3\x03\n\x0fPlaybookVersion\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12>\n\x08playbook\x18\x03 \x01(\x0b\x32\'.google.cloud.dialogflow.cx.v3.PlaybookB\x03\xe0\x41\x03\x12=\n\x08\x65xamples\x18\x04 \x03(\x0b\x32&.google.cloud.dialogflow.cx.v3.ExampleB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:\xb2\x01\xea\x41\xae\x01\n)dialogflow.googleapis.com/PlaybookVersion\x12^projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}*\x10playbookVersions2\x0fplaybookVersion\"\\\n\x19GetPlaybookVersionRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)dialogflow.googleapis.com/PlaybookVersion\"`\n\x1dRestorePlaybookVersionRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)dialogflow.googleapis.com/PlaybookVersion\"[\n\x1eRestorePlaybookVersionResponse\x12\x39\n\x08playbook\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.cx.v3.Playbook\"\x91\x01\n\x1bListPlaybookVersionsRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\x12)dialogflow.googleapis.com/PlaybookVersion\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\"\x82\x01\n\x1cListPlaybookVersionsResponse\x12I\n\x11playbook_versions\x18\x01 \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.PlaybookVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"_\n\x1c\x44\x65letePlaybookVersionRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)dialogflow.googleapis.com/PlaybookVersion\"\x86\x02\n\x15\x45xportPlaybookRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/Playbook\x12\x19\n\x0cplaybook_uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12Y\n\x0b\x64\x61ta_format\x18\x03 \x01(\x0e\x32?.google.cloud.dialogflow.cx.v3.ExportPlaybookRequest.DataFormatB\x03\xe0\x41\x01\"=\n\nDataFormat\x12\x1b\n\x17\x44\x41TA_FORMAT_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42LOB\x10\x01\x12\x08\n\x04JSON\x10\x02\"\xe8\x01\n\x15ImportPlaybookRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/Playbook\x12\x16\n\x0cplaybook_uri\x18\x02 \x01(\tH\x00\x12\x1a\n\x10playbook_content\x18\x03 \x01(\x0cH\x00\x12S\n\x0fimport_strategy\x18\x04 \x01(\x0b\x32\x35.google.cloud.dialogflow.cx.v3.PlaybookImportStrategyB\x03\xe0\x41\x01\x42\n\n\x08playbook\"\xa2\x02\n\x16PlaybookImportStrategy\x12Y\n\x1dmain_playbook_import_strategy\x18\x04 \x01(\x0e\x32-.google.cloud.dialogflow.cx.v3.ImportStrategyB\x03\xe0\x41\x01\x12[\n\x1fnested_resource_import_strategy\x18\x05 \x01(\x0e\x32-.google.cloud.dialogflow.cx.v3.ImportStrategyB\x03\xe0\x41\x01\x12P\n\x14tool_import_strategy\x18\x06 \x01(\x0e\x32-.google.cloud.dialogflow.cx.v3.ImportStrategyB\x03\xe0\x41\x01\"\xbd\x02\n\x16ImportPlaybookResponse\x12\x39\n\x08playbook\x18\x01 \x01(\tB\'\xfa\x41$\n\"dialogflow.googleapis.com/Playbook\x12i\n\x15\x63onflicting_resources\x18\x02 \x01(\x0b\x32J.google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources\x1a}\n\x14\x43onflictingResources\x12\"\n\x1amain_playbook_display_name\x18\x01 \x01(\t\x12%\n\x1dnested_playbook_display_names\x18\x02 \x03(\t\x12\x1a\n\x12tool_display_names\x18\x03 \x03(\t\"X\n\x16\x45xportPlaybookResponse\x12\x16\n\x0cplaybook_uri\x18\x01 \x01(\tH\x00\x12\x1a\n\x10playbook_content\x18\x02 \x01(\x0cH\x00\x42\n\n\x08playbook\"\xcc\x03\n\x07Handler\x12L\n\revent_handler\x18\x01 \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.Handler.EventHandlerH\x00\x12T\n\x11lifecycle_handler\x18\x03 \x01(\x0b\x32\x37.google.cloud.dialogflow.cx.v3.Handler.LifecycleHandlerH\x00\x1a\x80\x01\n\x0c\x45ventHandler\x12\x12\n\x05\x65vent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tcondition\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x44\n\x0b\x66ulfillment\x18\x02 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.FulfillmentB\x03\xe0\x41\x02\x1a\x8e\x01\n\x10LifecycleHandler\x12\x1c\n\x0flifecycle_stage\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tcondition\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x44\n\x0b\x66ulfillment\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.FulfillmentB\x03\xe0\x41\x02\x42\t\n\x07handler2\x87\x15\n\tPlaybooks\x12\xcb\x01\n\x0e\x43reatePlaybook\x12\x34.google.cloud.dialogflow.cx.v3.CreatePlaybookRequest\x1a\'.google.cloud.dialogflow.cx.v3.Playbook\"Z\xda\x41\x0fparent,playbook\x82\xd3\xe4\x93\x02\x42\"6/v3/{parent=projects/*/locations/*/agents/*}/playbooks:\x08playbook\x12\xa5\x01\n\x0e\x44\x65letePlaybook\x12\x34.google.cloud.dialogflow.cx.v3.DeletePlaybookRequest\x1a\x16.google.protobuf.Empty\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38*6/v3/{name=projects/*/locations/*/agents/*/playbooks/*}\x12\xc3\x01\n\rListPlaybooks\x12\x33.google.cloud.dialogflow.cx.v3.ListPlaybooksRequest\x1a\x34.google.cloud.dialogflow.cx.v3.ListPlaybooksResponse\"G\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x38\x12\x36/v3/{parent=projects/*/locations/*/agents/*}/playbooks\x12\xb0\x01\n\x0bGetPlaybook\x12\x31.google.cloud.dialogflow.cx.v3.GetPlaybookRequest\x1a\'.google.cloud.dialogflow.cx.v3.Playbook\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v3/{name=projects/*/locations/*/agents/*/playbooks/*}\x12\xe2\x01\n\x0e\x45xportPlaybook\x12\x34.google.cloud.dialogflow.cx.v3.ExportPlaybookRequest\x1a\x1d.google.longrunning.Operation\"{\xca\x41\x30\n\x16\x45xportPlaybookResponse\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02\x42\"=/v3/{name=projects/*/locations/*/agents/*/playbooks/*}:export:\x01*\x12\xe2\x01\n\x0eImportPlaybook\x12\x34.google.cloud.dialogflow.cx.v3.ImportPlaybookRequest\x1a\x1d.google.longrunning.Operation\"{\xca\x41\x30\n\x16ImportPlaybookResponse\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02\x42\"=/v3/{parent=projects/*/locations/*/agents/*}/playbooks:import:\x01*\x12\xd9\x01\n\x0eUpdatePlaybook\x12\x34.google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest\x1a\'.google.cloud.dialogflow.cx.v3.Playbook\"h\xda\x41\x14playbook,update_mask\x82\xd3\xe4\x93\x02K2?/v3/{playbook.name=projects/*/locations/*/agents/*/playbooks/*}:\x08playbook\x12\xfb\x01\n\x15\x43reatePlaybookVersion\x12;.google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest\x1a..google.cloud.dialogflow.cx.v3.PlaybookVersion\"u\xda\x41\x17parent,playbook_version\x82\xd3\xe4\x93\x02U\"A/v3/{parent=projects/*/locations/*/agents/*/playbooks/*}/versions:\x10playbook_version\x12\xd0\x01\n\x12GetPlaybookVersion\x12\x38.google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest\x1a..google.cloud.dialogflow.cx.v3.PlaybookVersion\"P\xda\x41\x04name\x82\xd3\xe4\x93\x02\x43\x12\x41/v3/{name=projects/*/locations/*/agents/*/playbooks/*/versions/*}\x12\xf2\x01\n\x16RestorePlaybookVersion\x12<.google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest\x1a=.google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse\"[\xda\x41\x04name\x82\xd3\xe4\x93\x02N\"I/v3/{name=projects/*/locations/*/agents/*/playbooks/*/versions/*}:restore:\x01*\x12\xe3\x01\n\x14ListPlaybookVersions\x12:.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest\x1a;.google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse\"R\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x43\x12\x41/v3/{parent=projects/*/locations/*/agents/*/playbooks/*}/versions\x12\xbe\x01\n\x15\x44\x65letePlaybookVersion\x12;.google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest\x1a\x16.google.protobuf.Empty\"P\xda\x41\x04name\x82\xd3\xe4\x93\x02\x43*A/v3/{name=projects/*/locations/*/agents/*/playbooks/*/versions/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x8c\x01\n!com.google.cloud.dialogflow.cx.v3B\rPlaybookProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.dialogflow.cx.v3.ParameterDefinition", "google/cloud/dialogflow/cx/v3/parameter_definition.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.dialogflow.cx.v3.CodeBlock", "google/cloud/dialogflow/cx/v3/code_block.proto"], + ["google.cloud.dialogflow.cx.v3.LlmModelSettings", "google/cloud/dialogflow/cx/v3/generative_settings.proto"], + ["google.cloud.dialogflow.cx.v3.Example", "google/cloud/dialogflow/cx/v3/example.proto"], + ["google.cloud.dialogflow.cx.v3.Fulfillment", "google/cloud/dialogflow/cx/v3/fulfillment.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module Cx + module V3 + CreatePlaybookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreatePlaybookRequest").msgclass + DeletePlaybookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeletePlaybookRequest").msgclass + ListPlaybooksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListPlaybooksRequest").msgclass + ListPlaybooksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListPlaybooksResponse").msgclass + GetPlaybookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetPlaybookRequest").msgclass + UpdatePlaybookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdatePlaybookRequest").msgclass + Playbook = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Playbook").msgclass + Playbook::Step = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Playbook.Step").msgclass + Playbook::Instruction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Playbook.Instruction").msgclass + Playbook::PlaybookType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Playbook.PlaybookType").enummodule + CreatePlaybookVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreatePlaybookVersionRequest").msgclass + PlaybookVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.PlaybookVersion").msgclass + GetPlaybookVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetPlaybookVersionRequest").msgclass + RestorePlaybookVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RestorePlaybookVersionRequest").msgclass + RestorePlaybookVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RestorePlaybookVersionResponse").msgclass + ListPlaybookVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListPlaybookVersionsRequest").msgclass + ListPlaybookVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListPlaybookVersionsResponse").msgclass + DeletePlaybookVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeletePlaybookVersionRequest").msgclass + ExportPlaybookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportPlaybookRequest").msgclass + ExportPlaybookRequest::DataFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportPlaybookRequest.DataFormat").enummodule + ImportPlaybookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportPlaybookRequest").msgclass + PlaybookImportStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.PlaybookImportStrategy").msgclass + ImportPlaybookResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportPlaybookResponse").msgclass + ImportPlaybookResponse::ConflictingResources = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportPlaybookResponse.ConflictingResources").msgclass + ExportPlaybookResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportPlaybookResponse").msgclass + Handler = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Handler").msgclass + Handler::EventHandler = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Handler.EventHandler").msgclass + Handler::LifecycleHandler = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Handler.LifecycleHandler").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbook_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbook_services_pb.rb new file mode 100644 index 000000000000..90adffd709ef --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbook_services_pb.rb @@ -0,0 +1,73 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/cx/v3/playbook.proto for package 'google.cloud.dialogflow.cx.v3' +# 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/cx/v3/playbook_pb' + +module Google + module Cloud + module Dialogflow + module Cx + module V3 + module Playbooks + # Service for managing [Playbooks][google.cloud.dialogflow.cx.v3.Playbook]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.cx.v3.Playbooks' + + # Creates a playbook in a specified agent. + rpc :CreatePlaybook, ::Google::Cloud::Dialogflow::Cx::V3::CreatePlaybookRequest, ::Google::Cloud::Dialogflow::Cx::V3::Playbook + # Deletes a specified playbook. + rpc :DeletePlaybook, ::Google::Cloud::Dialogflow::Cx::V3::DeletePlaybookRequest, ::Google::Protobuf::Empty + # Returns a list of playbooks in the specified agent. + rpc :ListPlaybooks, ::Google::Cloud::Dialogflow::Cx::V3::ListPlaybooksRequest, ::Google::Cloud::Dialogflow::Cx::V3::ListPlaybooksResponse + # Retrieves the specified Playbook. + rpc :GetPlaybook, ::Google::Cloud::Dialogflow::Cx::V3::GetPlaybookRequest, ::Google::Cloud::Dialogflow::Cx::V3::Playbook + # Exports the specified playbook to a binary file. + # + # Note that resources (e.g. examples, tools) that the playbook + # references will also be exported. + rpc :ExportPlaybook, ::Google::Cloud::Dialogflow::Cx::V3::ExportPlaybookRequest, ::Google::Longrunning::Operation + # Imports the specified playbook to the specified agent from a binary file. + rpc :ImportPlaybook, ::Google::Cloud::Dialogflow::Cx::V3::ImportPlaybookRequest, ::Google::Longrunning::Operation + # Updates the specified Playbook. + rpc :UpdatePlaybook, ::Google::Cloud::Dialogflow::Cx::V3::UpdatePlaybookRequest, ::Google::Cloud::Dialogflow::Cx::V3::Playbook + # Creates a version for the specified Playbook. + rpc :CreatePlaybookVersion, ::Google::Cloud::Dialogflow::Cx::V3::CreatePlaybookVersionRequest, ::Google::Cloud::Dialogflow::Cx::V3::PlaybookVersion + # Retrieves the specified version of the Playbook. + rpc :GetPlaybookVersion, ::Google::Cloud::Dialogflow::Cx::V3::GetPlaybookVersionRequest, ::Google::Cloud::Dialogflow::Cx::V3::PlaybookVersion + # Retrieves the specified version of the Playbook and stores it as the + # current playbook draft, returning the playbook with resources updated. + rpc :RestorePlaybookVersion, ::Google::Cloud::Dialogflow::Cx::V3::RestorePlaybookVersionRequest, ::Google::Cloud::Dialogflow::Cx::V3::RestorePlaybookVersionResponse + # Lists versions for the specified Playbook. + rpc :ListPlaybookVersions, ::Google::Cloud::Dialogflow::Cx::V3::ListPlaybookVersionsRequest, ::Google::Cloud::Dialogflow::Cx::V3::ListPlaybookVersionsResponse + # Deletes the specified version of the Playbook. + rpc :DeletePlaybookVersion, ::Google::Cloud::Dialogflow::Cx::V3::DeletePlaybookVersionRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks.rb new file mode 100644 index 000000000000..3bb6aa8d8a27 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks.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/cx/v3/version" + +require "google/cloud/dialogflow/cx/v3/playbooks/credentials" +require "google/cloud/dialogflow/cx/v3/playbooks/paths" +require "google/cloud/dialogflow/cx/v3/playbooks/operations" +require "google/cloud/dialogflow/cx/v3/playbooks/client" +require "google/cloud/dialogflow/cx/v3/playbooks/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Playbook Playbooks}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/cx/v3/playbooks" + # client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/cx/v3/playbooks/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new + # + module Playbooks + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "playbooks", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/playbooks/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/client.rb new file mode 100644 index 000000000000..eb5ab72299d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/client.rb @@ -0,0 +1,1620 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/playbook_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Playbooks + ## + # Client for the Playbooks service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Playbook Playbooks}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :playbooks_stub + + ## + # Configure the Playbooks Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Playbooks clients + # ::Google::Cloud::Dialogflow::CX::V3::Playbooks::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", "CX", "V3"] + 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 Playbooks 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::CX::V3::Playbooks::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 + @playbooks_stub.universe_domain + end + + ## + # Create a new Playbooks client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Playbooks 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/cx/v3/playbook_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 + + @playbooks_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::Cx::V3::Playbooks::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 + ) + + @playbooks_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 = @playbooks_stub.endpoint + config.universe_domain = @playbooks_stub.universe_domain + config.logger = @playbooks_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Playbooks::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 + @playbooks_stub.logger + end + + # Service calls + + ## + # Creates a playbook in a specified agent. + # + # @overload create_playbook(request, options = nil) + # Pass arguments to `create_playbook` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook(parent: nil, playbook: nil) + # Pass arguments to `create_playbook` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 playbook for. + # Format: `projects//locations//agents/`. + # @param playbook [::Google::Cloud::Dialogflow::CX::V3::Playbook, ::Hash] + # Required. The playbook to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Playbook] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Playbook] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreatePlaybookRequest.new + # + # # Call the create_playbook method. + # result = client.create_playbook request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Playbook. + # p result + # + def create_playbook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookRequest + + # Converts hash and nil to 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_playbook.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_playbook.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_playbook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.call_rpc :create_playbook, request, 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 playbook. + # + # @overload delete_playbook(request, options = nil) + # Pass arguments to `delete_playbook` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook(name: nil) + # Pass arguments to `delete_playbook` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 playbook to delete. + # Format: + # `projects//locations//agents//playbooks/`. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeletePlaybookRequest.new + # + # # Call the delete_playbook method. + # result = client.delete_playbook request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_playbook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookRequest + + # Converts hash and nil to 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_playbook.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_playbook.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_playbook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.call_rpc :delete_playbook, request, 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 playbooks in the specified agent. + # + # @overload list_playbooks(request, options = nil) + # Pass arguments to `list_playbooks` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbooks(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_playbooks` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 playbooks from. + # Format: `projects//locations//agents/`. + # @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::CX::V3::Playbook>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Playbook>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListPlaybooksRequest.new + # + # # Call the list_playbooks method. + # result = client.list_playbooks request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Playbook. + # p item + # end + # + def list_playbooks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksRequest + + # Converts hash and nil to 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_playbooks.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_playbooks.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_playbooks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.call_rpc :list_playbooks, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @playbooks_stub, :list_playbooks, 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 Playbook. + # + # @overload get_playbook(request, options = nil) + # Pass arguments to `get_playbook` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetPlaybookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetPlaybookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook(name: nil) + # Pass arguments to `get_playbook` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 playbook. + # Format: + # `projects//locations//agents//playbooks/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Playbook] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Playbook] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetPlaybookRequest.new + # + # # Call the get_playbook method. + # result = client.get_playbook request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Playbook. + # p result + # + def get_playbook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetPlaybookRequest + + # Converts hash and nil to 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_playbook.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_playbook.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_playbook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.call_rpc :get_playbook, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Exports the specified playbook to a binary file. + # + # Note that resources (e.g. examples, tools) that the playbook + # references will also be exported. + # + # @overload export_playbook(request, options = nil) + # Pass arguments to `export_playbook` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook(name: nil, playbook_uri: nil, data_format: nil) + # Pass arguments to `export_playbook` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 playbook to export. + # Format: + # `projects//locations//agents//playbooks/`. + # @param playbook_uri [::String] + # Optional. The [Google Cloud + # Storage](https://cloud.google.com/storage/docs/) URI to export the playbook + # to. The format of this URI must be `gs:///`. If + # left unspecified, the serialized playbook 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). + # @param data_format [::Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest::DataFormat] + # Optional. The data format of the exported agent. If not specified, `BLOB` + # is assumed. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest.new + # + # # Call the export_playbook method. + # result = client.export_playbook request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_playbook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest + + # Converts hash and nil to 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_playbook.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_playbook.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_playbook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.call_rpc :export_playbook, 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 playbook to the specified agent from a binary file. + # + # @overload import_playbook(request, options = nil) + # Pass arguments to `import_playbook` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ImportPlaybookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ImportPlaybookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook(parent: nil, playbook_uri: nil, playbook_content: nil, import_strategy: nil) + # Pass arguments to `import_playbook` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 import the playbook into. + # Format: `projects//locations//agents/`. + # @param playbook_uri [::String] + # [Dialogflow access + # control] + # (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + # + # Note: The following parameters are mutually exclusive: `playbook_uri`, `playbook_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 playbook_content [::String] + # Uncompressed raw byte content for playbook. + # + # Note: The following parameters are mutually exclusive: `playbook_content`, `playbook_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 import_strategy [::Google::Cloud::Dialogflow::CX::V3::PlaybookImportStrategy, ::Hash] + # Optional. Specifies the import strategy used when resolving resource + # conflicts. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ImportPlaybookRequest.new + # + # # Call the import_playbook method. + # result = client.import_playbook request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_playbook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ImportPlaybookRequest + + # Converts hash and nil to 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_playbook.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_playbook.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_playbook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.call_rpc :import_playbook, 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 Playbook. + # + # @overload update_playbook(request, options = nil) + # Pass arguments to `update_playbook` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdatePlaybookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdatePlaybookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook(playbook: nil, update_mask: nil) + # Pass arguments to `update_playbook` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param playbook [::Google::Cloud::Dialogflow::CX::V3::Playbook, ::Hash] + # Required. The playbook to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # 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::CX::V3::Playbook] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Playbook] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdatePlaybookRequest.new + # + # # Call the update_playbook method. + # result = client.update_playbook request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Playbook. + # p result + # + def update_playbook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdatePlaybookRequest + + # Converts hash and nil to 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_playbook.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.playbook&.name + header_params["playbook.name"] = request.playbook.name + end + + request_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_playbook.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_playbook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.call_rpc :update_playbook, request, 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 version for the specified Playbook. + # + # @overload create_playbook_version(request, options = nil) + # Pass arguments to `create_playbook_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook_version(parent: nil, playbook_version: nil) + # Pass arguments to `create_playbook_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 playbook to create a version for. + # Format: + # `projects//locations//agents//playbooks/`. + # @param playbook_version [::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion, ::Hash] + # Required. The playbook version to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreatePlaybookVersionRequest.new + # + # # Call the create_playbook_version method. + # result = client.create_playbook_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::PlaybookVersion. + # p result + # + def create_playbook_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookVersionRequest + + # Converts hash and nil to 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_playbook_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::CX::V3::VERSION + metadata[:"x-goog-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_playbook_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_playbook_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.call_rpc :create_playbook_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 + + ## + # Retrieves the specified version of the Playbook. + # + # @overload get_playbook_version(request, options = nil) + # Pass arguments to `get_playbook_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetPlaybookVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetPlaybookVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook_version(name: nil) + # Pass arguments to `get_playbook_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 playbook version. + # Format: + # `projects//locations//agents//playbooks//versions/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetPlaybookVersionRequest.new + # + # # Call the get_playbook_version method. + # result = client.get_playbook_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::PlaybookVersion. + # p result + # + def get_playbook_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetPlaybookVersionRequest + + # Converts hash and nil to 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_playbook_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_playbook_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_playbook_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.call_rpc :get_playbook_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 + + ## + # Retrieves the specified version of the Playbook and stores it as the + # current playbook draft, returning the playbook with resources updated. + # + # @overload restore_playbook_version(request, options = nil) + # Pass arguments to `restore_playbook_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook_version(name: nil) + # Pass arguments to `restore_playbook_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 playbook version. + # Format: + # `projects//locations//agents//playbooks//versions/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionRequest.new + # + # # Call the restore_playbook_version method. + # result = client.restore_playbook_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionResponse. + # p result + # + def restore_playbook_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionRequest + + # Converts hash and nil to 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_playbook_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_playbook_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.restore_playbook_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.call_rpc :restore_playbook_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 + + ## + # Lists versions for the specified Playbook. + # + # @overload list_playbook_versions(request, options = nil) + # Pass arguments to `list_playbook_versions` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook_versions(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_playbook_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 playbook to list versions for. + # Format: + # `projects//locations//agents//playbooks/`. + # @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::CX::V3::PlaybookVersion>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsRequest.new + # + # # Call the list_playbook_versions method. + # result = client.list_playbook_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::CX::V3::PlaybookVersion. + # p item + # end + # + def list_playbook_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsRequest + + # Converts hash and nil to 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_playbook_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::CX::V3::VERSION + metadata[:"x-goog-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_playbook_versions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_playbook_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.call_rpc :list_playbook_versions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @playbooks_stub, :list_playbook_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 + + ## + # Deletes the specified version of the Playbook. + # + # @overload delete_playbook_version(request, options = nil) + # Pass arguments to `delete_playbook_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook_version(name: nil) + # Pass arguments to `delete_playbook_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 playbook version to delete. + # Format: + # `projects//locations//agents//playbooks//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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeletePlaybookVersionRequest.new + # + # # Call the delete_playbook_version method. + # result = client.delete_playbook_version request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_playbook_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookVersionRequest + + # Converts hash and nil to 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_playbook_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_playbook_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_playbook_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.call_rpc :delete_playbook_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 Playbooks API. + # + # This class represents the configuration for Playbooks, + # 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::CX::V3::Playbooks::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_playbook to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_playbook.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_playbook.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::CX::V3::Playbooks::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 Playbooks API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_playbook` + # @return [::Gapic::Config::Method] + # + attr_reader :create_playbook + ## + # RPC-specific configuration for `delete_playbook` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_playbook + ## + # RPC-specific configuration for `list_playbooks` + # @return [::Gapic::Config::Method] + # + attr_reader :list_playbooks + ## + # RPC-specific configuration for `get_playbook` + # @return [::Gapic::Config::Method] + # + attr_reader :get_playbook + ## + # RPC-specific configuration for `export_playbook` + # @return [::Gapic::Config::Method] + # + attr_reader :export_playbook + ## + # RPC-specific configuration for `import_playbook` + # @return [::Gapic::Config::Method] + # + attr_reader :import_playbook + ## + # RPC-specific configuration for `update_playbook` + # @return [::Gapic::Config::Method] + # + attr_reader :update_playbook + ## + # RPC-specific configuration for `create_playbook_version` + # @return [::Gapic::Config::Method] + # + attr_reader :create_playbook_version + ## + # RPC-specific configuration for `get_playbook_version` + # @return [::Gapic::Config::Method] + # + attr_reader :get_playbook_version + ## + # RPC-specific configuration for `restore_playbook_version` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_playbook_version + ## + # RPC-specific configuration for `list_playbook_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_playbook_versions + ## + # RPC-specific configuration for `delete_playbook_version` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_playbook_version + + # @private + def initialize parent_rpcs = nil + create_playbook_config = parent_rpcs.create_playbook if parent_rpcs.respond_to? :create_playbook + @create_playbook = ::Gapic::Config::Method.new create_playbook_config + delete_playbook_config = parent_rpcs.delete_playbook if parent_rpcs.respond_to? :delete_playbook + @delete_playbook = ::Gapic::Config::Method.new delete_playbook_config + list_playbooks_config = parent_rpcs.list_playbooks if parent_rpcs.respond_to? :list_playbooks + @list_playbooks = ::Gapic::Config::Method.new list_playbooks_config + get_playbook_config = parent_rpcs.get_playbook if parent_rpcs.respond_to? :get_playbook + @get_playbook = ::Gapic::Config::Method.new get_playbook_config + export_playbook_config = parent_rpcs.export_playbook if parent_rpcs.respond_to? :export_playbook + @export_playbook = ::Gapic::Config::Method.new export_playbook_config + import_playbook_config = parent_rpcs.import_playbook if parent_rpcs.respond_to? :import_playbook + @import_playbook = ::Gapic::Config::Method.new import_playbook_config + update_playbook_config = parent_rpcs.update_playbook if parent_rpcs.respond_to? :update_playbook + @update_playbook = ::Gapic::Config::Method.new update_playbook_config + create_playbook_version_config = parent_rpcs.create_playbook_version if parent_rpcs.respond_to? :create_playbook_version + @create_playbook_version = ::Gapic::Config::Method.new create_playbook_version_config + get_playbook_version_config = parent_rpcs.get_playbook_version if parent_rpcs.respond_to? :get_playbook_version + @get_playbook_version = ::Gapic::Config::Method.new get_playbook_version_config + restore_playbook_version_config = parent_rpcs.restore_playbook_version if parent_rpcs.respond_to? :restore_playbook_version + @restore_playbook_version = ::Gapic::Config::Method.new restore_playbook_version_config + list_playbook_versions_config = parent_rpcs.list_playbook_versions if parent_rpcs.respond_to? :list_playbook_versions + @list_playbook_versions = ::Gapic::Config::Method.new list_playbook_versions_config + delete_playbook_version_config = parent_rpcs.delete_playbook_version if parent_rpcs.respond_to? :delete_playbook_version + @delete_playbook_version = ::Gapic::Config::Method.new delete_playbook_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/credentials.rb new file mode 100644 index 000000000000..3a877d98d8d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Playbooks + # Credentials for the Playbooks 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/operations.rb new file mode 100644 index 000000000000..bcdb5b674b80 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/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 CX + module V3 + module Playbooks + # 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 Playbooks 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 Playbooks 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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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. + # * `: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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/paths.rb new file mode 100644 index 000000000000..47b35437fa9e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/paths.rb @@ -0,0 +1,205 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Playbooks + # Path helper methods for the Playbooks API. + module Paths + ## + # Create a fully-qualified Agent resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # + # @return [::String] + def agent_path project:, location:, agent: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}" + end + + ## + # Create a fully-qualified Example resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param playbook [String] + # @param example [String] + # + # @return [::String] + def example_path project:, location:, agent:, playbook:, example: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "playbook cannot contain /" if playbook.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}/examples/#{example}" + end + + ## + # Create a fully-qualified Flow resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # + # @return [::String] + def flow_path project:, location:, agent:, flow: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}" + end + + ## + # Create a fully-qualified Generator resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/generators/{generator}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param generator [String] + # + # @return [::String] + def generator_path project:, location:, agent:, generator: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/generators/#{generator}" + end + + ## + # Create a fully-qualified Playbook resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param playbook [String] + # + # @return [::String] + def playbook_path project:, location:, agent:, playbook: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}" + end + + ## + # Create a fully-qualified PlaybookVersion resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/versions/{version}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param playbook [String] + # @param version [String] + # + # @return [::String] + def playbook_version_path project:, location:, agent:, playbook:, version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "playbook cannot contain /" if playbook.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}/versions/#{version}" + end + + ## + # Create a fully-qualified Tool resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param tool [String] + # + # @return [::String] + def tool_path project:, location:, agent:, tool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/tools/#{tool}" + end + + ## + # Create a fully-qualified Webhook resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param webhook [String] + # + # @return [::String] + def webhook_path project:, location:, agent:, webhook: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/webhooks/#{webhook}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest.rb new file mode 100644 index 000000000000..4632a1d84395 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/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/cx/v3/version" +require "google/cloud/dialogflow/cx/v3/bindings_override" + +require "google/cloud/dialogflow/cx/v3/playbooks/credentials" +require "google/cloud/dialogflow/cx/v3/playbooks/paths" +require "google/cloud/dialogflow/cx/v3/playbooks/rest/operations" +require "google/cloud/dialogflow/cx/v3/playbooks/rest/client" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Playbook Playbooks}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/cx/v3/playbooks/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new + # + module Playbooks + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/playbooks/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/client.rb new file mode 100644 index 000000000000..025e19a2255c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/client.rb @@ -0,0 +1,1501 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/playbook_pb" +require "google/cloud/dialogflow/cx/v3/playbooks/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Playbooks + module Rest + ## + # REST client for the Playbooks service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Playbook Playbooks}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :playbooks_stub + + ## + # Configure the Playbooks Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Playbooks clients + # ::Google::Cloud::Dialogflow::CX::V3::Playbooks::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", "CX", "V3"] + 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 Playbooks 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::CX::V3::Playbooks::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 + @playbooks_stub.universe_domain + end + + ## + # Create a new Playbooks REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Playbooks 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::CX::V3::Playbooks::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 + + @playbooks_stub = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @playbooks_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 = @playbooks_stub.endpoint + config.universe_domain = @playbooks_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @playbooks_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Playbooks::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 + @playbooks_stub.logger + end + + # Service calls + + ## + # Creates a playbook in a specified agent. + # + # @overload create_playbook(request, options = nil) + # Pass arguments to `create_playbook` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook(parent: nil, playbook: nil) + # Pass arguments to `create_playbook` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 playbook for. + # Format: `projects//locations//agents/`. + # @param playbook [::Google::Cloud::Dialogflow::CX::V3::Playbook, ::Hash] + # Required. The playbook to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Playbook] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Playbook] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreatePlaybookRequest.new + # + # # Call the create_playbook method. + # result = client.create_playbook request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Playbook. + # p result + # + def create_playbook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookRequest + + # Converts hash and nil to an 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_playbook.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_playbook.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_playbook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.create_playbook request, 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 playbook. + # + # @overload delete_playbook(request, options = nil) + # Pass arguments to `delete_playbook` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook(name: nil) + # Pass arguments to `delete_playbook` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 playbook to delete. + # Format: + # `projects//locations//agents//playbooks/`. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeletePlaybookRequest.new + # + # # Call the delete_playbook method. + # result = client.delete_playbook request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_playbook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookRequest + + # Converts hash and nil to an 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_playbook.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_playbook.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_playbook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.delete_playbook request, 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 playbooks in the specified agent. + # + # @overload list_playbooks(request, options = nil) + # Pass arguments to `list_playbooks` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbooks(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_playbooks` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 playbooks from. + # Format: `projects//locations//agents/`. + # @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::CX::V3::Playbook>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Playbook>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListPlaybooksRequest.new + # + # # Call the list_playbooks method. + # result = client.list_playbooks request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Playbook. + # p item + # end + # + def list_playbooks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksRequest + + # Converts hash and nil to an 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_playbooks.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_playbooks.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_playbooks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.list_playbooks request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @playbooks_stub, :list_playbooks, "playbooks", 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 Playbook. + # + # @overload get_playbook(request, options = nil) + # Pass arguments to `get_playbook` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetPlaybookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetPlaybookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook(name: nil) + # Pass arguments to `get_playbook` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 playbook. + # Format: + # `projects//locations//agents//playbooks/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Playbook] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Playbook] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetPlaybookRequest.new + # + # # Call the get_playbook method. + # result = client.get_playbook request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Playbook. + # p result + # + def get_playbook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetPlaybookRequest + + # Converts hash and nil to an 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_playbook.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_playbook.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_playbook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.get_playbook request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Exports the specified playbook to a binary file. + # + # Note that resources (e.g. examples, tools) that the playbook + # references will also be exported. + # + # @overload export_playbook(request, options = nil) + # Pass arguments to `export_playbook` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook(name: nil, playbook_uri: nil, data_format: nil) + # Pass arguments to `export_playbook` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 playbook to export. + # Format: + # `projects//locations//agents//playbooks/`. + # @param playbook_uri [::String] + # Optional. The [Google Cloud + # Storage](https://cloud.google.com/storage/docs/) URI to export the playbook + # to. The format of this URI must be `gs:///`. If + # left unspecified, the serialized playbook 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). + # @param data_format [::Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest::DataFormat] + # Optional. The data format of the exported agent. If not specified, `BLOB` + # is assumed. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest.new + # + # # Call the export_playbook method. + # result = client.export_playbook request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_playbook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest + + # Converts hash and nil to an 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_playbook.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_playbook.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_playbook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.export_playbook 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 playbook to the specified agent from a binary file. + # + # @overload import_playbook(request, options = nil) + # Pass arguments to `import_playbook` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ImportPlaybookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ImportPlaybookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook(parent: nil, playbook_uri: nil, playbook_content: nil, import_strategy: nil) + # Pass arguments to `import_playbook` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 import the playbook into. + # Format: `projects//locations//agents/`. + # @param playbook_uri [::String] + # [Dialogflow access + # control] + # (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + # + # Note: The following parameters are mutually exclusive: `playbook_uri`, `playbook_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 playbook_content [::String] + # Uncompressed raw byte content for playbook. + # + # Note: The following parameters are mutually exclusive: `playbook_content`, `playbook_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 import_strategy [::Google::Cloud::Dialogflow::CX::V3::PlaybookImportStrategy, ::Hash] + # Optional. Specifies the import strategy used when resolving resource + # conflicts. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ImportPlaybookRequest.new + # + # # Call the import_playbook method. + # result = client.import_playbook request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_playbook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ImportPlaybookRequest + + # Converts hash and nil to an 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_playbook.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_playbook.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_playbook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.import_playbook 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 Playbook. + # + # @overload update_playbook(request, options = nil) + # Pass arguments to `update_playbook` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdatePlaybookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdatePlaybookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook(playbook: nil, update_mask: nil) + # Pass arguments to `update_playbook` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param playbook [::Google::Cloud::Dialogflow::CX::V3::Playbook, ::Hash] + # Required. The playbook to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # 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::CX::V3::Playbook] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Playbook] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdatePlaybookRequest.new + # + # # Call the update_playbook method. + # result = client.update_playbook request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Playbook. + # p result + # + def update_playbook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdatePlaybookRequest + + # Converts hash and nil to an 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_playbook.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_playbook.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_playbook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.update_playbook request, 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 version for the specified Playbook. + # + # @overload create_playbook_version(request, options = nil) + # Pass arguments to `create_playbook_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook_version(parent: nil, playbook_version: nil) + # Pass arguments to `create_playbook_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 playbook to create a version for. + # Format: + # `projects//locations//agents//playbooks/`. + # @param playbook_version [::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion, ::Hash] + # Required. The playbook version to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreatePlaybookVersionRequest.new + # + # # Call the create_playbook_version method. + # result = client.create_playbook_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::PlaybookVersion. + # p result + # + def create_playbook_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookVersionRequest + + # Converts hash and nil to an 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_playbook_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_playbook_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_playbook_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.create_playbook_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 + + ## + # Retrieves the specified version of the Playbook. + # + # @overload get_playbook_version(request, options = nil) + # Pass arguments to `get_playbook_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetPlaybookVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetPlaybookVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook_version(name: nil) + # Pass arguments to `get_playbook_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 playbook version. + # Format: + # `projects//locations//agents//playbooks//versions/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetPlaybookVersionRequest.new + # + # # Call the get_playbook_version method. + # result = client.get_playbook_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::PlaybookVersion. + # p result + # + def get_playbook_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetPlaybookVersionRequest + + # Converts hash and nil to an 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_playbook_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_playbook_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_playbook_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.get_playbook_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 + + ## + # Retrieves the specified version of the Playbook and stores it as the + # current playbook draft, returning the playbook with resources updated. + # + # @overload restore_playbook_version(request, options = nil) + # Pass arguments to `restore_playbook_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook_version(name: nil) + # Pass arguments to `restore_playbook_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 playbook version. + # Format: + # `projects//locations//agents//playbooks//versions/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionRequest.new + # + # # Call the restore_playbook_version method. + # result = client.restore_playbook_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionResponse. + # p result + # + def restore_playbook_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionRequest + + # Converts hash and nil to an 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_playbook_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_playbook_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.restore_playbook_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.restore_playbook_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 + + ## + # Lists versions for the specified Playbook. + # + # @overload list_playbook_versions(request, options = nil) + # Pass arguments to `list_playbook_versions` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook_versions(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_playbook_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 playbook to list versions for. + # Format: + # `projects//locations//agents//playbooks/`. + # @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::CX::V3::PlaybookVersion>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsRequest.new + # + # # Call the list_playbook_versions method. + # result = client.list_playbook_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::CX::V3::PlaybookVersion. + # p item + # end + # + def list_playbook_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsRequest + + # Converts hash and nil to an 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_playbook_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_playbook_versions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_playbook_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.list_playbook_versions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @playbooks_stub, :list_playbook_versions, "playbook_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 + + ## + # Deletes the specified version of the Playbook. + # + # @overload delete_playbook_version(request, options = nil) + # Pass arguments to `delete_playbook_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_playbook_version(name: nil) + # Pass arguments to `delete_playbook_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 playbook version to delete. + # Format: + # `projects//locations//agents//playbooks//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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeletePlaybookVersionRequest.new + # + # # Call the delete_playbook_version method. + # result = client.delete_playbook_version request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_playbook_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookVersionRequest + + # Converts hash and nil to an 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_playbook_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_playbook_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_playbook_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @playbooks_stub.delete_playbook_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 Playbooks REST API. + # + # This class represents the configuration for Playbooks 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::CX::V3::Playbooks::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_playbook to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_playbook.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_playbook.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 Playbooks API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_playbook` + # @return [::Gapic::Config::Method] + # + attr_reader :create_playbook + ## + # RPC-specific configuration for `delete_playbook` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_playbook + ## + # RPC-specific configuration for `list_playbooks` + # @return [::Gapic::Config::Method] + # + attr_reader :list_playbooks + ## + # RPC-specific configuration for `get_playbook` + # @return [::Gapic::Config::Method] + # + attr_reader :get_playbook + ## + # RPC-specific configuration for `export_playbook` + # @return [::Gapic::Config::Method] + # + attr_reader :export_playbook + ## + # RPC-specific configuration for `import_playbook` + # @return [::Gapic::Config::Method] + # + attr_reader :import_playbook + ## + # RPC-specific configuration for `update_playbook` + # @return [::Gapic::Config::Method] + # + attr_reader :update_playbook + ## + # RPC-specific configuration for `create_playbook_version` + # @return [::Gapic::Config::Method] + # + attr_reader :create_playbook_version + ## + # RPC-specific configuration for `get_playbook_version` + # @return [::Gapic::Config::Method] + # + attr_reader :get_playbook_version + ## + # RPC-specific configuration for `restore_playbook_version` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_playbook_version + ## + # RPC-specific configuration for `list_playbook_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_playbook_versions + ## + # RPC-specific configuration for `delete_playbook_version` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_playbook_version + + # @private + def initialize parent_rpcs = nil + create_playbook_config = parent_rpcs.create_playbook if parent_rpcs.respond_to? :create_playbook + @create_playbook = ::Gapic::Config::Method.new create_playbook_config + delete_playbook_config = parent_rpcs.delete_playbook if parent_rpcs.respond_to? :delete_playbook + @delete_playbook = ::Gapic::Config::Method.new delete_playbook_config + list_playbooks_config = parent_rpcs.list_playbooks if parent_rpcs.respond_to? :list_playbooks + @list_playbooks = ::Gapic::Config::Method.new list_playbooks_config + get_playbook_config = parent_rpcs.get_playbook if parent_rpcs.respond_to? :get_playbook + @get_playbook = ::Gapic::Config::Method.new get_playbook_config + export_playbook_config = parent_rpcs.export_playbook if parent_rpcs.respond_to? :export_playbook + @export_playbook = ::Gapic::Config::Method.new export_playbook_config + import_playbook_config = parent_rpcs.import_playbook if parent_rpcs.respond_to? :import_playbook + @import_playbook = ::Gapic::Config::Method.new import_playbook_config + update_playbook_config = parent_rpcs.update_playbook if parent_rpcs.respond_to? :update_playbook + @update_playbook = ::Gapic::Config::Method.new update_playbook_config + create_playbook_version_config = parent_rpcs.create_playbook_version if parent_rpcs.respond_to? :create_playbook_version + @create_playbook_version = ::Gapic::Config::Method.new create_playbook_version_config + get_playbook_version_config = parent_rpcs.get_playbook_version if parent_rpcs.respond_to? :get_playbook_version + @get_playbook_version = ::Gapic::Config::Method.new get_playbook_version_config + restore_playbook_version_config = parent_rpcs.restore_playbook_version if parent_rpcs.respond_to? :restore_playbook_version + @restore_playbook_version = ::Gapic::Config::Method.new restore_playbook_version_config + list_playbook_versions_config = parent_rpcs.list_playbook_versions if parent_rpcs.respond_to? :list_playbook_versions + @list_playbook_versions = ::Gapic::Config::Method.new list_playbook_versions_config + delete_playbook_version_config = parent_rpcs.delete_playbook_version if parent_rpcs.respond_to? :delete_playbook_version + @delete_playbook_version = ::Gapic::Config::Method.new delete_playbook_version_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/operations.rb new file mode 100644 index 000000000000..d36ff19056ca --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/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 CX + module V3 + module Playbooks + 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 Playbooks 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 Playbooks 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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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. + # * `: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: "/v3/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{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: "/v3/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/service_stub.rb new file mode 100644 index 000000000000..5c8bf4ff480f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/service_stub.rb @@ -0,0 +1,821 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/playbook_pb" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Playbooks + module Rest + ## + # REST service stub for the Playbooks 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_playbook REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Playbook] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Playbook] + # A result object deserialized from the server's reply + def create_playbook request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_playbook_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_playbook", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Playbook.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_playbook REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_playbook request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_playbook_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_playbook", + 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_playbooks REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::ListPlaybooksResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksResponse] + # A result object deserialized from the server's reply + def list_playbooks request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_playbooks_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_playbooks", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksResponse.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_playbook REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetPlaybookRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Playbook] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Playbook] + # A result object deserialized from the server's reply + def get_playbook request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_playbook_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_playbook", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Playbook.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_playbook REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_playbook request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_playbook_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_playbook", + 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_playbook REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ImportPlaybookRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_playbook request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_playbook_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_playbook", + 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_playbook REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdatePlaybookRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Playbook] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Playbook] + # A result object deserialized from the server's reply + def update_playbook request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_playbook_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_playbook", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Playbook.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_playbook_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::PlaybookVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion] + # A result object deserialized from the server's reply + def create_playbook_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_playbook_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_playbook_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion.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_playbook_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetPlaybookVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::PlaybookVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion] + # A result object deserialized from the server's reply + def get_playbook_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_playbook_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_playbook_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion.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_playbook_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::RestorePlaybookVersionResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionResponse] + # A result object deserialized from the server's reply + def restore_playbook_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_restore_playbook_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: "restore_playbook_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionResponse.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_playbook_versions REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::ListPlaybookVersionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsResponse] + # A result object deserialized from the server's reply + def list_playbook_versions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_playbook_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_playbook_versions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsResponse.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_playbook_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_playbook_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_playbook_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_playbook_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 create_playbook REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookRequest] + # 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_playbook_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/playbooks", + body: "playbook", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_playbook REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookRequest] + # 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_playbook_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/playbooks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_playbooks REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksRequest] + # 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_playbooks_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/playbooks", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_playbook REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetPlaybookRequest] + # 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_playbook_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/playbooks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_playbook REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest] + # 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_playbook_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:export", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/playbooks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_playbook REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ImportPlaybookRequest] + # 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_playbook_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/playbooks:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_playbook REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdatePlaybookRequest] + # 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_playbook_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v3/{playbook.name}", + body: "playbook", + matches: [ + ["playbook.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/playbooks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_playbook_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookVersionRequest] + # 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_playbook_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/versions", + body: "playbook_version", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/playbooks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_playbook_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetPlaybookVersionRequest] + # 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_playbook_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/playbooks/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the restore_playbook_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionRequest] + # 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_playbook_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:restore", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/playbooks/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_playbook_versions REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsRequest] + # 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_playbook_versions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/versions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/playbooks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_playbook_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookVersionRequest] + # 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_playbook_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/playbooks/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/response_message_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/response_message_pb.rb new file mode 100644 index 000000000000..7457aceacf3b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/response_message_pb.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/response_message.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/dialogflow/cx/v3/tool_call_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n4google/cloud/dialogflow/cx/v3/response_message.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a-google/cloud/dialogflow/cx/v3/tool_call.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xaf\x0e\n\x0fResponseMessage\x12\x43\n\x04text\x18\x01 \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.ResponseMessage.TextH\x00\x12*\n\x07payload\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x12\x62\n\x14\x63onversation_success\x18\t \x01(\x0b\x32\x42.google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccessH\x00\x12[\n\x11output_audio_text\x18\x08 \x01(\x0b\x32>.google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioTextH\x00\x12]\n\x12live_agent_handoff\x18\n \x01(\x0b\x32?.google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoffH\x00\x12]\n\x0f\x65nd_interaction\x18\x0b \x01(\x0b\x32=.google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteractionB\x03\xe0\x41\x03H\x00\x12N\n\nplay_audio\x18\x0c \x01(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudioH\x00\x12U\n\x0bmixed_audio\x18\r \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudioB\x03\xe0\x41\x03H\x00\x12g\n\x17telephony_transfer_call\x18\x12 \x01(\x0b\x32\x44.google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCallH\x00\x12_\n\x13knowledge_info_card\x18\x14 \x01(\x0b\x32@.google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCardH\x00\x12<\n\ttool_call\x18\x16 \x01(\x0b\x32\'.google.cloud.dialogflow.cx.v3.ToolCallH\x00\x12R\n\rresponse_type\x18\x04 \x01(\x0e\x32;.google.cloud.dialogflow.cx.v3.ResponseMessage.ResponseType\x12\x0f\n\x07\x63hannel\x18\x13 \x01(\t\x1a\x43\n\x04Text\x12\x11\n\x04text\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12(\n\x1b\x61llow_playback_interruption\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03\x1a=\n\x10LiveAgentHandoff\x12)\n\x08metadata\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a@\n\x13\x43onversationSuccess\x12)\n\x08metadata\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a\x65\n\x0fOutputAudioText\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x0e\n\x04ssml\x18\x02 \x01(\tH\x00\x12(\n\x1b\x61llow_playback_interruption\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03\x42\x08\n\x06source\x1a\x10\n\x0e\x45ndInteraction\x1aM\n\tPlayAudio\x12\x16\n\taudio_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12(\n\x1b\x61llow_playback_interruption\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03\x1a\xc1\x01\n\nMixedAudio\x12S\n\x08segments\x18\x01 \x03(\x0b\x32\x41.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment\x1a^\n\x07Segment\x12\x0f\n\x05\x61udio\x18\x01 \x01(\x0cH\x00\x12\r\n\x03uri\x18\x02 \x01(\tH\x00\x12(\n\x1b\x61llow_playback_interruption\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03\x42\t\n\x07\x63ontent\x1a;\n\x15TelephonyTransferCall\x12\x16\n\x0cphone_number\x18\x01 \x01(\tH\x00\x42\n\n\x08\x65ndpoint\x1a\x13\n\x11KnowledgeInfoCard\"i\n\x0cResponseType\x12\x1d\n\x19RESPONSE_TYPE_UNSPECIFIED\x10\x00\x12\x10\n\x0c\x45NTRY_PROMPT\x10\x01\x12\x14\n\x10PARAMETER_PROMPT\x10\x02\x12\x12\n\x0eHANDLER_PROMPT\x10\x03\x42\t\n\x07messageB\xb7\x01\n!com.google.cloud.dialogflow.cx.v3B\x14ResponseMessageProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ["google.cloud.dialogflow.cx.v3.ToolCall", "google/cloud/dialogflow/cx/v3/tool_call.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ResponseMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage").msgclass + ResponseMessage::Text = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.Text").msgclass + ResponseMessage::LiveAgentHandoff = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff").msgclass + ResponseMessage::ConversationSuccess = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess").msgclass + ResponseMessage::OutputAudioText = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText").msgclass + ResponseMessage::EndInteraction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction").msgclass + ResponseMessage::PlayAudio = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio").msgclass + ResponseMessage::MixedAudio = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio").msgclass + ResponseMessage::MixedAudio::Segment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment").msgclass + ResponseMessage::TelephonyTransferCall = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall").msgclass + ResponseMessage::KnowledgeInfoCard = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard").msgclass + ResponseMessage::ResponseType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.ResponseType").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/rest.rb new file mode 100644 index 000000000000..46d341588c3c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/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/cx/v3/pages/rest" +require "google/cloud/dialogflow/cx/v3/flows/rest" +require "google/cloud/dialogflow/cx/v3/agents/rest" +require "google/cloud/dialogflow/cx/v3/changelogs/rest" +require "google/cloud/dialogflow/cx/v3/deployments/rest" +require "google/cloud/dialogflow/cx/v3/entity_types/rest" +require "google/cloud/dialogflow/cx/v3/intents/rest" +require "google/cloud/dialogflow/cx/v3/session_entity_types/rest" +require "google/cloud/dialogflow/cx/v3/sessions/rest" +require "google/cloud/dialogflow/cx/v3/transition_route_groups/rest" +require "google/cloud/dialogflow/cx/v3/test_cases/rest" +require "google/cloud/dialogflow/cx/v3/webhooks/rest" +require "google/cloud/dialogflow/cx/v3/environments/rest" +require "google/cloud/dialogflow/cx/v3/examples/rest" +require "google/cloud/dialogflow/cx/v3/experiments/rest" +require "google/cloud/dialogflow/cx/v3/generators/rest" +require "google/cloud/dialogflow/cx/v3/playbooks/rest" +require "google/cloud/dialogflow/cx/v3/security_settings_service/rest" +require "google/cloud/dialogflow/cx/v3/tools/rest" +require "google/cloud/dialogflow/cx/v3/versions/rest" +require "google/cloud/dialogflow/cx/v3/bindings_override" +require "google/cloud/dialogflow/cx/v3/version" + +module Google + module Cloud + module Dialogflow + module CX + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/dialogflow/cx/v3/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new + # + module V3 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/safety_settings_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/safety_settings_pb.rb new file mode 100644 index 000000000000..5943f64c629f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/safety_settings_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/safety_settings.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n3google/cloud/dialogflow/cx/v3/safety_settings.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\"\xa0\n\n\x0eSafetySettings\x12t\n$default_banned_phrase_match_strategy\x18\x04 \x01(\x0e\x32\x41.google.cloud.dialogflow.cx.v3.SafetySettings.PhraseMatchStrategyB\x03\xe0\x41\x01\x12L\n\x0e\x62\x61nned_phrases\x18\x01 \x03(\x0b\x32\x34.google.cloud.dialogflow.cx.v3.SafetySettings.Phrase\x12T\n\x0crai_settings\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettingsB\x03\xe0\x41\x01\x12_\n\x14\x64\x65\x66\x61ult_rai_settings\x18\x03 \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettingsB\x06\xe0\x41\x01\xe0\x41\x05\x12k\n\x18prompt_security_settings\x18\x08 \x01(\x0b\x32\x44.google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettingsB\x03\xe0\x41\x01\x1a\x37\n\x06Phrase\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\x1a\xcc\x04\n\x0bRaiSettings\x12g\n\x10\x63\x61tegory_filters\x18\x03 \x03(\x0b\x32H.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilterB\x03\xe0\x41\x01\x1a\xcf\x01\n\x0e\x43\x61tegoryFilter\x12Z\n\x08\x63\x61tegory\x18\x01 \x01(\x0e\x32H.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyCategory\x12\x61\n\x0c\x66ilter_level\x18\x02 \x01(\x0e\x32K.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyFilterLevel\"w\n\x11SafetyFilterLevel\x12#\n\x1fSAFETY_FILTER_LEVEL_UNSPECIFIED\x10\x00\x12\x0e\n\nBLOCK_NONE\x10\x01\x12\r\n\tBLOCK_FEW\x10\x02\x12\x0e\n\nBLOCK_SOME\x10\x03\x12\x0e\n\nBLOCK_MOST\x10\x04\"\x88\x01\n\x0eSafetyCategory\x12\x1f\n\x1bSAFETY_CATEGORY_UNSPECIFIED\x10\x00\x12\x15\n\x11\x44\x41NGEROUS_CONTENT\x10\x01\x12\x0f\n\x0bHATE_SPEECH\x10\x02\x12\x0e\n\nHARASSMENT\x10\x03\x12\x1d\n\x19SEXUALLY_EXPLICIT_CONTENT\x10\x04\x1a=\n\x16PromptSecuritySettings\x12#\n\x16\x65nable_prompt_security\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\"_\n\x13PhraseMatchStrategy\x12%\n!PHRASE_MATCH_STRATEGY_UNSPECIFIED\x10\x00\x12\x11\n\rPARTIAL_MATCH\x10\x01\x12\x0e\n\nWORD_MATCH\x10\x02\x42\xb6\x01\n!com.google.cloud.dialogflow.cx.v3B\x13SafetySettingsProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + SafetySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings").msgclass + SafetySettings::Phrase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings.Phrase").msgclass + SafetySettings::RaiSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings").msgclass + SafetySettings::RaiSettings::CategoryFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter").msgclass + SafetySettings::RaiSettings::SafetyFilterLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyFilterLevel").enummodule + SafetySettings::RaiSettings::SafetyCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyCategory").enummodule + SafetySettings::PromptSecuritySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings").msgclass + SafetySettings::PhraseMatchStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings.PhraseMatchStrategy").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_pb.rb new file mode 100644 index 000000000000..3c76cfb09a55 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_pb.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/security_settings.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 = "\n5google/cloud/dialogflow/cx/v3/security_settings.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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\"^\n\x1aGetSecuritySettingsRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*dialogflow.googleapis.com/SecuritySettings\"\xa6\x01\n\x1dUpdateSecuritySettingsRequest\x12O\n\x11security_settings\x18\x01 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.SecuritySettingsB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x88\x01\n\x1bListSecuritySettingsRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*dialogflow.googleapis.com/SecuritySettings\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x83\x01\n\x1cListSecuritySettingsResponse\x12J\n\x11security_settings\x18\x01 \x03(\x0b\x32/.google.cloud.dialogflow.cx.v3.SecuritySettings\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb4\x01\n\x1d\x43reateSecuritySettingsRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*dialogflow.googleapis.com/SecuritySettings\x12O\n\x11security_settings\x18\x02 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.SecuritySettingsB\x03\xe0\x41\x02\"a\n\x1d\x44\x65leteSecuritySettingsRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*dialogflow.googleapis.com/SecuritySettings\"\xe7\x0c\n\x10SecuritySettings\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12]\n\x12redaction_strategy\x18\x03 \x01(\x0e\x32\x41.google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionStrategy\x12W\n\x0fredaction_scope\x18\x04 \x01(\x0e\x32>.google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionScope\x12\x41\n\x10inspect_template\x18\t \x01(\tB\'\xfa\x41$\n\"dlp.googleapis.com/InspectTemplate\x12G\n\x13\x64\x65identify_template\x18\x11 \x01(\tB*\xfa\x41\'\n%dlp.googleapis.com/DeidentifyTemplate\x12\x1f\n\x15retention_window_days\x18\x06 \x01(\x05H\x00\x12_\n\x12retention_strategy\x18\x07 \x01(\x0e\x32\x41.google.cloud.dialogflow.cx.v3.SecuritySettings.RetentionStrategyH\x00\x12W\n\x10purge_data_types\x18\x08 \x03(\x0e\x32=.google.cloud.dialogflow.cx.v3.SecuritySettings.PurgeDataType\x12\x62\n\x15\x61udio_export_settings\x18\x0c \x01(\x0b\x32\x43.google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings\x12h\n\x18insights_export_settings\x18\r \x01(\x0b\x32\x46.google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings\x1a\xb1\x02\n\x13\x41udioExportSettings\x12\x12\n\ngcs_bucket\x18\x01 \x01(\t\x12\x1c\n\x14\x61udio_export_pattern\x18\x02 \x01(\t\x12\x1e\n\x16\x65nable_audio_redaction\x18\x03 \x01(\x08\x12\x65\n\x0c\x61udio_format\x18\x04 \x01(\x0e\x32O.google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.AudioFormat\x12\x17\n\x0fstore_tts_audio\x18\x06 \x01(\x08\"H\n\x0b\x41udioFormat\x12\x1c\n\x18\x41UDIO_FORMAT_UNSPECIFIED\x10\x00\x12\t\n\x05MULAW\x10\x01\x12\x07\n\x03MP3\x10\x02\x12\x07\n\x03OGG\x10\x03\x1a\x38\n\x16InsightsExportSettings\x12\x1e\n\x16\x65nable_insights_export\x18\x01 \x01(\x08\"P\n\x11RedactionStrategy\x12\"\n\x1eREDACTION_STRATEGY_UNSPECIFIED\x10\x00\x12\x17\n\x13REDACT_WITH_SERVICE\x10\x01\"J\n\x0eRedactionScope\x12\x1f\n\x1bREDACTION_SCOPE_UNSPECIFIED\x10\x00\x12\x17\n\x13REDACT_DISK_STORAGE\x10\x02\"V\n\x11RetentionStrategy\x12\"\n\x1eRETENTION_STRATEGY_UNSPECIFIED\x10\x00\x12\x1d\n\x19REMOVE_AFTER_CONVERSATION\x10\x01\"H\n\rPurgeDataType\x12\x1f\n\x1bPURGE_DATA_TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12\x44IALOGFLOW_HISTORY\x10\x01:}\xea\x41z\n*dialogflow.googleapis.com/SecuritySettings\x12Lprojects/{project}/locations/{location}/securitySettings/{security_settings}B\x10\n\x0e\x64\x61ta_retention2\xef\t\n\x17SecuritySettingsService\x12\xf3\x01\n\x16\x43reateSecuritySettings\x12<.google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest\x1a/.google.cloud.dialogflow.cx.v3.SecuritySettings\"j\xda\x41\x18parent,security_settings\x82\xd3\xe4\x93\x02I\"4/v3/{parent=projects/*/locations/*}/securitySettings:\x11security_settings\x12\xc6\x01\n\x13GetSecuritySettings\x12\x39.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest\x1a/.google.cloud.dialogflow.cx.v3.SecuritySettings\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v3/{name=projects/*/locations/*/securitySettings/*}\x12\x8b\x02\n\x16UpdateSecuritySettings\x12<.google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest\x1a/.google.cloud.dialogflow.cx.v3.SecuritySettings\"\x81\x01\xda\x41\x1dsecurity_settings,update_mask\x82\xd3\xe4\x93\x02[2F/v3/{security_settings.name=projects/*/locations/*/securitySettings/*}:\x11security_settings\x12\xd6\x01\n\x14ListSecuritySettings\x12:.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest\x1a;.google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v3/{parent=projects/*/locations/*}/securitySettings\x12\xb3\x01\n\x16\x44\x65leteSecuritySettings\x12<.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest\x1a\x16.google.protobuf.Empty\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36*4/v3/{name=projects/*/locations/*/securitySettings/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xdf\x04\n!com.google.cloud.dialogflow.cx.v3B\x15SecuritySettingsProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3\xea\x41\xc8\x01\n\"dlp.googleapis.com/InspectTemplate\x12Uorganizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}\x12Kprojects/{project}/locations/{location}/inspectTemplates/{inspect_template}\xea\x41\xd7\x01\n%dlp.googleapis.com/DeidentifyTemplate\x12[organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}\x12Qprojects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + GetSecuritySettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest").msgclass + UpdateSecuritySettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest").msgclass + ListSecuritySettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest").msgclass + ListSecuritySettingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse").msgclass + CreateSecuritySettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest").msgclass + DeleteSecuritySettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest").msgclass + SecuritySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SecuritySettings").msgclass + SecuritySettings::AudioExportSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings").msgclass + SecuritySettings::AudioExportSettings::AudioFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.AudioFormat").enummodule + SecuritySettings::InsightsExportSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings").msgclass + SecuritySettings::RedactionStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionStrategy").enummodule + SecuritySettings::RedactionScope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionScope").enummodule + SecuritySettings::RetentionStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SecuritySettings.RetentionStrategy").enummodule + SecuritySettings::PurgeDataType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SecuritySettings.PurgeDataType").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service.rb new file mode 100644 index 000000000000..e1775b790637 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/dialogflow/cx/v3/version" + +require "google/cloud/dialogflow/cx/v3/security_settings_service/credentials" +require "google/cloud/dialogflow/cx/v3/security_settings_service/paths" +require "google/cloud/dialogflow/cx/v3/security_settings_service/client" +require "google/cloud/dialogflow/cx/v3/security_settings_service/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing security settings for Dialogflow. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/cx/v3/security_settings_service" + # client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/cx/v3/security_settings_service/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new + # + module SecuritySettingsService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "security_settings_service", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/security_settings_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb new file mode 100644 index 000000000000..7b7335919b7f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb @@ -0,0 +1,894 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/security_settings_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module SecuritySettingsService + ## + # Client for the SecuritySettingsService service. + # + # Service for managing security settings for Dialogflow. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :security_settings_service_stub + + ## + # Configure the SecuritySettingsService Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SecuritySettingsService clients + # ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::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", "CX", "V3"] + 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 SecuritySettingsService 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::CX::V3::SecuritySettingsService::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 + @security_settings_service_stub.universe_domain + end + + ## + # Create a new SecuritySettingsService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SecuritySettingsService 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/cx/v3/security_settings_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 + + @security_settings_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::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 + ) + + @security_settings_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 = @security_settings_service_stub.endpoint + config.universe_domain = @security_settings_service_stub.universe_domain + config.logger = @security_settings_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @security_settings_service_stub.logger + end + + # Service calls + + ## + # Create security settings in the specified location. + # + # @overload create_security_settings(request, options = nil) + # Pass arguments to `create_security_settings` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_settings(parent: nil, security_settings: nil) + # Pass arguments to `create_security_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 an + # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings} for. + # Format: `projects//locations/`. + # @param security_settings [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings, ::Hash] + # Required. The security settings to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest.new + # + # # Call the create_security_settings method. + # result = client.create_security_settings request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. + # p result + # + def create_security_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest + + # Converts hash and nil to 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_security_settings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_security_settings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_security_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_settings_service_stub.call_rpc :create_security_settings, request, 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 the specified + # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings}. The + # returned settings may be stale by up to 1 minute. + # + # @overload get_security_settings(request, options = nil) + # Pass arguments to `get_security_settings` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_settings(name: nil) + # Pass arguments to `get_security_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the settings. + # Format: + # `projects//locations//securitySettings/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest.new + # + # # Call the get_security_settings method. + # result = client.get_security_settings request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. + # p result + # + def get_security_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest + + # Converts hash and nil to 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_security_settings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_security_settings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_security_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_settings_service_stub.call_rpc :get_security_settings, request, 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 + # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings}. + # + # @overload update_security_settings(request, options = nil) + # Pass arguments to `update_security_settings` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_settings(security_settings: nil, update_mask: nil) + # Pass arguments to `update_security_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param security_settings [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings, ::Hash] + # Required. [SecuritySettings] object that contains values for each of the + # fields 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::CX::V3::SecuritySettings] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest.new + # + # # Call the update_security_settings method. + # result = client.update_security_settings request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. + # p result + # + def update_security_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest + + # Converts hash and nil to 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_security_settings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.security_settings&.name + header_params["security_settings.name"] = request.security_settings.name + end + + request_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_security_settings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_security_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_settings_service_stub.call_rpc :update_security_settings, request, 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 security settings in the specified location. + # + # @overload list_security_settings(request, options = nil) + # Pass arguments to `list_security_settings` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_settings(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_security_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 all security settings for. + # Format: `projects//locations/`. + # @param page_size [::Integer] + # The maximum number of items to return in a single page. By default 20 and + # at most 100. + # @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::CX::V3::SecuritySettings>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::SecuritySettings>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest.new + # + # # Call the list_security_settings method. + # result = client.list_security_settings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::SecuritySettings. + # p item + # end + # + def list_security_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest + + # Converts hash and nil to 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_security_settings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_security_settings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_security_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_settings_service_stub.call_rpc :list_security_settings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_settings_service_stub, :list_security_settings, 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 + # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings}. + # + # @overload delete_security_settings(request, options = nil) + # Pass arguments to `delete_security_settings` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_settings(name: nil) + # Pass arguments to `delete_security_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 + # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings} to + # delete. Format: + # `projects//locations//securitySettings/`. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest.new + # + # # Call the delete_security_settings method. + # result = client.delete_security_settings request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_security_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest + + # Converts hash and nil to 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_security_settings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_security_settings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_security_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_settings_service_stub.call_rpc :delete_security_settings, request, 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 SecuritySettingsService API. + # + # This class represents the configuration for SecuritySettingsService, + # 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::CX::V3::SecuritySettingsService::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_security_settings to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_security_settings.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_security_settings.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::CX::V3::SecuritySettingsService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 SecuritySettingsService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_security_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :create_security_settings + ## + # RPC-specific configuration for `get_security_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :get_security_settings + ## + # RPC-specific configuration for `update_security_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :update_security_settings + ## + # RPC-specific configuration for `list_security_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_security_settings + ## + # RPC-specific configuration for `delete_security_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_security_settings + + # @private + def initialize parent_rpcs = nil + create_security_settings_config = parent_rpcs.create_security_settings if parent_rpcs.respond_to? :create_security_settings + @create_security_settings = ::Gapic::Config::Method.new create_security_settings_config + get_security_settings_config = parent_rpcs.get_security_settings if parent_rpcs.respond_to? :get_security_settings + @get_security_settings = ::Gapic::Config::Method.new get_security_settings_config + update_security_settings_config = parent_rpcs.update_security_settings if parent_rpcs.respond_to? :update_security_settings + @update_security_settings = ::Gapic::Config::Method.new update_security_settings_config + list_security_settings_config = parent_rpcs.list_security_settings if parent_rpcs.respond_to? :list_security_settings + @list_security_settings = ::Gapic::Config::Method.new list_security_settings_config + delete_security_settings_config = parent_rpcs.delete_security_settings if parent_rpcs.respond_to? :delete_security_settings + @delete_security_settings = ::Gapic::Config::Method.new delete_security_settings_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/credentials.rb new file mode 100644 index 000000000000..0beea234b10a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module SecuritySettingsService + # Credentials for the SecuritySettingsService 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/paths.rb new file mode 100644 index 000000000000..5fbd5a07e384 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/paths.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! + + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module SecuritySettingsService + # Path helper methods for the SecuritySettingsService API. + module Paths + ## + # Create a fully-qualified DeidentifyTemplate resource string. + # + # @overload deidentify_template_path(organization:, location:, deidentify_template:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}` + # + # @param organization [String] + # @param location [String] + # @param deidentify_template [String] + # + # @overload deidentify_template_path(project:, location:, deidentify_template:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}` + # + # @param project [String] + # @param location [String] + # @param deidentify_template [String] + # + # @return [::String] + def deidentify_template_path **args + resources = { + "deidentify_template:location:organization" => (proc do |organization:, location:, deidentify_template:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/deidentifyTemplates/#{deidentify_template}" + end), + "deidentify_template:location:project" => (proc do |project:, location:, deidentify_template:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/deidentifyTemplates/#{deidentify_template}" + 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 InspectTemplate resource string. + # + # @overload inspect_template_path(organization:, location:, inspect_template:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}` + # + # @param organization [String] + # @param location [String] + # @param inspect_template [String] + # + # @overload inspect_template_path(project:, location:, inspect_template:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/inspectTemplates/{inspect_template}` + # + # @param project [String] + # @param location [String] + # @param inspect_template [String] + # + # @return [::String] + def inspect_template_path **args + resources = { + "inspect_template:location:organization" => (proc do |organization:, location:, inspect_template:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/inspectTemplates/#{inspect_template}" + end), + "inspect_template:location:project" => (proc do |project:, location:, inspect_template:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/inspectTemplates/#{inspect_template}" + 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 SecuritySettings 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 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 + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest.rb new file mode 100644 index 000000000000..1e754c394ee4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/dialogflow/cx/v3/version" +require "google/cloud/dialogflow/cx/v3/bindings_override" + +require "google/cloud/dialogflow/cx/v3/security_settings_service/credentials" +require "google/cloud/dialogflow/cx/v3/security_settings_service/paths" +require "google/cloud/dialogflow/cx/v3/security_settings_service/rest/client" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing security settings for Dialogflow. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/cx/v3/security_settings_service/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new + # + module SecuritySettingsService + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/security_settings_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb new file mode 100644 index 000000000000..b6cc8e9ca84a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb @@ -0,0 +1,824 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/security_settings_pb" +require "google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module SecuritySettingsService + module Rest + ## + # REST client for the SecuritySettingsService service. + # + # Service for managing security settings for Dialogflow. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :security_settings_service_stub + + ## + # Configure the SecuritySettingsService Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SecuritySettingsService clients + # ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::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", "CX", "V3"] + 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 SecuritySettingsService 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::CX::V3::SecuritySettingsService::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 + @security_settings_service_stub.universe_domain + end + + ## + # Create a new SecuritySettingsService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SecuritySettingsService 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 + + @security_settings_service_stub = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @security_settings_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 = @security_settings_service_stub.endpoint + config.universe_domain = @security_settings_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @security_settings_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @security_settings_service_stub.logger + end + + # Service calls + + ## + # Create security settings in the specified location. + # + # @overload create_security_settings(request, options = nil) + # Pass arguments to `create_security_settings` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_settings(parent: nil, security_settings: nil) + # Pass arguments to `create_security_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 an + # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings} for. + # Format: `projects//locations/`. + # @param security_settings [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings, ::Hash] + # Required. The security settings to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest.new + # + # # Call the create_security_settings method. + # result = client.create_security_settings request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. + # p result + # + def create_security_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest + + # Converts hash and nil to an 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_security_settings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_security_settings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_security_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_settings_service_stub.create_security_settings request, 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 the specified + # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings}. The + # returned settings may be stale by up to 1 minute. + # + # @overload get_security_settings(request, options = nil) + # Pass arguments to `get_security_settings` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_settings(name: nil) + # Pass arguments to `get_security_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the settings. + # Format: + # `projects//locations//securitySettings/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest.new + # + # # Call the get_security_settings method. + # result = client.get_security_settings request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. + # p result + # + def get_security_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest + + # Converts hash and nil to an 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_security_settings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_security_settings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_security_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_settings_service_stub.get_security_settings request, 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 + # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings}. + # + # @overload update_security_settings(request, options = nil) + # Pass arguments to `update_security_settings` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_settings(security_settings: nil, update_mask: nil) + # Pass arguments to `update_security_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param security_settings [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings, ::Hash] + # Required. [SecuritySettings] object that contains values for each of the + # fields 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::CX::V3::SecuritySettings] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest.new + # + # # Call the update_security_settings method. + # result = client.update_security_settings request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. + # p result + # + def update_security_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest + + # Converts hash and nil to an 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_security_settings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_security_settings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_security_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_settings_service_stub.update_security_settings request, 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 security settings in the specified location. + # + # @overload list_security_settings(request, options = nil) + # Pass arguments to `list_security_settings` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_settings(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_security_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 all security settings for. + # Format: `projects//locations/`. + # @param page_size [::Integer] + # The maximum number of items to return in a single page. By default 20 and + # at most 100. + # @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::CX::V3::SecuritySettings>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::SecuritySettings>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest.new + # + # # Call the list_security_settings method. + # result = client.list_security_settings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::SecuritySettings. + # p item + # end + # + def list_security_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest + + # Converts hash and nil to an 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_security_settings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_security_settings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_security_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_settings_service_stub.list_security_settings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_settings_service_stub, :list_security_settings, "security_settings", 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 + # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings}. + # + # @overload delete_security_settings(request, options = nil) + # Pass arguments to `delete_security_settings` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_settings(name: nil) + # Pass arguments to `delete_security_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 + # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings} to + # delete. Format: + # `projects//locations//securitySettings/`. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest.new + # + # # Call the delete_security_settings method. + # result = client.delete_security_settings request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_security_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest + + # Converts hash and nil to an 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_security_settings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_security_settings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_security_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_settings_service_stub.delete_security_settings request, 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 SecuritySettingsService REST API. + # + # This class represents the configuration for SecuritySettingsService 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::CX::V3::SecuritySettingsService::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_security_settings to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_security_settings.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_security_settings.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 SecuritySettingsService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_security_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :create_security_settings + ## + # RPC-specific configuration for `get_security_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :get_security_settings + ## + # RPC-specific configuration for `update_security_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :update_security_settings + ## + # RPC-specific configuration for `list_security_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_security_settings + ## + # RPC-specific configuration for `delete_security_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_security_settings + + # @private + def initialize parent_rpcs = nil + create_security_settings_config = parent_rpcs.create_security_settings if parent_rpcs.respond_to? :create_security_settings + @create_security_settings = ::Gapic::Config::Method.new create_security_settings_config + get_security_settings_config = parent_rpcs.get_security_settings if parent_rpcs.respond_to? :get_security_settings + @get_security_settings = ::Gapic::Config::Method.new get_security_settings_config + update_security_settings_config = parent_rpcs.update_security_settings if parent_rpcs.respond_to? :update_security_settings + @update_security_settings = ::Gapic::Config::Method.new update_security_settings_config + list_security_settings_config = parent_rpcs.list_security_settings if parent_rpcs.respond_to? :list_security_settings + @list_security_settings = ::Gapic::Config::Method.new list_security_settings_config + delete_security_settings_config = parent_rpcs.delete_security_settings if parent_rpcs.respond_to? :delete_security_settings + @delete_security_settings = ::Gapic::Config::Method.new delete_security_settings_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb new file mode 100644 index 000000000000..a6987639fc2b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb @@ -0,0 +1,390 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/security_settings_pb" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module SecuritySettingsService + module Rest + ## + # REST service stub for the SecuritySettingsService 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_security_settings REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::SecuritySettings] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] + # A result object deserialized from the server's reply + def create_security_settings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_security_settings_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_security_settings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings.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_security_settings REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::SecuritySettings] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] + # A result object deserialized from the server's reply + def get_security_settings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_security_settings_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_security_settings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings.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_security_settings REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::SecuritySettings] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] + # A result object deserialized from the server's reply + def update_security_settings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_security_settings_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_security_settings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings.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_security_settings REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::ListSecuritySettingsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsResponse] + # A result object deserialized from the server's reply + def list_security_settings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_security_settings_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_security_settings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsResponse.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_security_settings REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_security_settings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_security_settings_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_security_settings", + 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_security_settings REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest] + # 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_security_settings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/securitySettings", + body: "security_settings", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_security_settings REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest] + # 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_security_settings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/securitySettings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_security_settings REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest] + # 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_security_settings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v3/{security_settings.name}", + body: "security_settings", + matches: [ + ["security_settings.name", %r{^projects/[^/]+/locations/[^/]+/securitySettings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_security_settings REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest] + # 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_security_settings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/securitySettings", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_security_settings REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest] + # 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_security_settings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/securitySettings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_services_pb.rb new file mode 100644 index 000000000000..2b5dd9181e26 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_services_pb.rb @@ -0,0 +1,59 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/cx/v3/security_settings.proto for package 'Google.Cloud.Dialogflow.CX.V3' +# 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/cx/v3/security_settings_pb' + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module SecuritySettingsService + # Service for managing security settings for Dialogflow. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.cx.v3.SecuritySettingsService' + + # Create security settings in the specified location. + rpc :CreateSecuritySettings, ::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest, ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings + # Retrieves the specified + # [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. The + # returned settings may be stale by up to 1 minute. + rpc :GetSecuritySettings, ::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest, ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings + # Updates the specified + # [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. + rpc :UpdateSecuritySettings, ::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest, ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings + # Returns the list of all security settings in the specified location. + rpc :ListSecuritySettings, ::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsResponse + # Deletes the specified + # [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. + rpc :DeleteSecuritySettings, ::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_type_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_type_pb.rb new file mode 100644 index 000000000000..847ce9867bd6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_type_pb.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/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/cx/v3/entity_type_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n7google/cloud/dialogflow/cx/v3/session_entity_type.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/entity_type.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xf5\x04\n\x11SessionEntityType\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x66\n\x14\x65ntity_override_mode\x18\x03 \x01(\x0e\x32\x43.google.cloud.dialogflow.cx.v3.SessionEntityType.EntityOverrideModeB\x03\xe0\x41\x02\x12G\n\x08\x65ntities\x18\x04 \x03(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.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:\x96\x02\xea\x41\x92\x02\n+dialogflow.googleapis.com/SessionEntityType\x12\x63projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}\x12~projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}\"\x8b\x01\n\x1dListSessionEntityTypesRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+dialogflow.googleapis.com/SessionEntityType\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x89\x01\n\x1eListSessionEntityTypesResponse\x12N\n\x14session_entity_types\x18\x01 \x03(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.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\"\xb9\x01\n\x1e\x43reateSessionEntityTypeRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+dialogflow.googleapis.com/SessionEntityType\x12R\n\x13session_entity_type\x18\x02 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.SessionEntityTypeB\x03\xe0\x41\x02\"\xa5\x01\n\x1eUpdateSessionEntityTypeRequest\x12R\n\x13session_entity_type\x18\x01 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.SessionEntityTypeB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"c\n\x1e\x44\x65leteSessionEntityTypeRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+dialogflow.googleapis.com/SessionEntityType2\xc5\x0e\n\x12SessionEntityTypes\x12\xc3\x02\n\x16ListSessionEntityTypes\x12<.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest\x1a=.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse\"\xab\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x9b\x01\x12\x43/v3/{parent=projects/*/locations/*/agents/*/sessions/*}/entityTypesZT\x12R/v3/{parent=projects/*/locations/*/agents/*/environments/*/sessions/*}/entityTypes\x12\xb0\x02\n\x14GetSessionEntityType\x12:.google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest\x1a\x30.google.cloud.dialogflow.cx.v3.SessionEntityType\"\xa9\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x9b\x01\x12\x43/v3/{name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}ZT\x12R/v3/{name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}\x12\xf6\x02\n\x17\x43reateSessionEntityType\x12=.google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest\x1a\x30.google.cloud.dialogflow.cx.v3.SessionEntityType\"\xe9\x01\xda\x41\x1aparent,session_entity_type\x82\xd3\xe4\x93\x02\xc5\x01\"C/v3/{parent=projects/*/locations/*/agents/*/sessions/*}/entityTypes:\x13session_entity_typeZi\"R/v3/{parent=projects/*/locations/*/agents/*/environments/*/sessions/*}/entityTypes:\x13session_entity_type\x12\xa3\x03\n\x17UpdateSessionEntityType\x12=.google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest\x1a\x30.google.cloud.dialogflow.cx.v3.SessionEntityType\"\x96\x02\xda\x41\x1fsession_entity_type,update_mask\x82\xd3\xe4\x93\x02\xed\x01\x32W/v3/{session_entity_type.name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}:\x13session_entity_typeZ}2f/v3/{session_entity_type.name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}:\x13session_entity_type\x12\x9c\x02\n\x17\x44\x65leteSessionEntityType\x12=.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest\x1a\x16.google.protobuf.Empty\"\xa9\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x9b\x01*C/v3/{name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}ZT*R/v3/{name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xb9\x01\n!com.google.cloud.dialogflow.cx.v3B\x16SessionEntityTypeProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.dialogflow.cx.v3.EntityType.Entity", "google/cloud/dialogflow/cx/v3/entity_type.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + SessionEntityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SessionEntityType").msgclass + SessionEntityType::EntityOverrideMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SessionEntityType.EntityOverrideMode").enummodule + ListSessionEntityTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest").msgclass + ListSessionEntityTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse").msgclass + GetSessionEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest").msgclass + CreateSessionEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest").msgclass + UpdateSessionEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest").msgclass + DeleteSessionEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_type_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_type_services_pb.rb new file mode 100644 index 000000000000..76668def184d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_type_services_pb.rb @@ -0,0 +1,56 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/cx/v3/session_entity_type.proto for package 'Google.Cloud.Dialogflow.CX.V3' +# 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/cx/v3/session_entity_type_pb' + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module SessionEntityTypes + # Service for managing + # [SessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityType]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.cx.v3.SessionEntityTypes' + + # Returns the list of all session entity types in the specified session. + rpc :ListSessionEntityTypes, ::Google::Cloud::Dialogflow::CX::V3::ListSessionEntityTypesRequest, ::Google::Cloud::Dialogflow::CX::V3::ListSessionEntityTypesResponse + # Retrieves the specified session entity type. + rpc :GetSessionEntityType, ::Google::Cloud::Dialogflow::CX::V3::GetSessionEntityTypeRequest, ::Google::Cloud::Dialogflow::CX::V3::SessionEntityType + # Creates a session entity type. + rpc :CreateSessionEntityType, ::Google::Cloud::Dialogflow::CX::V3::CreateSessionEntityTypeRequest, ::Google::Cloud::Dialogflow::CX::V3::SessionEntityType + # Updates the specified session entity type. + rpc :UpdateSessionEntityType, ::Google::Cloud::Dialogflow::CX::V3::UpdateSessionEntityTypeRequest, ::Google::Cloud::Dialogflow::CX::V3::SessionEntityType + # Deletes the specified session entity type. + rpc :DeleteSessionEntityType, ::Google::Cloud::Dialogflow::CX::V3::DeleteSessionEntityTypeRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types.rb new file mode 100644 index 000000000000..e98527de8c5b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types.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/cx/v3/version" + +require "google/cloud/dialogflow/cx/v3/session_entity_types/credentials" +require "google/cloud/dialogflow/cx/v3/session_entity_types/paths" +require "google/cloud/dialogflow/cx/v3/session_entity_types/client" +require "google/cloud/dialogflow/cx/v3/session_entity_types/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing + # {::Google::Cloud::Dialogflow::CX::V3::SessionEntityType SessionEntityTypes}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/cx/v3/session_entity_types" + # client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/cx/v3/session_entity_types/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new + # + module SessionEntityTypes + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "session_entity_types", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/session_entity_types/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb new file mode 100644 index 000000000000..0b7a5d67f7a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb @@ -0,0 +1,911 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/dialogflow/cx/v3/session_entity_type_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module SessionEntityTypes + ## + # Client for the SessionEntityTypes service. + # + # Service for managing + # {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityTypes::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SessionEntityTypes clients + # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] + 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::CX::V3::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::CX::V3::SessionEntityTypes::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::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/cx/v3/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::CX::V3::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. + # + # @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::CX::V3::ListSessionEntityTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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//locations//agents//sessions/` + # or + # `projects//locations//agents//environments//sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. + # @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::CX::V3::SessionEntityType>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::SessionEntityType>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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. + # + # @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::CX::V3::GetSessionEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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//locations//agents//sessions//entityTypes/` + # or + # `projects//locations//agents//environments//sessions//entityTypes/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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. + # + # @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::CX::V3::CreateSessionEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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//locations//agents//sessions/` + # or + # `projects//locations//agents//environments//sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. + # @param session_entity_type [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityType] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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. + # + # @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::CX::V3::UpdateSessionEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityType, ::Hash] + # Required. The session entity type to update. + # Format: + # `projects//locations//agents//sessions//entityTypes/` + # or + # `projects//locations//agents//environments//sessions//entityTypes/`. + # If `Environment ID` is not specified, + # we assume default 'draft' environment. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The mask to control which fields get updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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. + # + # @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::CX::V3::DeleteSessionEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 session entity type to delete. + # Format: + # `projects//locations//agents//sessions//entityTypes/` + # or + # `projects//locations//agents//environments//sessions//entityTypes/`. + # If `Environment ID` is not specified, + # we assume default 'draft' environment. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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. + # * `: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. + # * `: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-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/credentials.rb new file mode 100644 index 000000000000..639602e34074 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/paths.rb new file mode 100644 index 000000000000..955bbddd5d5a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/paths.rb @@ -0,0 +1,137 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module SessionEntityTypes + # Path helper methods for the SessionEntityTypes API. + module Paths + ## + # Create a fully-qualified Session resource string. + # + # @overload session_path(project:, location:, agent:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param session [String] + # + # @overload session_path(project:, location:, agent:, environment:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param environment [String] + # @param session [String] + # + # @return [::String] + def session_path **args + resources = { + "agent:location:project:session" => (proc do |project:, location:, agent:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/sessions/#{session}" + end), + "agent:environment:location:project:session" => (proc do |project:, location:, agent:, environment:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}/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:, location:, agent:, session:, entity_type:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param session [String] + # @param entity_type [String] + # + # @overload session_entity_type_path(project:, location:, agent:, environment:, session:, entity_type:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param environment [String] + # @param session [String] + # @param entity_type [String] + # + # @return [::String] + def session_entity_type_path **args + resources = { + "agent:entity_type:location:project:session" => (proc do |project:, location:, agent:, 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, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/sessions/#{session}/entityTypes/#{entity_type}" + end), + "agent:entity_type:environment:location:project:session" => (proc do |project:, location:, agent:, environment:, 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, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}/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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest.rb new file mode 100644 index 000000000000..b5b410a5a089 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/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/cx/v3/version" +require "google/cloud/dialogflow/cx/v3/bindings_override" + +require "google/cloud/dialogflow/cx/v3/session_entity_types/credentials" +require "google/cloud/dialogflow/cx/v3/session_entity_types/paths" +require "google/cloud/dialogflow/cx/v3/session_entity_types/rest/client" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing + # {::Google::Cloud::Dialogflow::CX::V3::SessionEntityType SessionEntityTypes}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/cx/v3/session_entity_types/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new + # + module SessionEntityTypes + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/session_entity_types/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb new file mode 100644 index 000000000000..7eccd2b1c4fe --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/dialogflow/cx/v3/session_entity_type_pb" +require "google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module SessionEntityTypes + module Rest + ## + # REST client for the SessionEntityTypes service. + # + # Service for managing + # {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityTypes::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SessionEntityTypes clients + # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] + 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::CX::V3::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::CX::V3::SessionEntityTypes::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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. + # + # @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::CX::V3::ListSessionEntityTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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//locations//agents//sessions/` + # or + # `projects//locations//agents//environments//sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. + # @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::CX::V3::SessionEntityType>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::SessionEntityType>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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. + # + # @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::CX::V3::GetSessionEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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//locations//agents//sessions//entityTypes/` + # or + # `projects//locations//agents//environments//sessions//entityTypes/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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. + # + # @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::CX::V3::CreateSessionEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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//locations//agents//sessions/` + # or + # `projects//locations//agents//environments//sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. + # @param session_entity_type [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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. + # + # @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::CX::V3::UpdateSessionEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityType, ::Hash] + # Required. The session entity type to update. + # Format: + # `projects//locations//agents//sessions//entityTypes/` + # or + # `projects//locations//agents//environments//sessions//entityTypes/`. + # If `Environment ID` is not specified, + # we assume default 'draft' environment. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The mask to control which fields get updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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. + # + # @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::CX::V3::DeleteSessionEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 session entity type to delete. + # Format: + # `projects//locations//agents//sessions//entityTypes/` + # or + # `projects//locations//agents//environments//sessions//entityTypes/`. + # If `Environment ID` is not specified, + # we assume default 'draft' environment. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::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::CX::V3::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::CX::V3::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. + # * `: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. + # * `: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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.rb new file mode 100644 index 000000000000..fce6f42fb4a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.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 "google/cloud/dialogflow/cx/v3/session_entity_type_pb" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + 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::CX::V3::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::CX::V3::ListSessionEntityTypesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::SessionEntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::SessionEntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::SessionEntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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: "/v3/{parent}/entityTypes", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/entityTypes", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/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::CX::V3::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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/sessions/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/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::CX::V3::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: "/v3/{parent}/entityTypes", + body: "session_entity_type", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/entityTypes", + body: "session_entity_type", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/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::CX::V3::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: "/v3/{session_entity_type.name}", + body: "session_entity_type", + matches: [ + ["session_entity_type.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/sessions/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v3/{session_entity_type.name}", + body: "session_entity_type", + matches: [ + ["session_entity_type.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/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::CX::V3::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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/sessions/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/sessions/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_pb.rb new file mode 100644 index 000000000000..74b0a540997a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_pb.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/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/cx/v3/advanced_settings_pb' +require 'google/cloud/dialogflow/cx/v3/audio_config_pb' +require 'google/cloud/dialogflow/cx/v3/data_store_connection_pb' +require 'google/cloud/dialogflow/cx/v3/flow_pb' +require 'google/cloud/dialogflow/cx/v3/generative_settings_pb' +require 'google/cloud/dialogflow/cx/v3/intent_pb' +require 'google/cloud/dialogflow/cx/v3/page_pb' +require 'google/cloud/dialogflow/cx/v3/response_message_pb' +require 'google/cloud/dialogflow/cx/v3/session_entity_type_pb' +require 'google/cloud/dialogflow/cx/v3/tool_call_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/cx/v3/session.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/advanced_settings.proto\x1a\x30google/cloud/dialogflow/cx/v3/audio_config.proto\x1a\x39google/cloud/dialogflow/cx/v3/data_store_connection.proto\x1a(google/cloud/dialogflow/cx/v3/flow.proto\x1a\x37google/cloud/dialogflow/cx/v3/generative_settings.proto\x1a*google/cloud/dialogflow/cx/v3/intent.proto\x1a(google/cloud/dialogflow/cx/v3/page.proto\x1a\x34google/cloud/dialogflow/cx/v3/response_message.proto\x1a\x37google/cloud/dialogflow/cx/v3/session_entity_type.proto\x1a-google/cloud/dialogflow/cx/v3/tool_call.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\"\xd4\x02\n\x0e\x41nswerFeedback\x12I\n\x06rating\x18\x01 \x01(\x0e\x32\x34.google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingB\x03\xe0\x41\x01\x12V\n\rrating_reason\x18\x02 \x01(\x0b\x32:.google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReasonB\x03\xe0\x41\x01\x12\x1a\n\rcustom_rating\x18\x03 \x01(\tB\x03\xe0\x41\x01\x1a\x41\n\x0cRatingReason\x12\x1a\n\rreason_labels\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x15\n\x08\x66\x65\x65\x64\x62\x61\x63k\x18\x02 \x01(\tB\x03\xe0\x41\x01\"@\n\x06Rating\x12\x16\n\x12RATING_UNSPECIFIED\x10\x00\x12\r\n\tTHUMBS_UP\x10\x01\x12\x0f\n\x0bTHUMBS_DOWN\x10\x02\"\xf6\x01\n\x1bSubmitAnswerFeedbackRequest\x12:\n\x07session\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Session\x12\x18\n\x0bresponse_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12K\n\x0f\x61nswer_feedback\x18\x03 \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.AnswerFeedbackB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\x80\x03\n\x13\x44\x65tectIntentRequest\x12:\n\x07session\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Session\x12\x44\n\x0cquery_params\x18\x02 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.QueryParameters\x12\x43\n\x0bquery_input\x18\x03 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.QueryInputB\x03\xe0\x41\x02\x12M\n\x13output_audio_config\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.OutputAudioConfig\x12S\n\rresponse_view\x18\t \x01(\x0e\x32\x37.google.cloud.dialogflow.cx.v3.DetectIntentResponseViewB\x03\xe0\x41\x01\"\x8e\x03\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.cx.v3.QueryResult\x12\x14\n\x0coutput_audio\x18\x04 \x01(\x0c\x12M\n\x13output_audio_config\x18\x05 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.OutputAudioConfig\x12W\n\rresponse_type\x18\x06 \x01(\x0e\x32@.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType\x12\x1a\n\x12\x61llow_cancellation\x18\x07 \x01(\x08\"E\n\x0cResponseType\x12\x1d\n\x19RESPONSE_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PARTIAL\x10\x01\x12\t\n\x05\x46INAL\x10\x02\"\xc6\x03\n\x1cStreamingDetectIntentRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Session\x12\x44\n\x0cquery_params\x18\x02 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.QueryParameters\x12\x43\n\x0bquery_input\x18\x03 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.QueryInputB\x03\xe0\x41\x02\x12M\n\x13output_audio_config\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.OutputAudioConfig\x12\x1f\n\x17\x65nable_partial_response\x18\x05 \x01(\x08\x12\x1d\n\x15\x65nable_debugging_info\x18\x08 \x01(\x08\x12S\n\rresponse_view\x18\x10 \x01(\x0e\x32\x37.google.cloud.dialogflow.cx.v3.DetectIntentResponseViewB\x03\xe0\x41\x01\"\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\"\xb2\x02\n\x1dStreamingDetectIntentResponse\x12W\n\x12recognition_result\x18\x01 \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.StreamingRecognitionResultH\x00\x12U\n\x16\x64\x65tect_intent_response\x18\x02 \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.DetectIntentResponseH\x00\x12U\n\x0e\x64\x65\x62ugging_info\x18\x04 \x01(\x0b\x32=.google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfoB\n\n\x08response\"\xb6\x03\n\x1aStreamingRecognitionResult\x12[\n\x0cmessage_type\x18\x01 \x01(\x0e\x32\x45.google.cloud.dialogflow.cx.v3.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\x11\n\tstability\x18\x06 \x01(\x02\x12G\n\x10speech_word_info\x18\x07 \x03(\x0b\x32-.google.cloud.dialogflow.cx.v3.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\"\xf3\x07\n\x0fQueryParameters\x12\x11\n\ttime_zone\x18\x01 \x01(\t\x12)\n\x0cgeo_location\x18\x02 \x01(\x0b\x32\x13.google.type.LatLng\x12N\n\x14session_entity_types\x18\x03 \x03(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.SessionEntityType\x12(\n\x07payload\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12+\n\nparameters\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x17\n\x0fparameter_scope\x18\x0c \x01(\t\x12\x39\n\x0c\x63urrent_page\x18\x06 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Page\x12\x17\n\x0f\x64isable_webhook\x18\x07 \x01(\x08\x12$\n\x1c\x61nalyze_query_text_sentiment\x18\x08 \x01(\x08\x12[\n\x0fwebhook_headers\x18\n \x03(\x0b\x32\x42.google.cloud.dialogflow.cx.v3.QueryParameters.WebhookHeadersEntry\x12=\n\rflow_versions\x18\x0e \x03(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Version\x12\x44\n\x10\x63urrent_playbook\x18\x13 \x01(\tB*\xe0\x41\x01\xfa\x41$\n\"dialogflow.googleapis.com/Playbook\x12P\n\x12llm_model_settings\x18\x15 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.LlmModelSettingsB\x03\xe0\x41\x01\x12\x0f\n\x07\x63hannel\x18\x0f \x01(\t\x12\x33\n\x0bsession_ttl\x18\x10 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x37\n\x11\x65nd_user_metadata\x18\x12 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12G\n\rsearch_config\x18\x14 \x01(\x0b\x32+.google.cloud.dialogflow.cx.v3.SearchConfigB\x03\xe0\x41\x01\x12\x35\n&populate_data_store_connection_signals\x18\x19 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x1a\x35\n\x13WebhookHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x9a\x01\n\x0cSearchConfig\x12\x43\n\x0b\x62oost_specs\x18\x01 \x03(\x0b\x32).google.cloud.dialogflow.cx.v3.BoostSpecsB\x03\xe0\x41\x01\x12\x45\n\x0c\x66ilter_specs\x18\x02 \x03(\x0b\x32*.google.cloud.dialogflow.cx.v3.FilterSpecsB\x03\xe0\x41\x01\"\x9b\x07\n\tBoostSpec\x12_\n\x15\x63ondition_boost_specs\x18\x01 \x03(\x0b\x32;.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpecB\x03\xe0\x41\x01\x1a\xac\x06\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\x12m\n\x12\x62oost_control_spec\x18\x04 \x01(\x0b\x32L.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpecB\x03\xe0\x41\x01\x1a\xfa\x04\n\x10\x42oostControlSpec\x12\x17\n\nfield_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12w\n\x0e\x61ttribute_type\x18\x02 \x01(\x0e\x32Z.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeTypeB\x03\xe0\x41\x01\x12\x7f\n\x12interpolation_type\x18\x03 \x01(\x0e\x32^.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationTypeB\x03\xe0\x41\x01\x12v\n\x0e\x63ontrol_points\x18\x04 \x03(\x0b\x32Y.google.cloud.dialogflow.cx.v3.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\"\x90\x01\n\nBoostSpecs\x12\x45\n\x0b\x64\x61ta_stores\x18\x01 \x03(\tB0\xe0\x41\x01\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12;\n\x04spec\x18\x02 \x03(\x0b\x32(.google.cloud.dialogflow.cx.v3.BoostSpecB\x03\xe0\x41\x01\"i\n\x0b\x46ilterSpecs\x12\x45\n\x0b\x64\x61ta_stores\x18\x01 \x03(\tB0\xe0\x41\x01\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xa6\x03\n\nQueryInput\x12\x38\n\x04text\x18\x02 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.TextInputH\x00\x12<\n\x06intent\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.IntentInputH\x00\x12:\n\x05\x61udio\x18\x05 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.AudioInputH\x00\x12:\n\x05\x65vent\x18\x06 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.EventInputH\x00\x12\x38\n\x04\x64tmf\x18\x07 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.DtmfInputH\x00\x12I\n\x10tool_call_result\x18\x0b \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.ToolCallResultH\x00\x12\x1a\n\rlanguage_code\x18\x04 \x01(\tB\x03\xe0\x41\x02\x42\x07\n\x05input\"\xae\x08\n\x0bQueryResult\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12?\n\x0etrigger_intent\x18\x0b \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/IntentH\x00\x12\x14\n\ntranscript\x18\x0c \x01(\tH\x00\x12\x17\n\rtrigger_event\x18\x0e \x01(\tH\x00\x12\x38\n\x04\x64tmf\x18\x17 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.DtmfInputH\x00\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12+\n\nparameters\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\x12I\n\x11response_messages\x18\x04 \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.ResponseMessage\x12,\n\x10webhook_statuses\x18\r \x03(\x0b\x32\x12.google.rpc.Status\x12\x31\n\x10webhook_payloads\x18\x06 \x03(\x0b\x32\x17.google.protobuf.Struct\x12\x39\n\x0c\x63urrent_page\x18\x07 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.Page\x12\x39\n\x0c\x63urrent_flow\x18\x1f \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.Flow\x12\x39\n\x06intent\x18\x08 \x01(\x0b\x32%.google.cloud.dialogflow.cx.v3.IntentB\x02\x18\x01\x12\'\n\x1bintent_detection_confidence\x18\t \x01(\x02\x42\x02\x18\x01\x12\x33\n\x05match\x18\x0f \x01(\x0b\x32$.google.cloud.dialogflow.cx.v3.Match\x12\x30\n\x0f\x64iagnostic_info\x18\n \x01(\x0b\x32\x17.google.protobuf.Struct\x12Y\n\x19sentiment_analysis_result\x18\x11 \x01(\x0b\x32\x36.google.cloud.dialogflow.cx.v3.SentimentAnalysisResult\x12J\n\x11\x61\x64vanced_settings\x18\x15 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x12\x1d\n\x15\x61llow_answer_feedback\x18 \x01(\x08\x12\x65\n\x1d\x64\x61ta_store_connection_signals\x18# \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignalsB\x03\xe0\x41\x01\x42\x07\n\x05query\"\x1e\n\tTextInput\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\"G\n\x0bIntentInput\x12\x38\n\x06intent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n dialogflow.googleapis.com/Intent\"a\n\nAudioInput\x12\x44\n\x06\x63onfig\x18\x01 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.InputAudioConfigB\x03\xe0\x41\x02\x12\r\n\x05\x61udio\x18\x02 \x01(\x0c\"\x1b\n\nEventInput\x12\r\n\x05\x65vent\x18\x01 \x01(\t\"1\n\tDtmfInput\x12\x0e\n\x06\x64igits\x18\x01 \x01(\t\x12\x14\n\x0c\x66inish_digit\x18\x02 \x01(\t\"\x98\x03\n\x05Match\x12\x35\n\x06intent\x18\x01 \x01(\x0b\x32%.google.cloud.dialogflow.cx.v3.Intent\x12\r\n\x05\x65vent\x18\x06 \x01(\t\x12+\n\nparameters\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x16\n\x0eresolved_input\x18\x03 \x01(\t\x12\x42\n\nmatch_type\x18\x04 \x01(\x0e\x32..google.cloud.dialogflow.cx.v3.Match.MatchType\x12\x12\n\nconfidence\x18\x05 \x01(\x02\"\xab\x01\n\tMatchType\x12\x1a\n\x16MATCH_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06INTENT\x10\x01\x12\x11\n\rDIRECT_INTENT\x10\x02\x12\x15\n\x11PARAMETER_FILLING\x10\x03\x12\x0c\n\x08NO_MATCH\x10\x04\x12\x0c\n\x08NO_INPUT\x10\x05\x12\t\n\x05\x45VENT\x10\x06\x12\x17\n\x13KNOWLEDGE_CONNECTOR\x10\x08\x12\x0c\n\x08PLAYBOOK\x10\t\"\xfe\x01\n\x12MatchIntentRequest\x12:\n\x07session\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Session\x12\x44\n\x0cquery_params\x18\x02 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.QueryParameters\x12\x43\n\x0bquery_input\x18\x03 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.QueryInputB\x03\xe0\x41\x02\x12!\n\x19persist_parameter_changes\x18\x05 \x01(\x08\"\x90\x02\n\x13MatchIntentResponse\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12?\n\x0etrigger_intent\x18\x02 \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/IntentH\x00\x12\x14\n\ntranscript\x18\x03 \x01(\tH\x00\x12\x17\n\rtrigger_event\x18\x06 \x01(\tH\x00\x12\x35\n\x07matches\x18\x04 \x03(\x0b\x32$.google.cloud.dialogflow.cx.v3.Match\x12\x39\n\x0c\x63urrent_page\x18\x05 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.PageB\x07\n\x05query\"\xeb\x01\n\x14\x46ulfillIntentRequest\x12O\n\x14match_intent_request\x18\x01 \x01(\x0b\x32\x31.google.cloud.dialogflow.cx.v3.MatchIntentRequest\x12\x33\n\x05match\x18\x02 \x01(\x0b\x32$.google.cloud.dialogflow.cx.v3.Match\x12M\n\x13output_audio_config\x18\x03 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.OutputAudioConfig\"\xd3\x01\n\x15\x46ulfillIntentResponse\x12\x13\n\x0bresponse_id\x18\x01 \x01(\t\x12@\n\x0cquery_result\x18\x02 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.QueryResult\x12\x14\n\x0coutput_audio\x18\x03 \x01(\x0c\x12M\n\x13output_audio_config\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.OutputAudioConfig\";\n\x17SentimentAnalysisResult\x12\r\n\x05score\x18\x01 \x01(\x02\x12\x11\n\tmagnitude\x18\x02 \x01(\x02*\xbd\x01\n\x18\x44\x65tectIntentResponseView\x12+\n\'DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED\x10\x00\x12$\n DETECT_INTENT_RESPONSE_VIEW_FULL\x10\x01\x12%\n!DETECT_INTENT_RESPONSE_VIEW_BASIC\x10\x02\x12\'\n#DETECT_INTENT_RESPONSE_VIEW_DEFAULT\x10\x03\x32\xfa\r\n\x08Sessions\x12\xa6\x02\n\x0c\x44\x65tectIntent\x12\x32.google.cloud.dialogflow.cx.v3.DetectIntentRequest\x1a\x33.google.cloud.dialogflow.cx.v3.DetectIntentResponse\"\xac\x01\x82\xd3\xe4\x93\x02\xa5\x01\"E/v3/{session=projects/*/locations/*/agents/*/sessions/*}:detectIntent:\x01*ZY\"T/v3/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:detectIntent:\x01*\x12\xd5\x02\n\x1bServerStreamingDetectIntent\x12\x32.google.cloud.dialogflow.cx.v3.DetectIntentRequest\x1a\x33.google.cloud.dialogflow.cx.v3.DetectIntentResponse\"\xca\x01\x82\xd3\xe4\x93\x02\xc3\x01\"T/v3/{session=projects/*/locations/*/agents/*/sessions/*}:serverStreamingDetectIntent:\x01*Zh\"c/v3/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:serverStreamingDetectIntent:\x01*0\x01\x12\x98\x01\n\x15StreamingDetectIntent\x12;.google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest\x1a<.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse\"\x00(\x01\x30\x01\x12\xa1\x02\n\x0bMatchIntent\x12\x31.google.cloud.dialogflow.cx.v3.MatchIntentRequest\x1a\x32.google.cloud.dialogflow.cx.v3.MatchIntentResponse\"\xaa\x01\x82\xd3\xe4\x93\x02\xa3\x01\"D/v3/{session=projects/*/locations/*/agents/*/sessions/*}:matchIntent:\x01*ZX\"S/v3/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:matchIntent:\x01*\x12\xd5\x02\n\rFulfillIntent\x12\x33.google.cloud.dialogflow.cx.v3.FulfillIntentRequest\x1a\x34.google.cloud.dialogflow.cx.v3.FulfillIntentResponse\"\xd8\x01\x82\xd3\xe4\x93\x02\xd1\x01\"[/v3/{match_intent_request.session=projects/*/locations/*/agents/*/sessions/*}:fulfillIntent:\x01*Zo\"j/v3/{match_intent_request.session=projects/*/locations/*/agents/*/environments/*/sessions/*}:fulfillIntent:\x01*\x12\xdb\x01\n\x14SubmitAnswerFeedback\x12:.google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest\x1a-.google.cloud.dialogflow.cx.v3.AnswerFeedback\"X\x82\xd3\xe4\x93\x02R\"M/v3/{session=projects/*/locations/*/agents/*/sessions/*}:submitAnswerFeedback:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xd0\x04\n!com.google.cloud.dialogflow.cx.v3B\x0cSessionProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3\xea\x41\xd4\x01\n!dialogflow.googleapis.com/Session\x12Iprojects/{project}/locations/{location}/agents/{agent}/sessions/{session}\x12\x64projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}\xea\x41\xc5\x01\n(discoveryengine.googleapis.com/DataStore\x12?projects/{project}/locations/{location}/dataStores/{data_store}\x12Xprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.dialogflow.cx.v3.OutputAudioConfig", "google/cloud/dialogflow/cx/v3/audio_config.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.type.LatLng", "google/type/latlng.proto"], + ["google.cloud.dialogflow.cx.v3.SessionEntityType", "google/cloud/dialogflow/cx/v3/session_entity_type.proto"], + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ["google.cloud.dialogflow.cx.v3.LlmModelSettings", "google/cloud/dialogflow/cx/v3/generative_settings.proto"], + ["google.cloud.dialogflow.cx.v3.ToolCallResult", "google/cloud/dialogflow/cx/v3/tool_call.proto"], + ["google.cloud.dialogflow.cx.v3.ResponseMessage", "google/cloud/dialogflow/cx/v3/response_message.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.cloud.dialogflow.cx.v3.Page", "google/cloud/dialogflow/cx/v3/page.proto"], + ["google.cloud.dialogflow.cx.v3.Flow", "google/cloud/dialogflow/cx/v3/flow.proto"], + ["google.cloud.dialogflow.cx.v3.Intent", "google/cloud/dialogflow/cx/v3/intent.proto"], + ["google.cloud.dialogflow.cx.v3.AdvancedSettings", "google/cloud/dialogflow/cx/v3/advanced_settings.proto"], + ["google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals", "google/cloud/dialogflow/cx/v3/data_store_connection.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + AnswerFeedback = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.AnswerFeedback").msgclass + AnswerFeedback::RatingReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason").msgclass + AnswerFeedback::Rating = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.AnswerFeedback.Rating").enummodule + SubmitAnswerFeedbackRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest").msgclass + DetectIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DetectIntentRequest").msgclass + DetectIntentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DetectIntentResponse").msgclass + DetectIntentResponse::ResponseType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType").enummodule + StreamingDetectIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest").msgclass + CloudConversationDebuggingInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo").msgclass + StreamingDetectIntentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse").msgclass + StreamingRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.StreamingRecognitionResult").msgclass + StreamingRecognitionResult::MessageType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.MessageType").enummodule + QueryParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.QueryParameters").msgclass + SearchConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SearchConfig").msgclass + BoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BoostSpec").msgclass + BoostSpec::ConditionBoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec").msgclass + BoostSpec::ConditionBoostSpec::BoostControlSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec").msgclass + BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint").msgclass + BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType").enummodule + BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType").enummodule + BoostSpecs = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BoostSpecs").msgclass + FilterSpecs = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.FilterSpecs").msgclass + QueryInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.QueryInput").msgclass + QueryResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.QueryResult").msgclass + TextInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TextInput").msgclass + IntentInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.IntentInput").msgclass + AudioInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.AudioInput").msgclass + EventInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.EventInput").msgclass + DtmfInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DtmfInput").msgclass + Match = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Match").msgclass + Match::MatchType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Match.MatchType").enummodule + MatchIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.MatchIntentRequest").msgclass + MatchIntentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.MatchIntentResponse").msgclass + FulfillIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.FulfillIntentRequest").msgclass + FulfillIntentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.FulfillIntentResponse").msgclass + SentimentAnalysisResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SentimentAnalysisResult").msgclass + DetectIntentResponseView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DetectIntentResponseView").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_services_pb.rb new file mode 100644 index 000000000000..b2bbaace8542 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_services_pb.rb @@ -0,0 +1,85 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/cx/v3/session.proto for package 'Google.Cloud.Dialogflow.CX.V3' +# 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/cx/v3/session_pb' + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Sessions + # A session represents an interaction with a user. You retrieve user input + # and pass it to the + # [DetectIntent][google.cloud.dialogflow.cx.v3.Sessions.DetectIntent] method to + # determine user intent and respond. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.cx.v3.Sessions' + + # Processes a natural language query and returns structured, actionable data + # as a result. This method is not idempotent, because it may cause session + # entity types to be updated, which in turn might affect results of future + # queries. + # + # Note: Always use agent versions for production traffic. + # See [Versions and + # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + rpc :DetectIntent, ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest, ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse + # Processes a natural language query and returns structured, actionable data + # as a result through server-side streaming. Server-side streaming allows + # Dialogflow to send [partial + # responses](https://cloud.google.com/dialogflow/cx/docs/concept/fulfillment#partial-response) + # earlier in a single request. + rpc :ServerStreamingDetectIntent, ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest, stream(::Google::Cloud::Dialogflow::CX::V3::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). + # + # Note: Always use agent versions for production traffic. + # See [Versions and + # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + rpc :StreamingDetectIntent, stream(::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest), stream(::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentResponse) + # Returns preliminary intent match results, doesn't change the session + # status. + rpc :MatchIntent, ::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest, ::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse + # Fulfills a matched intent returned by + # [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent]. Must be + # called after + # [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent], with + # input from + # [MatchIntentResponse][google.cloud.dialogflow.cx.v3.MatchIntentResponse]. + # Otherwise, the behavior is undefined. + rpc :FulfillIntent, ::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest, ::Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse + # Updates the feedback received from the user for a single turn of the bot + # response. + rpc :SubmitAnswerFeedback, ::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest, ::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions.rb new file mode 100644 index 000000000000..a4e55165408e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See 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/cx/v3/version" + +require "google/cloud/dialogflow/cx/v3/sessions/credentials" +require "google/cloud/dialogflow/cx/v3/sessions/paths" +require "google/cloud/dialogflow/cx/v3/sessions/client" +require "google/cloud/dialogflow/cx/v3/sessions/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # A session represents an interaction with a user. You retrieve user input + # and pass it to the + # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#detect_intent DetectIntent} method to + # determine user intent and respond. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/cx/v3/sessions" + # client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/cx/v3/sessions/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new + # + module Sessions + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "sessions", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/sessions/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb new file mode 100644 index 000000000000..1c3d967d0d58 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb @@ -0,0 +1,1073 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/session_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Sessions + ## + # Client for the Sessions service. + # + # A session represents an interaction with a user. You retrieve user input + # and pass it to the + # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#detect_intent DetectIntent} method to + # determine user intent and respond. + # + 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::CX::V3::Sessions::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Sessions clients + # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] + 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.server_streaming_detect_intent.timeout = 220.0 + + 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::CX::V3::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::CX::V3::Sessions::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::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/cx/v3/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::CX::V3::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 session + # entity types to be updated, which in turn might affect results of future + # queries. + # + # Note: Always use agent versions for production traffic. + # See [Versions and + # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + # + # @overload detect_intent(request, options = nil) + # Pass arguments to `detect_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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, response_view: 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//locations//agents//sessions/` or + # `projects//locations//agents//environments//sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. + # 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 of the `Session ID` must not exceed 36 characters. + # + # For more information, see the [sessions + # guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + # + # Note: Always use agent versions for production traffic. + # See [Versions and + # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + # @param query_params [::Google::Cloud::Dialogflow::CX::V3::QueryParameters, ::Hash] + # The parameters of this query. + # @param query_input [::Google::Cloud::Dialogflow::CX::V3::QueryInput, ::Hash] + # Required. The input specification. + # @param output_audio_config [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig, ::Hash] + # Instructs the speech synthesizer how to generate the output audio. + # @param response_view [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponseView] + # Optional. Specifies which fields in the + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} to return. If not + # set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new + # + # # Call the detect_intent method. + # result = client.detect_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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 and returns structured, actionable data + # as a result through server-side streaming. Server-side streaming allows + # Dialogflow to send [partial + # responses](https://cloud.google.com/dialogflow/cx/docs/concept/fulfillment#partial-response) + # earlier in a single request. + # + # @overload server_streaming_detect_intent(request, options = nil) + # Pass arguments to `server_streaming_detect_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 server_streaming_detect_intent(session: nil, query_params: nil, query_input: nil, output_audio_config: nil, response_view: nil) + # Pass arguments to `server_streaming_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//locations//agents//sessions/` or + # `projects//locations//agents//environments//sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. + # 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 of the `Session ID` must not exceed 36 characters. + # + # For more information, see the [sessions + # guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + # + # Note: Always use agent versions for production traffic. + # See [Versions and + # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + # @param query_params [::Google::Cloud::Dialogflow::CX::V3::QueryParameters, ::Hash] + # The parameters of this query. + # @param query_input [::Google::Cloud::Dialogflow::CX::V3::QueryInput, ::Hash] + # Required. The input specification. + # @param output_audio_config [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig, ::Hash] + # Instructs the speech synthesizer how to generate the output audio. + # @param response_view [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponseView] + # Optional. Specifies which fields in the + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} to return. If not + # set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new + # + # # Call the server_streaming_detect_intent method to start streaming. + # output = client.server_streaming_detect_intent request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse + # output.each do |current_response| + # p current_response + # end + # + def server_streaming_detect_intent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::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.server_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::CX::V3::VERSION + metadata[:"x-goog-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.server_streaming_detect_intent.timeout, + metadata: metadata, + retry_policy: @config.rpcs.server_streaming_detect_intent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @sessions_stub.call_rpc :server_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 + + ## + # 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). + # + # Note: Always use agent versions for production traffic. + # See [Versions and + # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest, ::Hash>] + # An enumerable of {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::StreamingDetectIntentResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::StreamingDetectIntentRequest.new + # input << Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new + # input.close + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 + + ## + # Returns preliminary intent match results, doesn't change the session + # status. + # + # @overload match_intent(request, options = nil) + # Pass arguments to `match_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload match_intent(session: nil, query_params: nil, query_input: nil, persist_parameter_changes: nil) + # Pass arguments to `match_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//locations//agents//sessions/` + # or + # `projects//locations//agents//environments//sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. + # 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 of the `Session ID` must not exceed 36 characters. + # + # For more information, see the [sessions + # guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + # @param query_params [::Google::Cloud::Dialogflow::CX::V3::QueryParameters, ::Hash] + # The parameters of this query. + # @param query_input [::Google::Cloud::Dialogflow::CX::V3::QueryInput, ::Hash] + # Required. The input specification. + # @param persist_parameter_changes [::Boolean] + # Persist session parameter changes from `query_params`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest.new + # + # # Call the match_intent method. + # result = client.match_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse. + # p result + # + def match_intent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.match_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::CX::V3::VERSION + metadata[:"x-goog-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.match_intent.timeout, + metadata: metadata, + retry_policy: @config.rpcs.match_intent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @sessions_stub.call_rpc :match_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 + + ## + # Fulfills a matched intent returned by + # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#match_intent MatchIntent}. Must be + # called after + # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#match_intent MatchIntent}, with + # input from + # {::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse MatchIntentResponse}. + # Otherwise, the behavior is undefined. + # + # @overload fulfill_intent(request, options = nil) + # Pass arguments to `fulfill_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload fulfill_intent(match_intent_request: nil, match: nil, output_audio_config: nil) + # Pass arguments to `fulfill_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 match_intent_request [::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest, ::Hash] + # Must be same as the corresponding MatchIntent request, otherwise the + # behavior is undefined. + # @param match [::Google::Cloud::Dialogflow::CX::V3::Match, ::Hash] + # The matched intent/event to fulfill. + # @param output_audio_config [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig, ::Hash] + # Instructs the speech synthesizer how to generate output audio. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest.new + # + # # Call the fulfill_intent method. + # result = client.fulfill_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse. + # p result + # + def fulfill_intent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.fulfill_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.match_intent_request&.session + header_params["match_intent_request.session"] = request.match_intent_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.fulfill_intent.timeout, + metadata: metadata, + retry_policy: @config.rpcs.fulfill_intent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @sessions_stub.call_rpc :fulfill_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 feedback received from the user for a single turn of the bot + # response. + # + # @overload submit_answer_feedback(request, options = nil) + # Pass arguments to `submit_answer_feedback` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload submit_answer_feedback(session: nil, response_id: nil, answer_feedback: nil, update_mask: nil) + # Pass arguments to `submit_answer_feedback` via keyword arguments. Note that at + # least one keyword argument is 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 the feedback was sent to. + # @param response_id [::String] + # Required. ID of the response to update its feedback. This is the same as + # DetectIntentResponse.response_id. + # @param answer_feedback [::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback, ::Hash] + # Required. Feedback provided for a bot answer. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields to update. 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::CX::V3::AnswerFeedback] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest.new + # + # # Call the submit_answer_feedback method. + # result = client.submit_answer_feedback request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AnswerFeedback. + # p result + # + def submit_answer_feedback request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.submit_answer_feedback.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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.submit_answer_feedback.timeout, + metadata: metadata, + retry_policy: @config.rpcs.submit_answer_feedback.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @sessions_stub.call_rpc :submit_answer_feedback, request, 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::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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. + # * `: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. + # * `: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 `server_streaming_detect_intent` + # @return [::Gapic::Config::Method] + # + attr_reader :server_streaming_detect_intent + ## + # RPC-specific configuration for `streaming_detect_intent` + # @return [::Gapic::Config::Method] + # + attr_reader :streaming_detect_intent + ## + # RPC-specific configuration for `match_intent` + # @return [::Gapic::Config::Method] + # + attr_reader :match_intent + ## + # RPC-specific configuration for `fulfill_intent` + # @return [::Gapic::Config::Method] + # + attr_reader :fulfill_intent + ## + # RPC-specific configuration for `submit_answer_feedback` + # @return [::Gapic::Config::Method] + # + attr_reader :submit_answer_feedback + + # @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 + server_streaming_detect_intent_config = parent_rpcs.server_streaming_detect_intent if parent_rpcs.respond_to? :server_streaming_detect_intent + @server_streaming_detect_intent = ::Gapic::Config::Method.new server_streaming_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 + match_intent_config = parent_rpcs.match_intent if parent_rpcs.respond_to? :match_intent + @match_intent = ::Gapic::Config::Method.new match_intent_config + fulfill_intent_config = parent_rpcs.fulfill_intent if parent_rpcs.respond_to? :fulfill_intent + @fulfill_intent = ::Gapic::Config::Method.new fulfill_intent_config + submit_answer_feedback_config = parent_rpcs.submit_answer_feedback if parent_rpcs.respond_to? :submit_answer_feedback + @submit_answer_feedback = ::Gapic::Config::Method.new submit_answer_feedback_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/credentials.rb new file mode 100644 index 000000000000..cafa147c8084 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb new file mode 100644 index 000000000000..1191647760b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb @@ -0,0 +1,312 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + module Sessions + # Path helper methods for the Sessions API. + module Paths + ## + # Create a fully-qualified DataStore resource string. + # + # @overload data_store_path(project:, location:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # + # @overload data_store_path(project:, location:, collection:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # + # @return [::String] + def data_store_path **args + resources = { + "data_store:location:project" => (proc do |project:, location:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}" + end), + "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified EntityType resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param entity_type [String] + # + # @return [::String] + def entity_type_path project:, location:, agent:, entity_type: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/entityTypes/#{entity_type}" + end + + ## + # Create a fully-qualified Intent resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/intents/{intent}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param intent [String] + # + # @return [::String] + def intent_path project:, location:, agent:, intent: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/intents/#{intent}" + end + + ## + # Create a fully-qualified Page resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # @param page [String] + # + # @return [::String] + def page_path project:, location:, agent:, flow:, page: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/pages/#{page}" + end + + ## + # Create a fully-qualified Playbook resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param playbook [String] + # + # @return [::String] + def playbook_path project:, location:, agent:, playbook: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}" + end + + ## + # Create a fully-qualified Session resource string. + # + # @overload session_path(project:, location:, agent:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param session [String] + # + # @overload session_path(project:, location:, agent:, environment:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param environment [String] + # @param session [String] + # + # @return [::String] + def session_path **args + resources = { + "agent:location:project:session" => (proc do |project:, location:, agent:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/sessions/#{session}" + end), + "agent:environment:location:project:session" => (proc do |project:, location:, agent:, environment:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}/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:, location:, agent:, session:, entity_type:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param session [String] + # @param entity_type [String] + # + # @overload session_entity_type_path(project:, location:, agent:, environment:, session:, entity_type:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param environment [String] + # @param session [String] + # @param entity_type [String] + # + # @return [::String] + def session_entity_type_path **args + resources = { + "agent:entity_type:location:project:session" => (proc do |project:, location:, agent:, 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, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/sessions/#{session}/entityTypes/#{entity_type}" + end), + "agent:entity_type:environment:location:project:session" => (proc do |project:, location:, agent:, environment:, 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, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}/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 + + ## + # Create a fully-qualified Tool resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param tool [String] + # + # @return [::String] + def tool_path project:, location:, agent:, tool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/tools/#{tool}" + end + + ## + # Create a fully-qualified Version resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # @param version [String] + # + # @return [::String] + def version_path project:, location:, agent:, flow:, version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/versions/#{version}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest.rb new file mode 100644 index 000000000000..fb814c9ad673 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest.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/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/dialogflow/cx/v3/version" +require "google/cloud/dialogflow/cx/v3/bindings_override" + +require "google/cloud/dialogflow/cx/v3/sessions/credentials" +require "google/cloud/dialogflow/cx/v3/sessions/paths" +require "google/cloud/dialogflow/cx/v3/sessions/rest/client" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # A session represents an interaction with a user. You retrieve user input + # and pass it to the + # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#detect_intent DetectIntent} method to + # determine user intent and respond. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/cx/v3/sessions/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new + # + module Sessions + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/sessions/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb new file mode 100644 index 000000000000..d8591c59231e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb @@ -0,0 +1,912 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/session_pb" +require "google/cloud/dialogflow/cx/v3/sessions/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Sessions + module Rest + ## + # REST client for the Sessions service. + # + # A session represents an interaction with a user. You retrieve user input + # and pass it to the + # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client#detect_intent DetectIntent} method to + # determine user intent and respond. + # + 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::CX::V3::Sessions::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Sessions clients + # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] + 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.server_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::CX::V3::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::CX::V3::Sessions::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 session + # entity types to be updated, which in turn might affect results of future + # queries. + # + # Note: Always use agent versions for production traffic. + # See [Versions and + # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + # + # @overload detect_intent(request, options = nil) + # Pass arguments to `detect_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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, response_view: 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//locations//agents//sessions/` or + # `projects//locations//agents//environments//sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. + # 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 of the `Session ID` must not exceed 36 characters. + # + # For more information, see the [sessions + # guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + # + # Note: Always use agent versions for production traffic. + # See [Versions and + # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + # @param query_params [::Google::Cloud::Dialogflow::CX::V3::QueryParameters, ::Hash] + # The parameters of this query. + # @param query_input [::Google::Cloud::Dialogflow::CX::V3::QueryInput, ::Hash] + # Required. The input specification. + # @param output_audio_config [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig, ::Hash] + # Instructs the speech synthesizer how to generate the output audio. + # @param response_view [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponseView] + # Optional. Specifies which fields in the + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} to return. If not + # set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new + # + # # Call the detect_intent method. + # result = client.detect_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # Processes a natural language query and returns structured, actionable data + # as a result through server-side streaming. Server-side streaming allows + # Dialogflow to send [partial + # responses](https://cloud.google.com/dialogflow/cx/docs/concept/fulfillment#partial-response) + # earlier in a single request. + # + # @overload server_streaming_detect_intent(request, options = nil) + # Pass arguments to `server_streaming_detect_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 server_streaming_detect_intent(session: nil, query_params: nil, query_input: nil, output_audio_config: nil, response_view: nil) + # Pass arguments to `server_streaming_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//locations//agents//sessions/` or + # `projects//locations//agents//environments//sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. + # 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 of the `Session ID` must not exceed 36 characters. + # + # For more information, see the [sessions + # guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + # + # Note: Always use agent versions for production traffic. + # See [Versions and + # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + # @param query_params [::Google::Cloud::Dialogflow::CX::V3::QueryParameters, ::Hash] + # The parameters of this query. + # @param query_input [::Google::Cloud::Dialogflow::CX::V3::QueryInput, ::Hash] + # Required. The input specification. + # @param output_audio_config [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig, ::Hash] + # Instructs the speech synthesizer how to generate the output audio. + # @param response_view [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponseView] + # Optional. Specifies which fields in the + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} to return. If not + # set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. + # @return [::Enumerable<::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new + # + # # Call the server_streaming_detect_intent method to start streaming. + # output = client.server_streaming_detect_intent request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse + # output.each do |current_response| + # p current_response + # end + # + def server_streaming_detect_intent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::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.server_streaming_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.server_streaming_detect_intent.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.server_streaming_detect_intent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + ::Gapic::Rest::ServerStream.new( + ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse, + ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| + @sessions_stub.server_streaming_detect_intent request, options do |chunk| + in_q.deq + out_q.enq chunk + end + end + ) + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns preliminary intent match results, doesn't change the session + # status. + # + # @overload match_intent(request, options = nil) + # Pass arguments to `match_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload match_intent(session: nil, query_params: nil, query_input: nil, persist_parameter_changes: nil) + # Pass arguments to `match_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//locations//agents//sessions/` + # or + # `projects//locations//agents//environments//sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. + # 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 of the `Session ID` must not exceed 36 characters. + # + # For more information, see the [sessions + # guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + # @param query_params [::Google::Cloud::Dialogflow::CX::V3::QueryParameters, ::Hash] + # The parameters of this query. + # @param query_input [::Google::Cloud::Dialogflow::CX::V3::QueryInput, ::Hash] + # Required. The input specification. + # @param persist_parameter_changes [::Boolean] + # Persist session parameter changes from `query_params`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest.new + # + # # Call the match_intent method. + # result = client.match_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse. + # p result + # + def match_intent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.match_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.match_intent.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.match_intent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @sessions_stub.match_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 + + ## + # Fulfills a matched intent returned by + # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client#match_intent MatchIntent}. Must be + # called after + # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client#match_intent MatchIntent}, with + # input from + # {::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse MatchIntentResponse}. + # Otherwise, the behavior is undefined. + # + # @overload fulfill_intent(request, options = nil) + # Pass arguments to `fulfill_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload fulfill_intent(match_intent_request: nil, match: nil, output_audio_config: nil) + # Pass arguments to `fulfill_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 match_intent_request [::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest, ::Hash] + # Must be same as the corresponding MatchIntent request, otherwise the + # behavior is undefined. + # @param match [::Google::Cloud::Dialogflow::CX::V3::Match, ::Hash] + # The matched intent/event to fulfill. + # @param output_audio_config [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig, ::Hash] + # Instructs the speech synthesizer how to generate output audio. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest.new + # + # # Call the fulfill_intent method. + # result = client.fulfill_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse. + # p result + # + def fulfill_intent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.fulfill_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.fulfill_intent.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.fulfill_intent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @sessions_stub.fulfill_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 feedback received from the user for a single turn of the bot + # response. + # + # @overload submit_answer_feedback(request, options = nil) + # Pass arguments to `submit_answer_feedback` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload submit_answer_feedback(session: nil, response_id: nil, answer_feedback: nil, update_mask: nil) + # Pass arguments to `submit_answer_feedback` via keyword arguments. Note that at + # least one keyword argument is 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 the feedback was sent to. + # @param response_id [::String] + # Required. ID of the response to update its feedback. This is the same as + # DetectIntentResponse.response_id. + # @param answer_feedback [::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback, ::Hash] + # Required. Feedback provided for a bot answer. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields to update. 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::CX::V3::AnswerFeedback] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest.new + # + # # Call the submit_answer_feedback method. + # result = client.submit_answer_feedback request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AnswerFeedback. + # p result + # + def submit_answer_feedback request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.submit_answer_feedback.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.submit_answer_feedback.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.submit_answer_feedback.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @sessions_stub.submit_answer_feedback request, 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::CX::V3::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::CX::V3::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::CX::V3::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. + # * `: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. + # * `: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 `server_streaming_detect_intent` + # @return [::Gapic::Config::Method] + # + attr_reader :server_streaming_detect_intent + ## + # RPC-specific configuration for `match_intent` + # @return [::Gapic::Config::Method] + # + attr_reader :match_intent + ## + # RPC-specific configuration for `fulfill_intent` + # @return [::Gapic::Config::Method] + # + attr_reader :fulfill_intent + ## + # RPC-specific configuration for `submit_answer_feedback` + # @return [::Gapic::Config::Method] + # + attr_reader :submit_answer_feedback + + # @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 + server_streaming_detect_intent_config = parent_rpcs.server_streaming_detect_intent if parent_rpcs.respond_to? :server_streaming_detect_intent + @server_streaming_detect_intent = ::Gapic::Config::Method.new server_streaming_detect_intent_config + match_intent_config = parent_rpcs.match_intent if parent_rpcs.respond_to? :match_intent + @match_intent = ::Gapic::Config::Method.new match_intent_config + fulfill_intent_config = parent_rpcs.fulfill_intent if parent_rpcs.respond_to? :fulfill_intent + @fulfill_intent = ::Gapic::Config::Method.new fulfill_intent_config + submit_answer_feedback_config = parent_rpcs.submit_answer_feedback if parent_rpcs.respond_to? :submit_answer_feedback + @submit_answer_feedback = ::Gapic::Config::Method.new submit_answer_feedback_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb new file mode 100644 index 000000000000..354514d347f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb @@ -0,0 +1,419 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/session_pb" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + 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::CX::V3::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::CX::V3::DetectIntentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::DetectIntentResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the server_streaming_detect_intent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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. + # + # @yieldparam chunk [::String] The chunk of data received during server streaming. + # + # @return [::Gapic::Rest::TransportOperation] + def server_streaming_detect_intent(request_pb, options = nil, &) + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_server_streaming_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: "server_streaming_detect_intent", + options: options, + is_server_streaming: true, + & + ) + ::Gapic::Rest::TransportOperation.new response + end + + ## + # Baseline implementation for the match_intent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::MatchIntentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse] + # A result object deserialized from the server's reply + def match_intent request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_match_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: "match_intent", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the fulfill_intent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::FulfillIntentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse] + # A result object deserialized from the server's reply + def fulfill_intent request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_fulfill_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: "fulfill_intent", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the submit_answer_feedback REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::AnswerFeedback] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback] + # A result object deserialized from the server's reply + def submit_answer_feedback request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_submit_answer_feedback_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "submit_answer_feedback", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback.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::CX::V3::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: "/v3/{session}:detectIntent", + body: "*", + matches: [ + ["session", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v3/{session}:detectIntent", + body: "*", + matches: [ + ["session", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the server_streaming_detect_intent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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_server_streaming_detect_intent_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{session}:serverStreamingDetectIntent", + body: "*", + matches: [ + ["session", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v3/{session}:serverStreamingDetectIntent", + body: "*", + matches: [ + ["session", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the match_intent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_match_intent_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{session}:matchIntent", + body: "*", + matches: [ + ["session", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v3/{session}:matchIntent", + body: "*", + matches: [ + ["session", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the fulfill_intent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_fulfill_intent_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{match_intent_request.session}:fulfillIntent", + body: "*", + matches: [ + ["match_intent_request.session", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v3/{match_intent_request.session}:fulfillIntent", + body: "*", + matches: [ + ["match_intent_request.session", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the submit_answer_feedback REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_submit_answer_feedback_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{session}:submitAnswerFeedback", + body: "*", + matches: [ + ["session", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_case_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_case_pb.rb new file mode 100644 index 000000000000..3f95787e1a0f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_case_pb.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/test_case.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/cx/v3/flow_pb' +require 'google/cloud/dialogflow/cx/v3/intent_pb' +require 'google/cloud/dialogflow/cx/v3/page_pb' +require 'google/cloud/dialogflow/cx/v3/response_message_pb' +require 'google/cloud/dialogflow/cx/v3/session_pb' +require 'google/cloud/dialogflow/cx/v3/transition_route_group_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_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/cx/v3/test_case.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/flow.proto\x1a*google/cloud/dialogflow/cx/v3/intent.proto\x1a(google/cloud/dialogflow/cx/v3/page.proto\x1a\x34google/cloud/dialogflow/cx/v3/response_message.proto\x1a+google/cloud/dialogflow/cx/v3/session.proto\x1a:google/cloud/dialogflow/cx/v3/transition_route_group.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xdf\x03\n\x08TestCase\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04tags\x18\x02 \x03(\t\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05notes\x18\x04 \x01(\t\x12>\n\x0btest_config\x18\r \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.TestConfig\x12U\n\x1ctest_case_conversation_turns\x18\x05 \x03(\x0b\x32/.google.cloud.dialogflow.cx.v3.ConversationTurn\x12\x36\n\rcreation_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x10last_test_result\x18\x0c \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.TestCaseResult:u\xea\x41r\n\"dialogflow.googleapis.com/TestCase\x12Lprojects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}\"\xab\x03\n\x0eTestCaseResult\x12\x0c\n\x04name\x18\x01 \x01(\t\x12?\n\x0b\x65nvironment\x18\x02 \x01(\tB*\xfa\x41\'\n%dialogflow.googleapis.com/Environment\x12K\n\x12\x63onversation_turns\x18\x03 \x03(\x0b\x32/.google.cloud.dialogflow.cx.v3.ConversationTurn\x12>\n\x0btest_result\x18\x04 \x01(\x0e\x32).google.cloud.dialogflow.cx.v3.TestResult\x12-\n\ttest_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp:\x8d\x01\xea\x41\x89\x01\n(dialogflow.googleapis.com/TestCaseResult\x12]projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}\"\x8f\x01\n\nTestConfig\x12\x1b\n\x13tracking_parameters\x18\x01 \x03(\t\x12\x31\n\x04\x66low\x18\x02 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12\x31\n\x04page\x18\x03 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Page\"\xbf\x06\n\x10\x43onversationTurn\x12M\n\nuser_input\x18\x01 \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput\x12`\n\x14virtual_agent_output\x18\x02 \x01(\x0b\x32\x42.google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput\x1a\xba\x01\n\tUserInput\x12\x38\n\x05input\x18\x05 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.QueryInput\x12\x34\n\x13injected_parameters\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x1a\n\x12is_webhook_enabled\x18\x03 \x01(\x08\x12!\n\x19\x65nable_sentiment_analysis\x18\x07 \x01(\x08\x1a\xbc\x03\n\x12VirtualAgentOutput\x12\x33\n\x12session_parameters\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12J\n\x0b\x64ifferences\x18\x05 \x03(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.TestRunDifferenceB\x03\xe0\x41\x03\x12\x38\n\x0f\x64iagnostic_info\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructB\x06\xe0\x41\x02\xe0\x41\x04\x12?\n\x10triggered_intent\x18\x07 \x01(\x0b\x32%.google.cloud.dialogflow.cx.v3.Intent\x12\x39\n\x0c\x63urrent_page\x18\x08 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.Page\x12K\n\x0etext_responses\x18\t \x03(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.ResponseMessage.Text\x12\"\n\x06status\x18\n \x01(\x0b\x32\x12.google.rpc.Status\"\xd7\x01\n\x11TestRunDifference\x12G\n\x04type\x18\x01 \x01(\x0e\x32\x39.google.cloud.dialogflow.cx.v3.TestRunDifference.DiffType\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\"d\n\x08\x44iffType\x12\x19\n\x15\x44IFF_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06INTENT\x10\x01\x12\x08\n\x04PAGE\x10\x02\x12\x0e\n\nPARAMETERS\x10\x03\x12\r\n\tUTTERANCE\x10\x04\x12\x08\n\x04\x46LOW\x10\x05\"\xf3\x04\n\x12TransitionCoverage\x12Q\n\x0btransitions\x18\x01 \x03(\x0b\x32<.google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition\x12\x16\n\x0e\x63overage_score\x18\x02 \x01(\x02\x1a\x82\x01\n\x0eTransitionNode\x12\x33\n\x04page\x18\x01 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.PageH\x00\x12\x33\n\x04\x66low\x18\x02 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.FlowH\x00\x42\x06\n\x04kind\x1a\xec\x02\n\nTransition\x12P\n\x06source\x18\x01 \x01(\x0b\x32@.google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode\x12\r\n\x05index\x18\x04 \x01(\x05\x12P\n\x06target\x18\x02 \x01(\x0b\x32@.google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode\x12\x0f\n\x07\x63overed\x18\x03 \x01(\x08\x12J\n\x10transition_route\x18\x05 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.TransitionRouteH\x00\x12\x44\n\revent_handler\x18\x06 \x01(\x0b\x32+.google.cloud.dialogflow.cx.v3.EventHandlerH\x00\x42\x08\n\x06\x64\x65tail\"\xcd\x03\n\x1cTransitionRouteGroupCoverage\x12W\n\tcoverages\x18\x01 \x03(\x0b\x32\x44.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage\x12\x16\n\x0e\x63overage_score\x18\x02 \x01(\x02\x1a\xbb\x02\n\x08\x43overage\x12H\n\x0broute_group\x18\x01 \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.TransitionRouteGroup\x12\x64\n\x0btransitions\x18\x02 \x03(\x0b\x32O.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition\x12\x16\n\x0e\x63overage_score\x18\x03 \x01(\x02\x1ag\n\nTransition\x12H\n\x10transition_route\x18\x01 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.TransitionRoute\x12\x0f\n\x07\x63overed\x18\x02 \x01(\x08\"\xc1\x01\n\x0eIntentCoverage\x12\x45\n\x07intents\x18\x01 \x03(\x0b\x32\x34.google.cloud.dialogflow.cx.v3.IntentCoverage.Intent\x12\x16\n\x0e\x63overage_score\x18\x02 \x01(\x02\x1aP\n\x06Intent\x12\x35\n\x06intent\x18\x01 \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/Intent\x12\x0f\n\x07\x63overed\x18\x02 \x01(\x08\"\x97\x02\n\x18\x43\x61lculateCoverageRequest\x12\x36\n\x05\x61gent\x18\x03 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x12W\n\x04type\x18\x02 \x01(\x0e\x32\x44.google.cloud.dialogflow.cx.v3.CalculateCoverageRequest.CoverageTypeB\x03\xe0\x41\x02\"j\n\x0c\x43overageType\x12\x1d\n\x19\x43OVERAGE_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06INTENT\x10\x01\x12\x13\n\x0fPAGE_TRANSITION\x10\x02\x12\x1a\n\x16TRANSITION_ROUTE_GROUP\x10\x03\"\xda\x02\n\x19\x43\x61lculateCoverageResponse\x12\x33\n\x05\x61gent\x18\x05 \x01(\tB$\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x12H\n\x0fintent_coverage\x18\x02 \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.IntentCoverageH\x00\x12P\n\x13transition_coverage\x18\x04 \x01(\x0b\x32\x31.google.cloud.dialogflow.cx.v3.TransitionCoverageH\x00\x12[\n\x14route_group_coverage\x18\x06 \x01(\x0b\x32;.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverageH\x00\x42\x0f\n\rcoverage_type\"\x8e\x02\n\x14ListTestCasesRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/TestCase\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12N\n\x04view\x18\x04 \x01(\x0e\x32@.google.cloud.dialogflow.cx.v3.ListTestCasesRequest.TestCaseView\"C\n\x0cTestCaseView\x12\x1e\n\x1aTEST_CASE_VIEW_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x08\n\x04\x46ULL\x10\x02\"m\n\x15ListTestCasesResponse\x12;\n\ntest_cases\x18\x01 \x03(\x0b\x32\'.google.cloud.dialogflow.cx.v3.TestCase\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x94\x01\n\x1b\x42\x61tchDeleteTestCasesRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/TestCase\x12\x39\n\x05names\x18\x03 \x03(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/TestCase\"\x94\x01\n\x15\x43reateTestCaseRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/TestCase\x12?\n\ttest_case\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.cx.v3.TestCaseB\x03\xe0\x41\x02\"\x8e\x01\n\x15UpdateTestCaseRequest\x12?\n\ttest_case\x18\x01 \x01(\x0b\x32\'.google.cloud.dialogflow.cx.v3.TestCaseB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"N\n\x12GetTestCaseRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/TestCase\"\x92\x01\n\x12RunTestCaseRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/TestCase\x12\x42\n\x0b\x65nvironment\x18\x02 \x01(\tB-\xe0\x41\x01\xfa\x41\'\n%dialogflow.googleapis.com/Environment\"T\n\x13RunTestCaseResponse\x12=\n\x06result\x18\x02 \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.TestCaseResult\"\x15\n\x13RunTestCaseMetadata\"\xda\x01\n\x18\x42\x61tchRunTestCasesRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/TestCase\x12\x42\n\x0b\x65nvironment\x18\x02 \x01(\tB-\xe0\x41\x01\xfa\x41\'\n%dialogflow.googleapis.com/Environment\x12>\n\ntest_cases\x18\x03 \x03(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/TestCase\"[\n\x19\x42\x61tchRunTestCasesResponse\x12>\n\x07results\x18\x01 \x03(\x0b\x32-.google.cloud.dialogflow.cx.v3.TestCaseResult\"U\n\x19\x42\x61tchRunTestCasesMetadata\x12\x38\n\x06\x65rrors\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.cx.v3.TestError\"\x9a\x01\n\tTestError\x12:\n\ttest_case\x18\x01 \x01(\tB\'\xfa\x41$\n\"dialogflow.googleapis.com/TestCase\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12-\n\ttest_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x84\x01\n\x16ImportTestCasesRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/TestCase\x12\x11\n\x07gcs_uri\x18\x02 \x01(\tH\x00\x12\x11\n\x07\x63ontent\x18\x03 \x01(\x0cH\x00\x42\x08\n\x06source\"Q\n\x17ImportTestCasesResponse\x12\x36\n\x05names\x18\x01 \x03(\tB\'\xfa\x41$\n\"dialogflow.googleapis.com/TestCase\"W\n\x17ImportTestCasesMetadata\x12<\n\x06\x65rrors\x18\x01 \x03(\x0b\x32,.google.cloud.dialogflow.cx.v3.TestCaseError\"o\n\rTestCaseError\x12:\n\ttest_case\x18\x01 \x01(\x0b\x32\'.google.cloud.dialogflow.cx.v3.TestCase\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"\x9c\x02\n\x16\x45xportTestCasesRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/TestCase\x12\x11\n\x07gcs_uri\x18\x02 \x01(\tH\x00\x12U\n\x0b\x64\x61ta_format\x18\x03 \x01(\x0e\x32@.google.cloud.dialogflow.cx.v3.ExportTestCasesRequest.DataFormat\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\"=\n\nDataFormat\x12\x1b\n\x17\x44\x41TA_FORMAT_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42LOB\x10\x01\x12\x08\n\x04JSON\x10\x02\x42\r\n\x0b\x64\x65stination\"N\n\x17\x45xportTestCasesResponse\x12\x11\n\x07gcs_uri\x18\x01 \x01(\tH\x00\x12\x11\n\x07\x63ontent\x18\x02 \x01(\x0cH\x00\x42\r\n\x0b\x64\x65stination\"\x19\n\x17\x45xportTestCasesMetadata\"\x95\x01\n\x1aListTestCaseResultsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(dialogflow.googleapis.com/TestCaseResult\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\"\x80\x01\n\x1bListTestCaseResultsResponse\x12H\n\x11test_case_results\x18\x01 \x03(\x0b\x32-.google.cloud.dialogflow.cx.v3.TestCaseResult\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"Z\n\x18GetTestCaseResultRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(dialogflow.googleapis.com/TestCaseResult*A\n\nTestResult\x12\x1b\n\x17TEST_RESULT_UNSPECIFIED\x10\x00\x12\n\n\x06PASSED\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x32\x99\x15\n\tTestCases\x12\xc3\x01\n\rListTestCases\x12\x33.google.cloud.dialogflow.cx.v3.ListTestCasesRequest\x1a\x34.google.cloud.dialogflow.cx.v3.ListTestCasesResponse\"G\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x38\x12\x36/v3/{parent=projects/*/locations/*/agents/*}/testCases\x12\xc2\x01\n\x14\x42\x61tchDeleteTestCases\x12:.google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest\x1a\x16.google.protobuf.Empty\"V\xda\x41\x06parent\x82\xd3\xe4\x93\x02G\"B/v3/{parent=projects/*/locations/*/agents/*}/testCases:batchDelete:\x01*\x12\xb0\x01\n\x0bGetTestCase\x12\x31.google.cloud.dialogflow.cx.v3.GetTestCaseRequest\x1a\'.google.cloud.dialogflow.cx.v3.TestCase\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v3/{name=projects/*/locations/*/agents/*/testCases/*}\x12\xcd\x01\n\x0e\x43reateTestCase\x12\x34.google.cloud.dialogflow.cx.v3.CreateTestCaseRequest\x1a\'.google.cloud.dialogflow.cx.v3.TestCase\"\\\xda\x41\x10parent,test_case\x82\xd3\xe4\x93\x02\x43\"6/v3/{parent=projects/*/locations/*/agents/*}/testCases:\ttest_case\x12\xdc\x01\n\x0eUpdateTestCase\x12\x34.google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest\x1a\'.google.cloud.dialogflow.cx.v3.TestCase\"k\xda\x41\x15test_case,update_mask\x82\xd3\xe4\x93\x02M2@/v3/{test_case.name=projects/*/locations/*/agents/*/testCases/*}:\ttest_case\x12\xd3\x01\n\x0bRunTestCase\x12\x31.google.cloud.dialogflow.cx.v3.RunTestCaseRequest\x1a\x1d.google.longrunning.Operation\"r\xca\x41*\n\x13RunTestCaseResponse\x12\x13RunTestCaseMetadata\x82\xd3\xe4\x93\x02?\":/v3/{name=projects/*/locations/*/agents/*/testCases/*}:run:\x01*\x12\xf1\x01\n\x11\x42\x61tchRunTestCases\x12\x37.google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest\x1a\x1d.google.longrunning.Operation\"\x83\x01\xca\x41\x36\n\x19\x42\x61tchRunTestCasesResponse\x12\x19\x42\x61tchRunTestCasesMetadata\x82\xd3\xe4\x93\x02\x44\"?/v3/{parent=projects/*/locations/*/agents/*}/testCases:batchRun:\x01*\x12\xd7\x01\n\x11\x43\x61lculateCoverage\x12\x37.google.cloud.dialogflow.cx.v3.CalculateCoverageRequest\x1a\x38.google.cloud.dialogflow.cx.v3.CalculateCoverageResponse\"O\x82\xd3\xe4\x93\x02I\x12G/v3/{agent=projects/*/locations/*/agents/*}/testCases:calculateCoverage\x12\xe6\x01\n\x0fImportTestCases\x12\x35.google.cloud.dialogflow.cx.v3.ImportTestCasesRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41\x32\n\x17ImportTestCasesResponse\x12\x17ImportTestCasesMetadata\x82\xd3\xe4\x93\x02\x42\"=/v3/{parent=projects/*/locations/*/agents/*}/testCases:import:\x01*\x12\xe6\x01\n\x0f\x45xportTestCases\x12\x35.google.cloud.dialogflow.cx.v3.ExportTestCasesRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41\x32\n\x17\x45xportTestCasesResponse\x12\x17\x45xportTestCasesMetadata\x82\xd3\xe4\x93\x02\x42\"=/v3/{parent=projects/*/locations/*/agents/*}/testCases:export:\x01*\x12\xdf\x01\n\x13ListTestCaseResults\x12\x39.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest\x1a:.google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse\"Q\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x42\x12@/v3/{parent=projects/*/locations/*/agents/*/testCases/*}/results\x12\xcc\x01\n\x11GetTestCaseResult\x12\x37.google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest\x1a-.google.cloud.dialogflow.cx.v3.TestCaseResult\"O\xda\x41\x04name\x82\xd3\xe4\x93\x02\x42\x12@/v3/{name=projects/*/locations/*/agents/*/testCases/*/results/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xb0\x01\n!com.google.cloud.dialogflow.cx.v3B\rTestCaseProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.dialogflow.cx.v3.QueryInput", "google/cloud/dialogflow/cx/v3/session.proto"], + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ["google.cloud.dialogflow.cx.v3.Intent", "google/cloud/dialogflow/cx/v3/intent.proto"], + ["google.cloud.dialogflow.cx.v3.Page", "google/cloud/dialogflow/cx/v3/page.proto"], + ["google.cloud.dialogflow.cx.v3.ResponseMessage.Text", "google/cloud/dialogflow/cx/v3/response_message.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.cloud.dialogflow.cx.v3.Flow", "google/cloud/dialogflow/cx/v3/flow.proto"], + ["google.cloud.dialogflow.cx.v3.TransitionRouteGroup", "google/cloud/dialogflow/cx/v3/transition_route_group.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + TestCase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TestCase").msgclass + TestCaseResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TestCaseResult").msgclass + TestConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TestConfig").msgclass + ConversationTurn = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ConversationTurn").msgclass + ConversationTurn::UserInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput").msgclass + ConversationTurn::VirtualAgentOutput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput").msgclass + TestRunDifference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TestRunDifference").msgclass + TestRunDifference::DiffType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TestRunDifference.DiffType").enummodule + TransitionCoverage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TransitionCoverage").msgclass + TransitionCoverage::TransitionNode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode").msgclass + TransitionCoverage::Transition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition").msgclass + TransitionRouteGroupCoverage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage").msgclass + TransitionRouteGroupCoverage::Coverage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage").msgclass + TransitionRouteGroupCoverage::Coverage::Transition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition").msgclass + IntentCoverage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.IntentCoverage").msgclass + IntentCoverage::Intent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.IntentCoverage.Intent").msgclass + CalculateCoverageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CalculateCoverageRequest").msgclass + CalculateCoverageRequest::CoverageType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CalculateCoverageRequest.CoverageType").enummodule + CalculateCoverageResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CalculateCoverageResponse").msgclass + ListTestCasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListTestCasesRequest").msgclass + ListTestCasesRequest::TestCaseView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListTestCasesRequest.TestCaseView").enummodule + ListTestCasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListTestCasesResponse").msgclass + BatchDeleteTestCasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest").msgclass + CreateTestCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateTestCaseRequest").msgclass + UpdateTestCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest").msgclass + GetTestCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetTestCaseRequest").msgclass + RunTestCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RunTestCaseRequest").msgclass + RunTestCaseResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RunTestCaseResponse").msgclass + RunTestCaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RunTestCaseMetadata").msgclass + BatchRunTestCasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest").msgclass + BatchRunTestCasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse").msgclass + BatchRunTestCasesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata").msgclass + TestError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TestError").msgclass + ImportTestCasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportTestCasesRequest").msgclass + ImportTestCasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportTestCasesResponse").msgclass + ImportTestCasesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata").msgclass + TestCaseError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TestCaseError").msgclass + ExportTestCasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportTestCasesRequest").msgclass + ExportTestCasesRequest::DataFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportTestCasesRequest.DataFormat").enummodule + ExportTestCasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportTestCasesResponse").msgclass + ExportTestCasesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata").msgclass + ListTestCaseResultsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest").msgclass + ListTestCaseResultsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse").msgclass + GetTestCaseResultRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest").msgclass + TestResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TestResult").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_case_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_case_services_pb.rb new file mode 100644 index 000000000000..0a9f5f680348 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_case_services_pb.rb @@ -0,0 +1,110 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/cx/v3/test_case.proto for package 'Google.Cloud.Dialogflow.CX.V3' +# 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/cx/v3/test_case_pb' + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module TestCases + # Service for managing [Test Cases][google.cloud.dialogflow.cx.v3.TestCase] and + # [Test Case Results][google.cloud.dialogflow.cx.v3.TestCaseResult]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.cx.v3.TestCases' + + # Fetches a list of test cases for a given agent. + rpc :ListTestCases, ::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest, ::Google::Cloud::Dialogflow::CX::V3::ListTestCasesResponse + # Batch deletes test cases. + rpc :BatchDeleteTestCases, ::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest, ::Google::Protobuf::Empty + # Gets a test case. + rpc :GetTestCase, ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest, ::Google::Cloud::Dialogflow::CX::V3::TestCase + # Creates a test case for the given agent. + rpc :CreateTestCase, ::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest, ::Google::Cloud::Dialogflow::CX::V3::TestCase + # Updates the specified test case. + rpc :UpdateTestCase, ::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest, ::Google::Cloud::Dialogflow::CX::V3::TestCase + # Kicks off a test case run. + # + # 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`: + # [RunTestCaseMetadata][google.cloud.dialogflow.cx.v3.RunTestCaseMetadata] + # - `response`: + # [RunTestCaseResponse][google.cloud.dialogflow.cx.v3.RunTestCaseResponse] + rpc :RunTestCase, ::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest, ::Google::Longrunning::Operation + # Kicks off a batch run of test cases. + # + # 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`: + # [BatchRunTestCasesMetadata][google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata] + # - `response`: + # [BatchRunTestCasesResponse][google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse] + rpc :BatchRunTestCases, ::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest, ::Google::Longrunning::Operation + # Calculates the test coverage for an agent. + rpc :CalculateCoverage, ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest, ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse + # Imports the test cases from a Cloud Storage bucket or a local file. It + # always creates new test cases and won't overwrite any existing ones. The + # provided ID in the imported test case is neglected. + # + # 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`: + # [ImportTestCasesMetadata][google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata] + # - `response`: + # [ImportTestCasesResponse][google.cloud.dialogflow.cx.v3.ImportTestCasesResponse] + rpc :ImportTestCases, ::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest, ::Google::Longrunning::Operation + # Exports the test cases under the agent to a Cloud Storage bucket or a local + # file. Filter can be applied to export a subset of test cases. + # + # 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`: + # [ExportTestCasesMetadata][google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata] + # - `response`: + # [ExportTestCasesResponse][google.cloud.dialogflow.cx.v3.ExportTestCasesResponse] + rpc :ExportTestCases, ::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest, ::Google::Longrunning::Operation + # Fetches the list of run results for the given test case. A maximum of 100 + # results are kept for each test case. + rpc :ListTestCaseResults, ::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsResponse + # Gets a test case result. + rpc :GetTestCaseResult, ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest, ::Google::Cloud::Dialogflow::CX::V3::TestCaseResult + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases.rb new file mode 100644 index 000000000000..378ea6331d9a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases.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/cx/v3/version" + +require "google/cloud/dialogflow/cx/v3/test_cases/credentials" +require "google/cloud/dialogflow/cx/v3/test_cases/paths" +require "google/cloud/dialogflow/cx/v3/test_cases/operations" +require "google/cloud/dialogflow/cx/v3/test_cases/client" +require "google/cloud/dialogflow/cx/v3/test_cases/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::TestCase Test Cases} and + # {::Google::Cloud::Dialogflow::CX::V3::TestCaseResult Test Case Results}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/cx/v3/test_cases" + # client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/cx/v3/test_cases/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + module TestCases + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "test_cases", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/test_cases/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb new file mode 100644 index 000000000000..a43f945cb382 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb @@ -0,0 +1,1729 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/test_case_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module TestCases + ## + # Client for the TestCases service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::TestCase Test Cases} and + # {::Google::Cloud::Dialogflow::CX::V3::TestCaseResult Test Case Results}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :test_cases_stub + + ## + # Configure the TestCases Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TestCases clients + # ::Google::Cloud::Dialogflow::CX::V3::TestCases::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", "CX", "V3"] + 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 TestCases 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::CX::V3::TestCases::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 + @test_cases_stub.universe_domain + end + + ## + # Create a new TestCases client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TestCases 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/cx/v3/test_case_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 + + @test_cases_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::CX::V3::TestCases::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 + ) + + @test_cases_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 = @test_cases_stub.endpoint + config.universe_domain = @test_cases_stub.universe_domain + config.logger = @test_cases_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TestCases::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 + @test_cases_stub.logger + end + + # Service calls + + ## + # Fetches a list of test cases for a given agent. + # + # @overload list_test_cases(request, options = nil) + # Pass arguments to `list_test_cases` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_test_cases(parent: nil, page_size: nil, page_token: nil, view: nil) + # Pass arguments to `list_test_cases` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 pages for. + # Format: `projects//locations//agents/`. + # @param page_size [::Integer] + # The maximum number of items to return in a single page. By default 20. + # Note that when TestCaseView = FULL, the maximum page size allowed is 20. + # When TestCaseView = BASIC, the maximum page size allowed is 500. + # @param page_token [::String] + # The next_page_token value returned from a previous list request. + # @param view [::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest::TestCaseView] + # Specifies whether response should include all fields or just the metadata. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCase>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCase>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest.new + # + # # Call the list_test_cases method. + # result = client.list_test_cases request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::TestCase. + # p item + # end + # + def list_test_cases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest + + # Converts hash and nil to 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_test_cases.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_test_cases.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_test_cases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.call_rpc :list_test_cases, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @test_cases_stub, :list_test_cases, 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 + + ## + # Batch deletes test cases. + # + # @overload batch_delete_test_cases(request, options = nil) + # Pass arguments to `batch_delete_test_cases` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_test_cases(parent: nil, names: nil) + # Pass arguments to `batch_delete_test_cases` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 delete test cases from. + # Format: `projects//locations//agents/`. + # @param names [::Array<::String>] + # Required. Format of test case names: + # `projects//locations//agents//testCases/`. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest.new + # + # # Call the batch_delete_test_cases method. + # result = client.batch_delete_test_cases request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def batch_delete_test_cases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest + + # Converts hash and nil to 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_test_cases.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_test_cases.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_delete_test_cases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.call_rpc :batch_delete_test_cases, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a test case. + # + # @overload get_test_case(request, options = nil) + # Pass arguments to `get_test_case` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_test_case(name: nil) + # Pass arguments to `get_test_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 testcase. + # Format: + # `projects//locations//agents//testCases/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::TestCase] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest.new + # + # # Call the get_test_case method. + # result = client.get_test_case request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. + # p result + # + def get_test_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest + + # Converts hash and nil to 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_test_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_test_case.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_test_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.call_rpc :get_test_case, request, 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 test case for the given agent. + # + # @overload create_test_case(request, options = nil) + # Pass arguments to `create_test_case` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_test_case(parent: nil, test_case: nil) + # Pass arguments to `create_test_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 the test case for. + # Format: `projects//locations//agents/`. + # @param test_case [::Google::Cloud::Dialogflow::CX::V3::TestCase, ::Hash] + # Required. The test case to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::TestCase] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest.new + # + # # Call the create_test_case method. + # result = client.create_test_case request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. + # p result + # + def create_test_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest + + # Converts hash and nil to 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_test_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_test_case.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_test_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.call_rpc :create_test_case, request, 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 test case. + # + # @overload update_test_case(request, options = nil) + # Pass arguments to `update_test_case` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_test_case(test_case: nil, update_mask: nil) + # Pass arguments to `update_test_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param test_case [::Google::Cloud::Dialogflow::CX::V3::TestCase, ::Hash] + # Required. The test case to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The mask to specify which fields should be updated. The + # {::Google::Cloud::Dialogflow::CX::V3::TestCase#creation_time `creationTime`} and + # {::Google::Cloud::Dialogflow::CX::V3::TestCase#last_test_result `lastTestResult`} + # cannot be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::TestCase] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest.new + # + # # Call the update_test_case method. + # result = client.update_test_case request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. + # p result + # + def update_test_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest + + # Converts hash and nil to 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_test_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.test_case&.name + header_params["test_case.name"] = request.test_case.name + end + + request_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_test_case.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_test_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.call_rpc :update_test_case, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Kicks off a test case run. + # + # 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::CX::V3::RunTestCaseMetadata RunTestCaseMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::RunTestCaseResponse RunTestCaseResponse} + # + # @overload run_test_case(request, options = nil) + # Pass arguments to `run_test_case` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload run_test_case(name: nil, environment: nil) + # Pass arguments to `run_test_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Format of test case name to run: + # `projects//locations//agents//testCases/`. + # @param environment [::String] + # Optional. Environment name. If not set, draft environment is assumed. + # Format: + # `projects//locations//agents//environments/`. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest.new + # + # # Call the run_test_case method. + # result = client.run_test_case request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def run_test_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.run_test_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.run_test_case.timeout, + metadata: metadata, + retry_policy: @config.rpcs.run_test_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.call_rpc :run_test_case, 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 + + ## + # Kicks off a batch run of test cases. + # + # 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::CX::V3::BatchRunTestCasesMetadata BatchRunTestCasesMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesResponse BatchRunTestCasesResponse} + # + # @overload batch_run_test_cases(request, options = nil) + # Pass arguments to `batch_run_test_cases` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_run_test_cases(parent: nil, environment: nil, test_cases: nil) + # Pass arguments to `batch_run_test_cases` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Agent name. Format: + # `projects//locations//agents/`. + # @param environment [::String] + # Optional. If not set, draft environment is assumed. Format: + # `projects//locations//agents//environments/`. + # @param test_cases [::Array<::String>] + # Required. Format: + # `projects//locations//agents//testCases/`. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest.new + # + # # Call the batch_run_test_cases method. + # result = client.batch_run_test_cases request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_run_test_cases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest + + # Converts hash and nil to 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_run_test_cases.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_run_test_cases.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_run_test_cases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.call_rpc :batch_run_test_cases, 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 + + ## + # Calculates the test coverage for an agent. + # + # @overload calculate_coverage(request, options = nil) + # Pass arguments to `calculate_coverage` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload calculate_coverage(agent: nil, type: nil) + # Pass arguments to `calculate_coverage` via keyword arguments. Note that at + # least one keyword argument is 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 [::String] + # Required. The agent to calculate coverage for. + # Format: `projects//locations//agents/`. + # @param type [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest::CoverageType] + # Required. The type of coverage requested. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest.new + # + # # Call the calculate_coverage method. + # result = client.calculate_coverage request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse. + # p result + # + def calculate_coverage request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.calculate_coverage.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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 + header_params["agent"] = request.agent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.calculate_coverage.timeout, + metadata: metadata, + retry_policy: @config.rpcs.calculate_coverage.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.call_rpc :calculate_coverage, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Imports the test cases from a Cloud Storage bucket or a local file. It + # always creates new test cases and won't overwrite any existing ones. The + # provided ID in the imported test case is neglected. + # + # 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::CX::V3::ImportTestCasesMetadata ImportTestCasesMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesResponse ImportTestCasesResponse} + # + # @overload import_test_cases(request, options = nil) + # Pass arguments to `import_test_cases` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_test_cases(parent: nil, gcs_uri: nil, content: nil) + # Pass arguments to `import_test_cases` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 import test cases to. + # Format: `projects//locations//agents/`. + # @param gcs_uri [::String] + # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + # to import test cases from. The format of this URI must be + # `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: `gcs_uri`, `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 content [::String] + # Uncompressed raw byte content for test cases. + # + # Note: The following parameters are mutually exclusive: `content`, `gcs_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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest.new + # + # # Call the import_test_cases method. + # result = client.import_test_cases request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_test_cases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest + + # Converts hash and nil to 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_test_cases.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_test_cases.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_test_cases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.call_rpc :import_test_cases, 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 test cases under the agent to a Cloud Storage bucket or a local + # file. Filter can be applied to export a subset of test cases. + # + # 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::CX::V3::ExportTestCasesMetadata ExportTestCasesMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesResponse ExportTestCasesResponse} + # + # @overload export_test_cases(request, options = nil) + # Pass arguments to `export_test_cases` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_test_cases(parent: nil, gcs_uri: nil, data_format: nil, filter: nil) + # Pass arguments to `export_test_cases` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 where to export test cases from. + # Format: `projects//locations//agents/`. + # @param gcs_uri [::String] + # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to + # export the test cases to. The format of this URI must be + # `gs:///`. If unspecified, the serialized test + # cases 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). + # @param data_format [::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest::DataFormat] + # The data format of the exported test cases. If not specified, `BLOB` is + # assumed. + # @param filter [::String] + # The filter expression used to filter exported test cases, see + # [API Filtering](https://aip.dev/160). The expression is case insensitive + # and supports the following syntax: + # + # name = [OR name = ] ... + # + # For example: + # + # * "name = t1 OR name = t2" matches the test case with the exact resource + # name "t1" or "t2". + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest.new + # + # # Call the export_test_cases method. + # result = client.export_test_cases request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_test_cases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest + + # Converts hash and nil to 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_test_cases.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_test_cases.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_test_cases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.call_rpc :export_test_cases, 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 + + ## + # Fetches the list of run results for the given test case. A maximum of 100 + # results are kept for each test case. + # + # @overload list_test_case_results(request, options = nil) + # Pass arguments to `list_test_case_results` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_test_case_results(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_test_case_results` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The test case to list results for. + # Format: + # `projects//locations//agents//testCases/`. + # Specify a `-` as a wildcard for TestCase ID to + # list results across multiple test cases. + # @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. + # @param filter [::String] + # The filter expression used to filter test case results. See + # [API Filtering](https://aip.dev/160). + # + # The expression is case insensitive. Only 'AND' is supported for logical + # operators. The supported syntax is listed below in detail: + # + # [AND ] ... + # [AND latest] + # + # The supported fields and operators are: + # field operator + # `environment` `=`, `IN` (Use value `draft` for draft environment) + # `test_time` `>`, `<` + # + # `latest` only returns the latest test result in all results for each test + # case. + # + # Examples: + # * "environment=draft AND latest" matches the latest test result for each + # test case in the draft environment. + # * "environment IN (e1,e2)" matches any test case results with an + # environment resource name of either "e1" or "e2". + # * "test_time > 1602540713" matches any test case results with test time + # later than a unix timestamp in seconds 1602540713. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest.new + # + # # Call the list_test_case_results method. + # result = client.list_test_case_results request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::TestCaseResult. + # p item + # end + # + def list_test_case_results request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest + + # Converts hash and nil to 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_test_case_results.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_test_case_results.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_test_case_results.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.call_rpc :list_test_case_results, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @test_cases_stub, :list_test_case_results, 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 + + ## + # Gets a test case result. + # + # @overload get_test_case_result(request, options = nil) + # Pass arguments to `get_test_case_result` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_test_case_result(name: nil) + # Pass arguments to `get_test_case_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 name [::String] + # Required. The name of the testcase. + # Format: + # `projects//locations//agents//testCases//results/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::TestCaseResult] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TestCaseResult] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest.new + # + # # Call the get_test_case_result method. + # result = client.get_test_case_result request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCaseResult. + # p result + # + def get_test_case_result request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest + + # Converts hash and nil to 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_test_case_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_test_case_result.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_test_case_result.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.call_rpc :get_test_case_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 TestCases API. + # + # This class represents the configuration for TestCases, + # 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::CX::V3::TestCases::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_test_cases to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_test_cases.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_test_cases.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::CX::V3::TestCases::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 TestCases API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_test_cases` + # @return [::Gapic::Config::Method] + # + attr_reader :list_test_cases + ## + # RPC-specific configuration for `batch_delete_test_cases` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_delete_test_cases + ## + # RPC-specific configuration for `get_test_case` + # @return [::Gapic::Config::Method] + # + attr_reader :get_test_case + ## + # RPC-specific configuration for `create_test_case` + # @return [::Gapic::Config::Method] + # + attr_reader :create_test_case + ## + # RPC-specific configuration for `update_test_case` + # @return [::Gapic::Config::Method] + # + attr_reader :update_test_case + ## + # RPC-specific configuration for `run_test_case` + # @return [::Gapic::Config::Method] + # + attr_reader :run_test_case + ## + # RPC-specific configuration for `batch_run_test_cases` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_run_test_cases + ## + # RPC-specific configuration for `calculate_coverage` + # @return [::Gapic::Config::Method] + # + attr_reader :calculate_coverage + ## + # RPC-specific configuration for `import_test_cases` + # @return [::Gapic::Config::Method] + # + attr_reader :import_test_cases + ## + # RPC-specific configuration for `export_test_cases` + # @return [::Gapic::Config::Method] + # + attr_reader :export_test_cases + ## + # RPC-specific configuration for `list_test_case_results` + # @return [::Gapic::Config::Method] + # + attr_reader :list_test_case_results + ## + # RPC-specific configuration for `get_test_case_result` + # @return [::Gapic::Config::Method] + # + attr_reader :get_test_case_result + + # @private + def initialize parent_rpcs = nil + list_test_cases_config = parent_rpcs.list_test_cases if parent_rpcs.respond_to? :list_test_cases + @list_test_cases = ::Gapic::Config::Method.new list_test_cases_config + batch_delete_test_cases_config = parent_rpcs.batch_delete_test_cases if parent_rpcs.respond_to? :batch_delete_test_cases + @batch_delete_test_cases = ::Gapic::Config::Method.new batch_delete_test_cases_config + get_test_case_config = parent_rpcs.get_test_case if parent_rpcs.respond_to? :get_test_case + @get_test_case = ::Gapic::Config::Method.new get_test_case_config + create_test_case_config = parent_rpcs.create_test_case if parent_rpcs.respond_to? :create_test_case + @create_test_case = ::Gapic::Config::Method.new create_test_case_config + update_test_case_config = parent_rpcs.update_test_case if parent_rpcs.respond_to? :update_test_case + @update_test_case = ::Gapic::Config::Method.new update_test_case_config + run_test_case_config = parent_rpcs.run_test_case if parent_rpcs.respond_to? :run_test_case + @run_test_case = ::Gapic::Config::Method.new run_test_case_config + batch_run_test_cases_config = parent_rpcs.batch_run_test_cases if parent_rpcs.respond_to? :batch_run_test_cases + @batch_run_test_cases = ::Gapic::Config::Method.new batch_run_test_cases_config + calculate_coverage_config = parent_rpcs.calculate_coverage if parent_rpcs.respond_to? :calculate_coverage + @calculate_coverage = ::Gapic::Config::Method.new calculate_coverage_config + import_test_cases_config = parent_rpcs.import_test_cases if parent_rpcs.respond_to? :import_test_cases + @import_test_cases = ::Gapic::Config::Method.new import_test_cases_config + export_test_cases_config = parent_rpcs.export_test_cases if parent_rpcs.respond_to? :export_test_cases + @export_test_cases = ::Gapic::Config::Method.new export_test_cases_config + list_test_case_results_config = parent_rpcs.list_test_case_results if parent_rpcs.respond_to? :list_test_case_results + @list_test_case_results = ::Gapic::Config::Method.new list_test_case_results_config + get_test_case_result_config = parent_rpcs.get_test_case_result if parent_rpcs.respond_to? :get_test_case_result + @get_test_case_result = ::Gapic::Config::Method.new get_test_case_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/credentials.rb new file mode 100644 index 000000000000..d8b1d5ef27e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module TestCases + # Credentials for the TestCases 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb new file mode 100644 index 000000000000..b94f6a54e81e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/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 CX + module V3 + module TestCases + # 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 TestCases 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 TestCases 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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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. + # * `: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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb new file mode 100644 index 000000000000..ed253c1cb083 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/paths.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 CX + module V3 + module TestCases + # Path helper methods for the TestCases API. + module Paths + ## + # Create a fully-qualified Agent resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # + # @return [::String] + def agent_path project:, location:, agent: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}" + end + + ## + # Create a fully-qualified EntityType resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param entity_type [String] + # + # @return [::String] + def entity_type_path project:, location:, agent:, entity_type: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/entityTypes/#{entity_type}" + end + + ## + # Create a fully-qualified Environment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param environment [String] + # + # @return [::String] + def environment_path project:, location:, agent:, environment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}" + end + + ## + # Create a fully-qualified Flow resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # + # @return [::String] + def flow_path project:, location:, agent:, flow: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}" + end + + ## + # Create a fully-qualified Generator resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/generators/{generator}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param generator [String] + # + # @return [::String] + def generator_path project:, location:, agent:, generator: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/generators/#{generator}" + end + + ## + # Create a fully-qualified Intent resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/intents/{intent}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param intent [String] + # + # @return [::String] + def intent_path project:, location:, agent:, intent: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/intents/#{intent}" + end + + ## + # Create a fully-qualified Page resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # @param page [String] + # + # @return [::String] + def page_path project:, location:, agent:, flow:, page: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/pages/#{page}" + end + + ## + # Create a fully-qualified Playbook resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param playbook [String] + # + # @return [::String] + def playbook_path project:, location:, agent:, playbook: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}" + end + + ## + # Create a fully-qualified TestCase resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param test_case [String] + # + # @return [::String] + def test_case_path project:, location:, agent:, test_case: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/testCases/#{test_case}" + end + + ## + # Create a fully-qualified TestCaseResult resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param test_case [String] + # @param result [String] + # + # @return [::String] + def test_case_result_path project:, location:, agent:, test_case:, result: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "test_case cannot contain /" if test_case.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/testCases/#{test_case}/results/#{result}" + end + + ## + # Create a fully-qualified Tool resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param tool [String] + # + # @return [::String] + def tool_path project:, location:, agent:, tool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/tools/#{tool}" + end + + ## + # Create a fully-qualified TransitionRouteGroup resource string. + # + # @overload transition_route_group_path(project:, location:, agent:, flow:, transition_route_group:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # @param transition_route_group [String] + # + # @overload transition_route_group_path(project:, location:, agent:, transition_route_group:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param transition_route_group [String] + # + # @return [::String] + def transition_route_group_path **args + resources = { + "agent:flow:location:project:transition_route_group" => (proc do |project:, location:, agent:, flow:, transition_route_group:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/transitionRouteGroups/#{transition_route_group}" + end), + "agent:location:project:transition_route_group" => (proc do |project:, location:, agent:, transition_route_group:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/transitionRouteGroups/#{transition_route_group}" + 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 Webhook resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param webhook [String] + # + # @return [::String] + def webhook_path project:, location:, agent:, webhook: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/webhooks/#{webhook}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest.rb new file mode 100644 index 000000000000..4af16853c495 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/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/cx/v3/version" +require "google/cloud/dialogflow/cx/v3/bindings_override" + +require "google/cloud/dialogflow/cx/v3/test_cases/credentials" +require "google/cloud/dialogflow/cx/v3/test_cases/paths" +require "google/cloud/dialogflow/cx/v3/test_cases/rest/operations" +require "google/cloud/dialogflow/cx/v3/test_cases/rest/client" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::TestCase Test Cases} and + # {::Google::Cloud::Dialogflow::CX::V3::TestCaseResult Test Case Results}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/cx/v3/test_cases/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + module TestCases + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/test_cases/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb new file mode 100644 index 000000000000..40efd42e2e18 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb @@ -0,0 +1,1610 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/test_case_pb" +require "google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module TestCases + module Rest + ## + # REST client for the TestCases service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::TestCase Test Cases} and + # {::Google::Cloud::Dialogflow::CX::V3::TestCaseResult Test Case Results}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :test_cases_stub + + ## + # Configure the TestCases Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TestCases clients + # ::Google::Cloud::Dialogflow::CX::V3::TestCases::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", "CX", "V3"] + 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 TestCases 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::CX::V3::TestCases::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 + @test_cases_stub.universe_domain + end + + ## + # Create a new TestCases REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TestCases 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::CX::V3::TestCases::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 + + @test_cases_stub = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @test_cases_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 = @test_cases_stub.endpoint + config.universe_domain = @test_cases_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @test_cases_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TestCases::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 + @test_cases_stub.logger + end + + # Service calls + + ## + # Fetches a list of test cases for a given agent. + # + # @overload list_test_cases(request, options = nil) + # Pass arguments to `list_test_cases` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_test_cases(parent: nil, page_size: nil, page_token: nil, view: nil) + # Pass arguments to `list_test_cases` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 pages for. + # Format: `projects//locations//agents/`. + # @param page_size [::Integer] + # The maximum number of items to return in a single page. By default 20. + # Note that when TestCaseView = FULL, the maximum page size allowed is 20. + # When TestCaseView = BASIC, the maximum page size allowed is 500. + # @param page_token [::String] + # The next_page_token value returned from a previous list request. + # @param view [::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest::TestCaseView] + # Specifies whether response should include all fields or just the metadata. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCase>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCase>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest.new + # + # # Call the list_test_cases method. + # result = client.list_test_cases request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::TestCase. + # p item + # end + # + def list_test_cases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest + + # Converts hash and nil to an 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_test_cases.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_test_cases.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_test_cases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.list_test_cases request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @test_cases_stub, :list_test_cases, "test_cases", 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 + + ## + # Batch deletes test cases. + # + # @overload batch_delete_test_cases(request, options = nil) + # Pass arguments to `batch_delete_test_cases` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_test_cases(parent: nil, names: nil) + # Pass arguments to `batch_delete_test_cases` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 delete test cases from. + # Format: `projects//locations//agents/`. + # @param names [::Array<::String>] + # Required. Format of test case names: + # `projects//locations//agents//testCases/`. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest.new + # + # # Call the batch_delete_test_cases method. + # result = client.batch_delete_test_cases request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def batch_delete_test_cases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest + + # Converts hash and nil to an 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_test_cases.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_test_cases.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_delete_test_cases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.batch_delete_test_cases request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a test case. + # + # @overload get_test_case(request, options = nil) + # Pass arguments to `get_test_case` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_test_case(name: nil) + # Pass arguments to `get_test_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 testcase. + # Format: + # `projects//locations//agents//testCases/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::TestCase] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest.new + # + # # Call the get_test_case method. + # result = client.get_test_case request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. + # p result + # + def get_test_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest + + # Converts hash and nil to an 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_test_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_test_case.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_test_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.get_test_case request, 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 test case for the given agent. + # + # @overload create_test_case(request, options = nil) + # Pass arguments to `create_test_case` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_test_case(parent: nil, test_case: nil) + # Pass arguments to `create_test_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 the test case for. + # Format: `projects//locations//agents/`. + # @param test_case [::Google::Cloud::Dialogflow::CX::V3::TestCase, ::Hash] + # Required. The test case to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::TestCase] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest.new + # + # # Call the create_test_case method. + # result = client.create_test_case request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. + # p result + # + def create_test_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest + + # Converts hash and nil to an 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_test_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_test_case.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_test_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.create_test_case request, 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 test case. + # + # @overload update_test_case(request, options = nil) + # Pass arguments to `update_test_case` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_test_case(test_case: nil, update_mask: nil) + # Pass arguments to `update_test_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param test_case [::Google::Cloud::Dialogflow::CX::V3::TestCase, ::Hash] + # Required. The test case to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The mask to specify which fields should be updated. The + # {::Google::Cloud::Dialogflow::CX::V3::TestCase#creation_time `creationTime`} and + # {::Google::Cloud::Dialogflow::CX::V3::TestCase#last_test_result `lastTestResult`} + # cannot be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::TestCase] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest.new + # + # # Call the update_test_case method. + # result = client.update_test_case request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. + # p result + # + def update_test_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest + + # Converts hash and nil to an 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_test_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_test_case.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_test_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.update_test_case request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Kicks off a test case run. + # + # 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::CX::V3::RunTestCaseMetadata RunTestCaseMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::RunTestCaseResponse RunTestCaseResponse} + # + # @overload run_test_case(request, options = nil) + # Pass arguments to `run_test_case` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload run_test_case(name: nil, environment: nil) + # Pass arguments to `run_test_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Format of test case name to run: + # `projects//locations//agents//testCases/`. + # @param environment [::String] + # Optional. Environment name. If not set, draft environment is assumed. + # Format: + # `projects//locations//agents//environments/`. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest.new + # + # # Call the run_test_case method. + # result = client.run_test_case request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def run_test_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.run_test_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.run_test_case.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.run_test_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.run_test_case 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 + + ## + # Kicks off a batch run of test cases. + # + # 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::CX::V3::BatchRunTestCasesMetadata BatchRunTestCasesMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesResponse BatchRunTestCasesResponse} + # + # @overload batch_run_test_cases(request, options = nil) + # Pass arguments to `batch_run_test_cases` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_run_test_cases(parent: nil, environment: nil, test_cases: nil) + # Pass arguments to `batch_run_test_cases` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Agent name. Format: + # `projects//locations//agents/`. + # @param environment [::String] + # Optional. If not set, draft environment is assumed. Format: + # `projects//locations//agents//environments/`. + # @param test_cases [::Array<::String>] + # Required. Format: + # `projects//locations//agents//testCases/`. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest.new + # + # # Call the batch_run_test_cases method. + # result = client.batch_run_test_cases request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_run_test_cases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest + + # Converts hash and nil to an 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_run_test_cases.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_run_test_cases.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_run_test_cases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.batch_run_test_cases 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 + + ## + # Calculates the test coverage for an agent. + # + # @overload calculate_coverage(request, options = nil) + # Pass arguments to `calculate_coverage` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload calculate_coverage(agent: nil, type: nil) + # Pass arguments to `calculate_coverage` via keyword arguments. Note that at + # least one keyword argument is 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 [::String] + # Required. The agent to calculate coverage for. + # Format: `projects//locations//agents/`. + # @param type [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest::CoverageType] + # Required. The type of coverage requested. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest.new + # + # # Call the calculate_coverage method. + # result = client.calculate_coverage request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse. + # p result + # + def calculate_coverage request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.calculate_coverage.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.calculate_coverage.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.calculate_coverage.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.calculate_coverage request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Imports the test cases from a Cloud Storage bucket or a local file. It + # always creates new test cases and won't overwrite any existing ones. The + # provided ID in the imported test case is neglected. + # + # 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::CX::V3::ImportTestCasesMetadata ImportTestCasesMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesResponse ImportTestCasesResponse} + # + # @overload import_test_cases(request, options = nil) + # Pass arguments to `import_test_cases` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_test_cases(parent: nil, gcs_uri: nil, content: nil) + # Pass arguments to `import_test_cases` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 import test cases to. + # Format: `projects//locations//agents/`. + # @param gcs_uri [::String] + # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + # to import test cases from. The format of this URI must be + # `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: `gcs_uri`, `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 content [::String] + # Uncompressed raw byte content for test cases. + # + # Note: The following parameters are mutually exclusive: `content`, `gcs_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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest.new + # + # # Call the import_test_cases method. + # result = client.import_test_cases request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_test_cases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest + + # Converts hash and nil to an 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_test_cases.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_test_cases.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_test_cases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.import_test_cases 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 test cases under the agent to a Cloud Storage bucket or a local + # file. Filter can be applied to export a subset of test cases. + # + # 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::CX::V3::ExportTestCasesMetadata ExportTestCasesMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesResponse ExportTestCasesResponse} + # + # @overload export_test_cases(request, options = nil) + # Pass arguments to `export_test_cases` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_test_cases(parent: nil, gcs_uri: nil, data_format: nil, filter: nil) + # Pass arguments to `export_test_cases` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 where to export test cases from. + # Format: `projects//locations//agents/`. + # @param gcs_uri [::String] + # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to + # export the test cases to. The format of this URI must be + # `gs:///`. If unspecified, the serialized test + # cases 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). + # @param data_format [::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest::DataFormat] + # The data format of the exported test cases. If not specified, `BLOB` is + # assumed. + # @param filter [::String] + # The filter expression used to filter exported test cases, see + # [API Filtering](https://aip.dev/160). The expression is case insensitive + # and supports the following syntax: + # + # name = [OR name = ] ... + # + # For example: + # + # * "name = t1 OR name = t2" matches the test case with the exact resource + # name "t1" or "t2". + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest.new + # + # # Call the export_test_cases method. + # result = client.export_test_cases request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_test_cases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest + + # Converts hash and nil to an 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_test_cases.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_test_cases.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_test_cases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.export_test_cases 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 + + ## + # Fetches the list of run results for the given test case. A maximum of 100 + # results are kept for each test case. + # + # @overload list_test_case_results(request, options = nil) + # Pass arguments to `list_test_case_results` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_test_case_results(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_test_case_results` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The test case to list results for. + # Format: + # `projects//locations//agents//testCases/`. + # Specify a `-` as a wildcard for TestCase ID to + # list results across multiple test cases. + # @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. + # @param filter [::String] + # The filter expression used to filter test case results. See + # [API Filtering](https://aip.dev/160). + # + # The expression is case insensitive. Only 'AND' is supported for logical + # operators. The supported syntax is listed below in detail: + # + # [AND ] ... + # [AND latest] + # + # The supported fields and operators are: + # field operator + # `environment` `=`, `IN` (Use value `draft` for draft environment) + # `test_time` `>`, `<` + # + # `latest` only returns the latest test result in all results for each test + # case. + # + # Examples: + # * "environment=draft AND latest" matches the latest test result for each + # test case in the draft environment. + # * "environment IN (e1,e2)" matches any test case results with an + # environment resource name of either "e1" or "e2". + # * "test_time > 1602540713" matches any test case results with test time + # later than a unix timestamp in seconds 1602540713. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest.new + # + # # Call the list_test_case_results method. + # result = client.list_test_case_results request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::TestCaseResult. + # p item + # end + # + def list_test_case_results request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest + + # Converts hash and nil to an 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_test_case_results.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_test_case_results.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_test_case_results.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.list_test_case_results request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @test_cases_stub, :list_test_case_results, "test_case_results", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a test case result. + # + # @overload get_test_case_result(request, options = nil) + # Pass arguments to `get_test_case_result` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_test_case_result(name: nil) + # Pass arguments to `get_test_case_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 name [::String] + # Required. The name of the testcase. + # Format: + # `projects//locations//agents//testCases//results/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::TestCaseResult] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TestCaseResult] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest.new + # + # # Call the get_test_case_result method. + # result = client.get_test_case_result request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCaseResult. + # p result + # + def get_test_case_result request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest + + # Converts hash and nil to an 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_test_case_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_test_case_result.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_test_case_result.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @test_cases_stub.get_test_case_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 TestCases REST API. + # + # This class represents the configuration for TestCases 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::CX::V3::TestCases::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_test_cases to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_test_cases.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_test_cases.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 TestCases API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_test_cases` + # @return [::Gapic::Config::Method] + # + attr_reader :list_test_cases + ## + # RPC-specific configuration for `batch_delete_test_cases` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_delete_test_cases + ## + # RPC-specific configuration for `get_test_case` + # @return [::Gapic::Config::Method] + # + attr_reader :get_test_case + ## + # RPC-specific configuration for `create_test_case` + # @return [::Gapic::Config::Method] + # + attr_reader :create_test_case + ## + # RPC-specific configuration for `update_test_case` + # @return [::Gapic::Config::Method] + # + attr_reader :update_test_case + ## + # RPC-specific configuration for `run_test_case` + # @return [::Gapic::Config::Method] + # + attr_reader :run_test_case + ## + # RPC-specific configuration for `batch_run_test_cases` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_run_test_cases + ## + # RPC-specific configuration for `calculate_coverage` + # @return [::Gapic::Config::Method] + # + attr_reader :calculate_coverage + ## + # RPC-specific configuration for `import_test_cases` + # @return [::Gapic::Config::Method] + # + attr_reader :import_test_cases + ## + # RPC-specific configuration for `export_test_cases` + # @return [::Gapic::Config::Method] + # + attr_reader :export_test_cases + ## + # RPC-specific configuration for `list_test_case_results` + # @return [::Gapic::Config::Method] + # + attr_reader :list_test_case_results + ## + # RPC-specific configuration for `get_test_case_result` + # @return [::Gapic::Config::Method] + # + attr_reader :get_test_case_result + + # @private + def initialize parent_rpcs = nil + list_test_cases_config = parent_rpcs.list_test_cases if parent_rpcs.respond_to? :list_test_cases + @list_test_cases = ::Gapic::Config::Method.new list_test_cases_config + batch_delete_test_cases_config = parent_rpcs.batch_delete_test_cases if parent_rpcs.respond_to? :batch_delete_test_cases + @batch_delete_test_cases = ::Gapic::Config::Method.new batch_delete_test_cases_config + get_test_case_config = parent_rpcs.get_test_case if parent_rpcs.respond_to? :get_test_case + @get_test_case = ::Gapic::Config::Method.new get_test_case_config + create_test_case_config = parent_rpcs.create_test_case if parent_rpcs.respond_to? :create_test_case + @create_test_case = ::Gapic::Config::Method.new create_test_case_config + update_test_case_config = parent_rpcs.update_test_case if parent_rpcs.respond_to? :update_test_case + @update_test_case = ::Gapic::Config::Method.new update_test_case_config + run_test_case_config = parent_rpcs.run_test_case if parent_rpcs.respond_to? :run_test_case + @run_test_case = ::Gapic::Config::Method.new run_test_case_config + batch_run_test_cases_config = parent_rpcs.batch_run_test_cases if parent_rpcs.respond_to? :batch_run_test_cases + @batch_run_test_cases = ::Gapic::Config::Method.new batch_run_test_cases_config + calculate_coverage_config = parent_rpcs.calculate_coverage if parent_rpcs.respond_to? :calculate_coverage + @calculate_coverage = ::Gapic::Config::Method.new calculate_coverage_config + import_test_cases_config = parent_rpcs.import_test_cases if parent_rpcs.respond_to? :import_test_cases + @import_test_cases = ::Gapic::Config::Method.new import_test_cases_config + export_test_cases_config = parent_rpcs.export_test_cases if parent_rpcs.respond_to? :export_test_cases + @export_test_cases = ::Gapic::Config::Method.new export_test_cases_config + list_test_case_results_config = parent_rpcs.list_test_case_results if parent_rpcs.respond_to? :list_test_case_results + @list_test_case_results = ::Gapic::Config::Method.new list_test_case_results_config + get_test_case_result_config = parent_rpcs.get_test_case_result if parent_rpcs.respond_to? :get_test_case_result + @get_test_case_result = ::Gapic::Config::Method.new get_test_case_result_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb new file mode 100644 index 000000000000..35681db2c542 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/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 CX + module V3 + module TestCases + 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 TestCases 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 TestCases 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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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. + # * `: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: "/v3/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{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: "/v3/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb new file mode 100644 index 000000000000..2d54f7d15443 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb @@ -0,0 +1,822 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/test_case_pb" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module TestCases + module Rest + ## + # REST service stub for the TestCases 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_test_cases REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::ListTestCasesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ListTestCasesResponse] + # A result object deserialized from the server's reply + def list_test_cases request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_test_cases_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_test_cases", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::ListTestCasesResponse.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_test_cases REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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 batch_delete_test_cases request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_delete_test_cases_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_test_cases", + 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_test_case REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::TestCase] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] + # A result object deserialized from the server's reply + def get_test_case request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_test_case_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_test_case", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::TestCase.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_test_case REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::TestCase] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] + # A result object deserialized from the server's reply + def create_test_case request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_test_case_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_test_case", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::TestCase.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_test_case REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::TestCase] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] + # A result object deserialized from the server's reply + def update_test_case request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_test_case_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_test_case", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::TestCase.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the run_test_case REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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 run_test_case request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_run_test_case_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "run_test_case", + 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_run_test_cases REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_run_test_cases request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_run_test_cases_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_run_test_cases", + 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 calculate_coverage REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::CalculateCoverageResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse] + # A result object deserialized from the server's reply + def calculate_coverage request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_calculate_coverage_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "calculate_coverage", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse.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_test_cases REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_test_cases request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_test_cases_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_test_cases", + 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_test_cases REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_test_cases request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_test_cases_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_test_cases", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_test_case_results REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::ListTestCaseResultsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsResponse] + # A result object deserialized from the server's reply + def list_test_case_results request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_test_case_results_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_test_case_results", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsResponse.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_test_case_result REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::TestCaseResult] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TestCaseResult] + # A result object deserialized from the server's reply + def get_test_case_result request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_test_case_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_test_case_result", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::TestCaseResult.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_test_cases REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest] + # 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_test_cases_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/testCases", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_delete_test_cases REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest] + # 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_test_cases_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/testCases:batchDelete", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_test_case REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest] + # 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_test_case_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/testCases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_test_case REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest] + # 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_test_case_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/testCases", + body: "test_case", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_test_case REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest] + # 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_test_case_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v3/{test_case.name}", + body: "test_case", + matches: [ + ["test_case.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/testCases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the run_test_case REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_run_test_case_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:run", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/testCases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_run_test_cases REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest] + # 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_run_test_cases_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/testCases:batchRun", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the calculate_coverage REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_calculate_coverage_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{agent}/testCases:calculateCoverage", + matches: [ + ["agent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_test_cases REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest] + # 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_test_cases_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/testCases:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_test_cases REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest] + # 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_test_cases_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/testCases:export", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_test_case_results REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest] + # 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_test_case_results_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/results", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/testCases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_test_case_result REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest] + # 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_test_case_result_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/testCases/[^/]+/results/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_call_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_call_pb.rb new file mode 100644 index 000000000000..692b597333cd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_call_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/tool_call.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n-google/cloud/dialogflow/cx/v3/tool_call.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\"\x8d\x01\n\x08ToolCall\x12\x34\n\x04tool\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Tool\x12\x13\n\x06\x61\x63tion\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x36\n\x10input_parameters\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\"\x80\x02\n\x0eToolCallResult\x12\x34\n\x04tool\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Tool\x12\x13\n\x06\x61\x63tion\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\x05\x65rror\x18\x03 \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.ToolCallResult.ErrorH\x00\x12\x34\n\x11output_parameters\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x1a\x1d\n\x05\x45rror\x12\x14\n\x07message\x18\x01 \x01(\tB\x03\xe0\x41\x01\x42\x08\n\x06resultB\xb0\x01\n!com.google.cloud.dialogflow.cx.v3B\rToolCallProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ToolCall = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ToolCall").msgclass + ToolCallResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ToolCallResult").msgclass + ToolCallResult::Error = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ToolCallResult.Error").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_pb.rb new file mode 100644 index 000000000000..ff4226bb7adc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_pb.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/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/cloud/dialogflow/cx/v3/data_store_connection_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/cx/v3/tool.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x39google/cloud/dialogflow/cx/v3/data_store_connection.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x83\x01\n\x11\x43reateToolRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Tool\x12\x36\n\x04tool\x18\x02 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.ToolB\x03\xe0\x41\x02\"q\n\x10ListToolsRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Tool\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"`\n\x11ListToolsResponse\x12\x32\n\x05tools\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.cx.v3.Tool\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"F\n\x0eGetToolRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Tool\"|\n\x11UpdateToolRequest\x12\x36\n\x04tool\x18\x01 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.ToolB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"X\n\x11\x44\x65leteToolRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Tool\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\"\xd2\x18\n\x04Tool\x12\x0c\n\x04name\x18\x01 \x01(\t\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\x02\x12H\n\ropen_api_spec\x18\x04 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.Tool.OpenApiToolH\x00\x12L\n\x0f\x64\x61ta_store_spec\x18\x08 \x01(\x0b\x32\x31.google.cloud.dialogflow.cx.v3.Tool.DataStoreToolH\x00\x12I\n\rfunction_spec\x18\r \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.Tool.FunctionToolH\x00\x12\x44\n\ttool_type\x18\x0c \x01(\x0e\x32,.google.cloud.dialogflow.cx.v3.Tool.ToolTypeB\x03\xe0\x41\x03\x1a\xaf\x02\n\x0bOpenApiTool\x12\x1a\n\x0btext_schema\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x12O\n\x0e\x61uthentication\x18\x02 \x01(\x0b\x32\x32.google.cloud.dialogflow.cx.v3.Tool.AuthenticationB\x03\xe0\x41\x01\x12\x46\n\ntls_config\x18\x03 \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.Tool.TLSConfigB\x03\xe0\x41\x01\x12\x61\n\x18service_directory_config\x18\x04 \x01(\x0b\x32:.google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfigB\x03\xe0\x41\x01\x42\x08\n\x06schema\x1a\xda\x01\n\rDataStoreTool\x12W\n\x16\x64\x61ta_store_connections\x18\x01 \x03(\x0b\x32\x32.google.cloud.dialogflow.cx.v3.DataStoreConnectionB\x03\xe0\x41\x02\x12^\n\x0f\x66\x61llback_prompt\x18\x03 \x01(\x0b\x32@.google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPromptB\x03\xe0\x41\x02\x1a\x10\n\x0e\x46\x61llbackPrompt\x1aw\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\x1a\x9d\r\n\x0e\x41uthentication\x12Y\n\x0e\x61pi_key_config\x18\x01 \x01(\x0b\x32?.google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfigH\x00\x12V\n\x0coauth_config\x18\x02 \x01(\x0b\x32>.google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfigH\x00\x12n\n\x19service_agent_auth_config\x18\x03 \x01(\x0b\x32I.google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfigH\x00\x12\x63\n\x13\x62\x65\x61rer_token_config\x18\x04 \x01(\x0b\x32\x44.google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfigH\x00\x12r\n\x1bservice_account_auth_config\x18\x05 \x01(\x0b\x32K.google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfigH\x00\x1a\xf6\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\x61\n\x10request_location\x18\x03 \x01(\x0e\x32\x42.google.cloud.dialogflow.cx.v3.Tool.Authentication.RequestLocationB\x03\xe0\x41\x02\x1a\x8a\x03\n\x0bOAuthConfig\x12l\n\x10oauth_grant_type\x18\x01 \x01(\x0e\x32M.google.cloud.dialogflow.cx.v3.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\xed\x01\n\x16ServiceAgentAuthConfig\x12{\n\x12service_agent_auth\x18\x01 \x01(\x0e\x32Z.google.cloud.dialogflow.cx.v3.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\x1a\x38\n\x18ServiceAccountAuthConfig\x12\x1c\n\x0fservice_account\x18\x01 \x01(\tB\x03\xe0\x41\x02\"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\x90\x01\n\tTLSConfig\x12K\n\x08\x63\x61_certs\x18\x01 \x03(\x0b\x32\x34.google.cloud.dialogflow.cx.v3.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\"L\n\x08ToolType\x12\x19\n\x15TOOL_TYPE_UNSPECIFIED\x10\x00\x12\x13\n\x0f\x43USTOMIZED_TOOL\x10\x01\x12\x10\n\x0c\x42UILTIN_TOOL\x10\x02:h\xea\x41\x65\n\x1e\x64ialogflow.googleapis.com/Tool\x12\x43projects/{project}/locations/{location}/agents/{agent}/tools/{tool}B\x0f\n\rspecification\"\x89\x01\n\x17ListToolVersionsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%dialogflow.googleapis.com/ToolVersion\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\"v\n\x18ListToolVersionsResponse\x12\x41\n\rtool_versions\x18\x01 \x03(\x0b\x32*.google.cloud.dialogflow.cx.v3.ToolVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa0\x01\n\x18\x43reateToolVersionRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%dialogflow.googleapis.com/ToolVersion\x12\x45\n\x0ctool_version\x18\x02 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.ToolVersionB\x03\xe0\x41\x02\"T\n\x15GetToolVersionRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/ToolVersion\"k\n\x18\x44\x65leteToolVersionRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/ToolVersion\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"X\n\x19RestoreToolVersionRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/ToolVersion\"O\n\x1aRestoreToolVersionResponse\x12\x31\n\x04tool\x18\x02 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.Tool\"\x80\x03\n\x0bToolVersion\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x36\n\x04tool\x18\x03 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.ToolB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:\x9e\x01\xea\x41\x9a\x01\n%dialogflow.googleapis.com/ToolVersion\x12Vprojects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}*\x0ctoolVersions2\x0btoolVersion2\x85\x10\n\x05Tools\x12\xb3\x01\n\nCreateTool\x12\x30.google.cloud.dialogflow.cx.v3.CreateToolRequest\x1a#.google.cloud.dialogflow.cx.v3.Tool\"N\xda\x41\x0bparent,tool\x82\xd3\xe4\x93\x02:\"2/v3/{parent=projects/*/locations/*/agents/*}/tools:\x04tool\x12\xb3\x01\n\tListTools\x12/.google.cloud.dialogflow.cx.v3.ListToolsRequest\x1a\x30.google.cloud.dialogflow.cx.v3.ListToolsResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v3/{parent=projects/*/locations/*/agents/*}/tools\x12\xa0\x01\n\x07GetTool\x12-.google.cloud.dialogflow.cx.v3.GetToolRequest\x1a#.google.cloud.dialogflow.cx.v3.Tool\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v3/{name=projects/*/locations/*/agents/*/tools/*}\x12\xbd\x01\n\nUpdateTool\x12\x30.google.cloud.dialogflow.cx.v3.UpdateToolRequest\x1a#.google.cloud.dialogflow.cx.v3.Tool\"X\xda\x41\x10tool,update_mask\x82\xd3\xe4\x93\x02?27/v3/{tool.name=projects/*/locations/*/agents/*/tools/*}:\x04tool\x12\x99\x01\n\nDeleteTool\x12\x30.google.cloud.dialogflow.cx.v3.DeleteToolRequest\x1a\x16.google.protobuf.Empty\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34*2/v3/{name=projects/*/locations/*/agents/*/tools/*}\x12\xd3\x01\n\x10ListToolVersions\x12\x36.google.cloud.dialogflow.cx.v3.ListToolVersionsRequest\x1a\x37.google.cloud.dialogflow.cx.v3.ListToolVersionsResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v3/{parent=projects/*/locations/*/agents/*/tools/*}/versions\x12\xe3\x01\n\x11\x43reateToolVersion\x12\x37.google.cloud.dialogflow.cx.v3.CreateToolVersionRequest\x1a*.google.cloud.dialogflow.cx.v3.ToolVersion\"i\xda\x41\x13parent,tool_version\x82\xd3\xe4\x93\x02M\"=/v3/{parent=projects/*/locations/*/agents/*/tools/*}/versions:\x0ctool_version\x12\xc0\x01\n\x0eGetToolVersion\x12\x34.google.cloud.dialogflow.cx.v3.GetToolVersionRequest\x1a*.google.cloud.dialogflow.cx.v3.ToolVersion\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v3/{name=projects/*/locations/*/agents/*/tools/*/versions/*}\x12\xb2\x01\n\x11\x44\x65leteToolVersion\x12\x37.google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest\x1a\x16.google.protobuf.Empty\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?*=/v3/{name=projects/*/locations/*/agents/*/tools/*/versions/*}\x12\xe2\x01\n\x12RestoreToolVersion\x12\x38.google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest\x1a\x39.google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse\"W\xda\x41\x04name\x82\xd3\xe4\x93\x02J\"E/v3/{name=projects/*/locations/*/agents/*/tools/*/versions/*}:restore:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x88\x01\n!com.google.cloud.dialogflow.cx.v3B\tToolProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.dialogflow.cx.v3.DataStoreConnection", "google/cloud/dialogflow/cx/v3/data_store_connection.proto"], + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module Cx + module V3 + CreateToolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateToolRequest").msgclass + ListToolsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListToolsRequest").msgclass + ListToolsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListToolsResponse").msgclass + GetToolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetToolRequest").msgclass + UpdateToolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateToolRequest").msgclass + DeleteToolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteToolRequest").msgclass + Tool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Tool").msgclass + Tool::OpenApiTool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Tool.OpenApiTool").msgclass + Tool::DataStoreTool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Tool.DataStoreTool").msgclass + Tool::DataStoreTool::FallbackPrompt = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Tool.DataStoreTool.FallbackPrompt").msgclass + Tool::FunctionTool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Tool.FunctionTool").msgclass + Tool::Authentication = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Tool.Authentication").msgclass + Tool::Authentication::ApiKeyConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Tool.Authentication.ApiKeyConfig").msgclass + Tool::Authentication::OAuthConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig").msgclass + Tool::Authentication::OAuthConfig::OauthGrantType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Tool.Authentication.OAuthConfig.OauthGrantType").enummodule + Tool::Authentication::ServiceAgentAuthConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig").msgclass + Tool::Authentication::ServiceAgentAuthConfig::ServiceAgentAuth = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth").enummodule + Tool::Authentication::BearerTokenConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Tool.Authentication.BearerTokenConfig").msgclass + Tool::Authentication::ServiceAccountAuthConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Tool.Authentication.ServiceAccountAuthConfig").msgclass + Tool::Authentication::RequestLocation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Tool.Authentication.RequestLocation").enummodule + Tool::TLSConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Tool.TLSConfig").msgclass + Tool::TLSConfig::CACert = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Tool.TLSConfig.CACert").msgclass + Tool::ServiceDirectoryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Tool.ServiceDirectoryConfig").msgclass + Tool::ToolType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Tool.ToolType").enummodule + ListToolVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListToolVersionsRequest").msgclass + ListToolVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListToolVersionsResponse").msgclass + CreateToolVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateToolVersionRequest").msgclass + GetToolVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetToolVersionRequest").msgclass + DeleteToolVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteToolVersionRequest").msgclass + RestoreToolVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RestoreToolVersionRequest").msgclass + RestoreToolVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RestoreToolVersionResponse").msgclass + ToolVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ToolVersion").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_services_pb.rb new file mode 100644 index 000000000000..f50565860bf9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_services_pb.rb @@ -0,0 +1,71 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/cx/v3/tool.proto for package 'google.cloud.dialogflow.cx.v3' +# 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/cx/v3/tool_pb' + +module Google + module Cloud + module Dialogflow + module Cx + module V3 + module Tools + # Service for managing [Tools][google.cloud.dialogflow.cx.v3.Tool]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.cx.v3.Tools' + + # Creates a [Tool][google.cloud.dialogflow.cx.v3.Tool] in the specified + # agent. + rpc :CreateTool, ::Google::Cloud::Dialogflow::Cx::V3::CreateToolRequest, ::Google::Cloud::Dialogflow::Cx::V3::Tool + # Returns a list of [Tools][google.cloud.dialogflow.cx.v3.Tool] in the + # specified agent. + rpc :ListTools, ::Google::Cloud::Dialogflow::Cx::V3::ListToolsRequest, ::Google::Cloud::Dialogflow::Cx::V3::ListToolsResponse + # Retrieves the specified [Tool][google.cloud.dialogflow.cx.v3.Tool]. + rpc :GetTool, ::Google::Cloud::Dialogflow::Cx::V3::GetToolRequest, ::Google::Cloud::Dialogflow::Cx::V3::Tool + # Update the specified [Tool][google.cloud.dialogflow.cx.v3.Tool]. + rpc :UpdateTool, ::Google::Cloud::Dialogflow::Cx::V3::UpdateToolRequest, ::Google::Cloud::Dialogflow::Cx::V3::Tool + # Deletes a specified [Tool][google.cloud.dialogflow.cx.v3.Tool]. + rpc :DeleteTool, ::Google::Cloud::Dialogflow::Cx::V3::DeleteToolRequest, ::Google::Protobuf::Empty + # List versions of the specified [Tool][google.cloud.dialogflow.cx.v3.Tool]. + rpc :ListToolVersions, ::Google::Cloud::Dialogflow::Cx::V3::ListToolVersionsRequest, ::Google::Cloud::Dialogflow::Cx::V3::ListToolVersionsResponse + # Creates a version for the specified + # [Tool][google.cloud.dialogflow.cx.v3.Tool]. + rpc :CreateToolVersion, ::Google::Cloud::Dialogflow::Cx::V3::CreateToolVersionRequest, ::Google::Cloud::Dialogflow::Cx::V3::ToolVersion + # Retrieves the specified version of the + # [Tool][google.cloud.dialogflow.cx.v3.Tool]. + rpc :GetToolVersion, ::Google::Cloud::Dialogflow::Cx::V3::GetToolVersionRequest, ::Google::Cloud::Dialogflow::Cx::V3::ToolVersion + # Deletes the specified version of the + # [Tool][google.cloud.dialogflow.cx.v3.Tool]. + rpc :DeleteToolVersion, ::Google::Cloud::Dialogflow::Cx::V3::DeleteToolVersionRequest, ::Google::Protobuf::Empty + # Retrieves the specified version of the Tool and stores it as the + # current tool draft, returning the tool with resources updated. + rpc :RestoreToolVersion, ::Google::Cloud::Dialogflow::Cx::V3::RestoreToolVersionRequest, ::Google::Cloud::Dialogflow::Cx::V3::RestoreToolVersionResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools.rb new file mode 100644 index 000000000000..201ab7c13d57 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/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/cx/v3/version" + +require "google/cloud/dialogflow/cx/v3/tools/credentials" +require "google/cloud/dialogflow/cx/v3/tools/paths" +require "google/cloud/dialogflow/cx/v3/tools/client" +require "google/cloud/dialogflow/cx/v3/tools/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Tool Tools}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/cx/v3/tools" + # client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/cx/v3/tools/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new + # + module Tools + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "tools", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/tools/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/client.rb new file mode 100644 index 000000000000..0fa7bc12f011 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/client.rb @@ -0,0 +1,1392 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/tool_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Tools + ## + # Client for the Tools service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Tool Tools}. + # + 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::CX::V3::Tools::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Tools clients + # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] + 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::CX::V3::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::CX::V3::Tools::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::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/cx/v3/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::Cx::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Tool Tool} in the specified + # agent. + # + # @overload create_tool(request, options = nil) + # Pass arguments to `create_tool` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateToolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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) + # 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 agent to create a Tool for. + # Format: `projects//locations//agents/`. + # @param tool [::Google::Cloud::Dialogflow::CX::V3::Tool, ::Hash] + # Required. The Tool to be created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Tool] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Tool] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateToolRequest.new + # + # # Call the create_tool method. + # result = client.create_tool request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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 + + ## + # Returns a list of {::Google::Cloud::Dialogflow::CX::V3::Tool Tools} in the + # specified agent. + # + # @overload list_tools(request, options = nil) + # Pass arguments to `list_tools` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListToolsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 agent to list the Tools from. + # Format: `projects//locations//agents/`. + # @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::CX::V3::Tool>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Tool>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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 + + ## + # Retrieves the specified {::Google::Cloud::Dialogflow::CX::V3::Tool Tool}. + # + # @overload get_tool(request, options = nil) + # Pass arguments to `get_tool` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetToolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 name of the Tool. + # Format: + # `projects//locations//agents//tools/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Tool] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Tool] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetToolRequest.new + # + # # Call the get_tool method. + # result = client.get_tool request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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 + + ## + # Update the specified {::Google::Cloud::Dialogflow::CX::V3::Tool Tool}. + # + # @overload update_tool(request, options = nil) + # Pass arguments to `update_tool` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateToolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Tool, ::Hash] + # Required. The Tool to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # 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::CX::V3::Tool] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Tool] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateToolRequest.new + # + # # Call the update_tool method. + # result = client.update_tool request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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 + + ## + # Deletes a specified {::Google::Cloud::Dialogflow::CX::V3::Tool Tool}. + # + # @overload delete_tool(request, options = nil) + # Pass arguments to `delete_tool` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteToolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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, force: 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 name of the Tool to be deleted. + # Format: + # `projects//locations//agents//tools/`. + # @param force [::Boolean] + # This field has no effect for Tools not being used. + # For Tools that are used: + # + # * If `force` is set to false, an error will be returned with message + # indicating the referenced resources. + # * If `force` is set to true, Dialogflow will remove the tool, as well + # as any references to the tool. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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 + + ## + # List versions of the specified {::Google::Cloud::Dialogflow::CX::V3::Tool Tool}. + # + # @overload list_tool_versions(request, options = nil) + # Pass arguments to `list_tool_versions` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tool_versions(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tool_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 parent of the tool versions. + # Format: + # `projects//locations//agents//tools/`. + # @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::CX::V3::ToolVersion>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::ToolVersion>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListToolVersionsRequest.new + # + # # Call the list_tool_versions method. + # result = client.list_tool_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::CX::V3::ToolVersion. + # p item + # end + # + def list_tool_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsRequest + + # Converts hash and nil to 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_tool_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::CX::V3::VERSION + metadata[:"x-goog-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_tool_versions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tool_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tools_stub.call_rpc :list_tool_versions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @tools_stub, :list_tool_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 + + ## + # Creates a version for the specified + # {::Google::Cloud::Dialogflow::CX::V3::Tool Tool}. + # + # @overload create_tool_version(request, options = nil) + # Pass arguments to `create_tool_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateToolVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateToolVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_version(parent: nil, tool_version: nil) + # Pass arguments to `create_tool_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 tool to create a version for. + # Format: + # `projects//locations//agents//tools/`. + # @param tool_version [::Google::Cloud::Dialogflow::CX::V3::ToolVersion, ::Hash] + # Required. The tool version to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::ToolVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ToolVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateToolVersionRequest.new + # + # # Call the create_tool_version method. + # result = client.create_tool_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::ToolVersion. + # p result + # + def create_tool_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateToolVersionRequest + + # Converts hash and nil to 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_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::CX::V3::VERSION + metadata[:"x-goog-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_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_tool_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tools_stub.call_rpc :create_tool_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 + + ## + # Retrieves the specified version of the + # {::Google::Cloud::Dialogflow::CX::V3::Tool Tool}. + # + # @overload get_tool_version(request, options = nil) + # Pass arguments to `get_tool_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetToolVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetToolVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_version(name: nil) + # Pass arguments to `get_tool_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 tool version. + # Format: + # `projects//locations//agents//tools//versions/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::ToolVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ToolVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetToolVersionRequest.new + # + # # Call the get_tool_version method. + # result = client.get_tool_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::ToolVersion. + # p result + # + def get_tool_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetToolVersionRequest + + # Converts hash and nil to 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_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_tool_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tools_stub.call_rpc :get_tool_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 + + ## + # Deletes the specified version of the + # {::Google::Cloud::Dialogflow::CX::V3::Tool Tool}. + # + # @overload delete_tool_version(request, options = nil) + # Pass arguments to `delete_tool_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteToolVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteToolVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_version(name: nil, force: nil) + # Pass arguments to `delete_tool_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 tool version to delete. + # Format: + # `projects//locations//agents//tools//versions/`. + # @param force [::Boolean] + # Optional. This field has no effect for Tools not being used. + # For Tools that are used: + # + # * If `force` is set to false, an error will be returned with message + # indicating the referenced resources. + # * If `force` is set to true, Dialogflow will remove the tool, as well + # as any references to the tool. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteToolVersionRequest.new + # + # # Call the delete_tool_version method. + # result = client.delete_tool_version request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_tool_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteToolVersionRequest + + # Converts hash and nil to 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_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_tool_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tools_stub.call_rpc :delete_tool_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 + + ## + # Retrieves the specified version of the Tool and stores it as the + # current tool draft, returning the tool with resources updated. + # + # @overload restore_tool_version(request, options = nil) + # Pass arguments to `restore_tool_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tool_version(name: nil) + # Pass arguments to `restore_tool_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 tool version. + # Format: + # `projects//locations//agents//tools//versions/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionRequest.new + # + # # Call the restore_tool_version method. + # result = client.restore_tool_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionResponse. + # p result + # + def restore_tool_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionRequest + + # Converts hash and nil to 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_tool_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_tool_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.restore_tool_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tools_stub.call_rpc :restore_tool_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 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::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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. + # * `: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. + # * `: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 `list_tools` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tools + ## + # RPC-specific configuration for `get_tool` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tool + ## + # RPC-specific configuration for `update_tool` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tool + ## + # RPC-specific configuration for `delete_tool` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tool + ## + # RPC-specific configuration for `list_tool_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tool_versions + ## + # RPC-specific configuration for `create_tool_version` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tool_version + ## + # RPC-specific configuration for `get_tool_version` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tool_version + ## + # RPC-specific configuration for `delete_tool_version` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tool_version + ## + # RPC-specific configuration for `restore_tool_version` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_tool_version + + # @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 + list_tools_config = parent_rpcs.list_tools if parent_rpcs.respond_to? :list_tools + @list_tools = ::Gapic::Config::Method.new list_tools_config + get_tool_config = parent_rpcs.get_tool if parent_rpcs.respond_to? :get_tool + @get_tool = ::Gapic::Config::Method.new get_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 + delete_tool_config = parent_rpcs.delete_tool if parent_rpcs.respond_to? :delete_tool + @delete_tool = ::Gapic::Config::Method.new delete_tool_config + list_tool_versions_config = parent_rpcs.list_tool_versions if parent_rpcs.respond_to? :list_tool_versions + @list_tool_versions = ::Gapic::Config::Method.new list_tool_versions_config + create_tool_version_config = parent_rpcs.create_tool_version if parent_rpcs.respond_to? :create_tool_version + @create_tool_version = ::Gapic::Config::Method.new create_tool_version_config + get_tool_version_config = parent_rpcs.get_tool_version if parent_rpcs.respond_to? :get_tool_version + @get_tool_version = ::Gapic::Config::Method.new get_tool_version_config + delete_tool_version_config = parent_rpcs.delete_tool_version if parent_rpcs.respond_to? :delete_tool_version + @delete_tool_version = ::Gapic::Config::Method.new delete_tool_version_config + restore_tool_version_config = parent_rpcs.restore_tool_version if parent_rpcs.respond_to? :restore_tool_version + @restore_tool_version = ::Gapic::Config::Method.new restore_tool_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/credentials.rb new file mode 100644 index 000000000000..202f2e6421f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/paths.rb new file mode 100644 index 000000000000..44cab988663f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/paths.rb @@ -0,0 +1,138 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + module Tools + # Path helper methods for the Tools API. + module Paths + ## + # Create a fully-qualified Agent resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # + # @return [::String] + def agent_path project:, location:, agent: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}" + 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}/agents/{agent}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param tool [String] + # + # @return [::String] + def tool_path project:, location:, agent:, tool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/tools/#{tool}" + end + + ## + # Create a fully-qualified ToolVersion resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/tools/{tool}/versions/{version}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param tool [String] + # @param version [String] + # + # @return [::String] + def tool_version_path project:, location:, agent:, tool:, version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "tool cannot contain /" if tool.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/tools/#{tool}/versions/#{version}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest.rb new file mode 100644 index 000000000000..a36b62e2635e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/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/cx/v3/version" +require "google/cloud/dialogflow/cx/v3/bindings_override" + +require "google/cloud/dialogflow/cx/v3/tools/credentials" +require "google/cloud/dialogflow/cx/v3/tools/paths" +require "google/cloud/dialogflow/cx/v3/tools/rest/client" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Tool Tools}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/cx/v3/tools/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new + # + module Tools + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/tools/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest/client.rb new file mode 100644 index 000000000000..6ce8f392e255 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest/client.rb @@ -0,0 +1,1287 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/tool_pb" +require "google/cloud/dialogflow/cx/v3/tools/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Tools + module Rest + ## + # REST client for the Tools service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Tool Tools}. + # + 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::CX::V3::Tools::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Tools clients + # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] + 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::CX::V3::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::CX::V3::Tools::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Tool Tool} in the specified + # agent. + # + # @overload create_tool(request, options = nil) + # Pass arguments to `create_tool` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateToolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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) + # 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 agent to create a Tool for. + # Format: `projects//locations//agents/`. + # @param tool [::Google::Cloud::Dialogflow::CX::V3::Tool, ::Hash] + # Required. The Tool to be created. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Tool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Tool] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateToolRequest.new + # + # # Call the create_tool method. + # result = client.create_tool request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # Returns a list of {::Google::Cloud::Dialogflow::CX::V3::Tool Tools} in the + # specified agent. + # + # @overload list_tools(request, options = nil) + # Pass arguments to `list_tools` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListToolsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 agent to list the Tools from. + # Format: `projects//locations//agents/`. + # @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::CX::V3::Tool>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Tool>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # Retrieves the specified {::Google::Cloud::Dialogflow::CX::V3::Tool Tool}. + # + # @overload get_tool(request, options = nil) + # Pass arguments to `get_tool` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetToolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 name of the Tool. + # Format: + # `projects//locations//agents//tools/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Tool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Tool] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetToolRequest.new + # + # # Call the get_tool method. + # result = client.get_tool request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # Update the specified {::Google::Cloud::Dialogflow::CX::V3::Tool Tool}. + # + # @overload update_tool(request, options = nil) + # Pass arguments to `update_tool` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateToolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Tool, ::Hash] + # Required. The Tool to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # 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::CX::V3::Tool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Tool] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateToolRequest.new + # + # # Call the update_tool method. + # result = client.update_tool request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # Deletes a specified {::Google::Cloud::Dialogflow::CX::V3::Tool Tool}. + # + # @overload delete_tool(request, options = nil) + # Pass arguments to `delete_tool` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteToolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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, force: 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 name of the Tool to be deleted. + # Format: + # `projects//locations//agents//tools/`. + # @param force [::Boolean] + # This field has no effect for Tools not being used. + # For Tools that are used: + # + # * If `force` is set to false, an error will be returned with message + # indicating the referenced resources. + # * If `force` is set to true, Dialogflow will remove the tool, as well + # as any references to the tool. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # List versions of the specified {::Google::Cloud::Dialogflow::CX::V3::Tool Tool}. + # + # @overload list_tool_versions(request, options = nil) + # Pass arguments to `list_tool_versions` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tool_versions(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tool_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 parent of the tool versions. + # Format: + # `projects//locations//agents//tools/`. + # @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::CX::V3::ToolVersion>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::ToolVersion>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListToolVersionsRequest.new + # + # # Call the list_tool_versions method. + # result = client.list_tool_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::CX::V3::ToolVersion. + # p item + # end + # + def list_tool_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsRequest + + # Converts hash and nil to an 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_tool_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_tool_versions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_tool_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tools_stub.list_tool_versions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @tools_stub, :list_tool_versions, "tool_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 + + ## + # Creates a version for the specified + # {::Google::Cloud::Dialogflow::CX::V3::Tool Tool}. + # + # @overload create_tool_version(request, options = nil) + # Pass arguments to `create_tool_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateToolVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateToolVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_version(parent: nil, tool_version: nil) + # Pass arguments to `create_tool_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 tool to create a version for. + # Format: + # `projects//locations//agents//tools/`. + # @param tool_version [::Google::Cloud::Dialogflow::CX::V3::ToolVersion, ::Hash] + # Required. The tool version to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::ToolVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ToolVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateToolVersionRequest.new + # + # # Call the create_tool_version method. + # result = client.create_tool_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::ToolVersion. + # p result + # + def create_tool_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateToolVersionRequest + + # Converts hash and nil to an 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_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_tool_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tools_stub.create_tool_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 + + ## + # Retrieves the specified version of the + # {::Google::Cloud::Dialogflow::CX::V3::Tool Tool}. + # + # @overload get_tool_version(request, options = nil) + # Pass arguments to `get_tool_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetToolVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetToolVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_version(name: nil) + # Pass arguments to `get_tool_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 tool version. + # Format: + # `projects//locations//agents//tools//versions/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::ToolVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ToolVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetToolVersionRequest.new + # + # # Call the get_tool_version method. + # result = client.get_tool_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::ToolVersion. + # p result + # + def get_tool_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetToolVersionRequest + + # Converts hash and nil to an 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_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_tool_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tools_stub.get_tool_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 + + ## + # Deletes the specified version of the + # {::Google::Cloud::Dialogflow::CX::V3::Tool Tool}. + # + # @overload delete_tool_version(request, options = nil) + # Pass arguments to `delete_tool_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteToolVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteToolVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_version(name: nil, force: nil) + # Pass arguments to `delete_tool_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 tool version to delete. + # Format: + # `projects//locations//agents//tools//versions/`. + # @param force [::Boolean] + # Optional. This field has no effect for Tools not being used. + # For Tools that are used: + # + # * If `force` is set to false, an error will be returned with message + # indicating the referenced resources. + # * If `force` is set to true, Dialogflow will remove the tool, as well + # as any references to the tool. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteToolVersionRequest.new + # + # # Call the delete_tool_version method. + # result = client.delete_tool_version request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_tool_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteToolVersionRequest + + # Converts hash and nil to an 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_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_tool_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tools_stub.delete_tool_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 + + ## + # Retrieves the specified version of the Tool and stores it as the + # current tool draft, returning the tool with resources updated. + # + # @overload restore_tool_version(request, options = nil) + # Pass arguments to `restore_tool_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tool_version(name: nil) + # Pass arguments to `restore_tool_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 tool version. + # Format: + # `projects//locations//agents//tools//versions/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionRequest.new + # + # # Call the restore_tool_version method. + # result = client.restore_tool_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionResponse. + # p result + # + def restore_tool_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionRequest + + # Converts hash and nil to an 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_tool_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_tool_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.restore_tool_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tools_stub.restore_tool_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 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::CX::V3::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::CX::V3::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::CX::V3::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. + # * `: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. + # * `: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 `list_tools` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tools + ## + # RPC-specific configuration for `get_tool` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tool + ## + # RPC-specific configuration for `update_tool` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tool + ## + # RPC-specific configuration for `delete_tool` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tool + ## + # RPC-specific configuration for `list_tool_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tool_versions + ## + # RPC-specific configuration for `create_tool_version` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tool_version + ## + # RPC-specific configuration for `get_tool_version` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tool_version + ## + # RPC-specific configuration for `delete_tool_version` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tool_version + ## + # RPC-specific configuration for `restore_tool_version` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_tool_version + + # @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 + list_tools_config = parent_rpcs.list_tools if parent_rpcs.respond_to? :list_tools + @list_tools = ::Gapic::Config::Method.new list_tools_config + get_tool_config = parent_rpcs.get_tool if parent_rpcs.respond_to? :get_tool + @get_tool = ::Gapic::Config::Method.new get_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 + delete_tool_config = parent_rpcs.delete_tool if parent_rpcs.respond_to? :delete_tool + @delete_tool = ::Gapic::Config::Method.new delete_tool_config + list_tool_versions_config = parent_rpcs.list_tool_versions if parent_rpcs.respond_to? :list_tool_versions + @list_tool_versions = ::Gapic::Config::Method.new list_tool_versions_config + create_tool_version_config = parent_rpcs.create_tool_version if parent_rpcs.respond_to? :create_tool_version + @create_tool_version = ::Gapic::Config::Method.new create_tool_version_config + get_tool_version_config = parent_rpcs.get_tool_version if parent_rpcs.respond_to? :get_tool_version + @get_tool_version = ::Gapic::Config::Method.new get_tool_version_config + delete_tool_version_config = parent_rpcs.delete_tool_version if parent_rpcs.respond_to? :delete_tool_version + @delete_tool_version = ::Gapic::Config::Method.new delete_tool_version_config + restore_tool_version_config = parent_rpcs.restore_tool_version if parent_rpcs.respond_to? :restore_tool_version + @restore_tool_version = ::Gapic::Config::Method.new restore_tool_version_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest/service_stub.rb new file mode 100644 index 000000000000..7c649016d4e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest/service_stub.rb @@ -0,0 +1,697 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/tool_pb" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + 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::CX::V3::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::CX::V3::Tool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::ListToolsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 get_tool REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Tool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 update_tool REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Tool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 delete_tool REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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 list_tool_versions REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::ListToolVersionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsResponse] + # A result object deserialized from the server's reply + def list_tool_versions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_tool_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_tool_versions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsResponse.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_tool_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateToolVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::ToolVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ToolVersion] + # A result object deserialized from the server's reply + def create_tool_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_tool_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_tool_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::ToolVersion.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_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetToolVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::ToolVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ToolVersion] + # A result object deserialized from the server's reply + def get_tool_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_tool_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_tool_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::ToolVersion.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_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteToolVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_tool_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_tool_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 + + ## + # Baseline implementation for the restore_tool_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::RestoreToolVersionResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionResponse] + # A result object deserialized from the server's reply + def restore_tool_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_restore_tool_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: "restore_tool_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionResponse.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::CX::V3::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: "/v3/{parent}/tools", + body: "tool", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_tools REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{parent}/tools", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_tool REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/tools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_tool REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{tool.name}", + body: "tool", + matches: [ + ["tool.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/tools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_tool REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/tools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_tool_versions REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsRequest] + # 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_tool_versions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/versions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/tools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_tool_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateToolVersionRequest] + # 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_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/versions", + body: "tool_version", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/tools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_tool_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetToolVersionRequest] + # 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_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/tools/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_tool_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteToolVersionRequest] + # 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_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/tools/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the restore_tool_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionRequest] + # 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_tool_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:restore", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/tools/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/trace_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/trace_pb.rb new file mode 100644 index 000000000000..c24fde5e5c41 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/trace_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/trace.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n)google/cloud/dialogflow/cx/v3/trace.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\"<\n\rPlaybookInput\x12+\n\x1epreceding_conversation_summary\x18\x01 \x01(\tB\x03\xe0\x41\x01\"0\n\x0ePlaybookOutput\x12\x1e\n\x11\x65xecution_summary\x18\x01 \x01(\tB\x03\xe0\x41\x01\"\xbb\x04\n\x06\x41\x63tion\x12K\n\x0euser_utterance\x18\x01 \x01(\x0b\x32,.google.cloud.dialogflow.cx.v3.UserUtteranceB\x03\xe0\x41\x01H\x00\x12M\n\x0f\x61gent_utterance\x18\x02 \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.AgentUtteranceB\x03\xe0\x41\x01H\x00\x12?\n\x08tool_use\x18\x03 \x01(\x0b\x32&.google.cloud.dialogflow.cx.v3.ToolUseB\x03\xe0\x41\x01H\x00\x12U\n\x13playbook_invocation\x18\x04 \x01(\x0b\x32\x31.google.cloud.dialogflow.cx.v3.PlaybookInvocationB\x03\xe0\x41\x01H\x00\x12M\n\x0f\x66low_invocation\x18\x05 \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.FlowInvocationB\x03\xe0\x41\x01H\x00\x12U\n\x13playbook_transition\x18\x0c \x01(\x0b\x32\x31.google.cloud.dialogflow.cx.v3.PlaybookTransitionB\x03\xe0\x41\x01H\x00\x12M\n\x0f\x66low_transition\x18\r \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.FlowTransitionB\x03\xe0\x41\x01H\x00\x42\x08\n\x06\x61\x63tion\"\"\n\rUserUtterance\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\"#\n\x0e\x41gentUtterance\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xee\x01\n\x07ToolUse\x12\x34\n\x04tool\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Tool\x12\x19\n\x0c\x64isplay_name\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x06\x61\x63tion\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12=\n\x17input_action_parameters\x18\x05 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12>\n\x18output_action_parameters\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\"\xce\x02\n\x12PlaybookInvocation\x12<\n\x08playbook\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/Playbook\x12\x19\n\x0c\x64isplay_name\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12I\n\x0eplaybook_input\x18\x02 \x01(\x0b\x32,.google.cloud.dialogflow.cx.v3.PlaybookInputB\x03\xe0\x41\x01\x12K\n\x0fplaybook_output\x18\x03 \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.PlaybookOutputB\x03\xe0\x41\x01\x12G\n\x0eplaybook_state\x18\x04 \x01(\x0e\x32*.google.cloud.dialogflow.cx.v3.OutputStateB\x03\xe0\x41\x02\"\xa6\x01\n\x0e\x46lowInvocation\x12\x34\n\x04\x66low\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12\x19\n\x0c\x64isplay_name\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\x43\n\nflow_state\x18\x04 \x01(\x0e\x32*.google.cloud.dialogflow.cx.v3.OutputStateB\x03\xe0\x41\x02\"m\n\x12PlaybookTransition\x12<\n\x08playbook\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/Playbook\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x03\"a\n\x0e\x46lowTransition\x12\x34\n\x04\x66low\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x03*\xab\x01\n\x0bOutputState\x12\x1c\n\x18OUTPUT_STATE_UNSPECIFIED\x10\x00\x12\x13\n\x0fOUTPUT_STATE_OK\x10\x01\x12\x1a\n\x16OUTPUT_STATE_CANCELLED\x10\x02\x12\x17\n\x13OUTPUT_STATE_FAILED\x10\x03\x12\x1a\n\x16OUTPUT_STATE_ESCALATED\x10\x04\x12\x18\n\x14OUTPUT_STATE_PENDING\x10\x05\x42\xad\x01\n!com.google.cloud.dialogflow.cx.v3B\nTraceProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + PlaybookInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.PlaybookInput").msgclass + PlaybookOutput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.PlaybookOutput").msgclass + Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Action").msgclass + UserUtterance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UserUtterance").msgclass + AgentUtterance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.AgentUtterance").msgclass + ToolUse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ToolUse").msgclass + PlaybookInvocation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.PlaybookInvocation").msgclass + FlowInvocation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.FlowInvocation").msgclass + PlaybookTransition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.PlaybookTransition").msgclass + FlowTransition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.FlowTransition").msgclass + OutputState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.OutputState").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_group_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_group_pb.rb new file mode 100644 index 000000000000..12885309af51 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_group_pb.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/transition_route_group.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/cx/v3/page_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n:google/cloud/dialogflow/cx/v3/transition_route_group.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/page.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xc9\x03\n\x14TransitionRouteGroup\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12I\n\x11transition_routes\x18\x05 \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.TransitionRoute:\xbc\x02\xea\x41\xb8\x02\n.dialogflow.googleapis.com/TransitionRouteGroup\x12rprojects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}\x12\x65projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}*\x15transitionRouteGroups2\x14transitionRouteGroup\"\xa8\x01\n ListTransitionRouteGroupsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.dialogflow.googleapis.com/TransitionRouteGroup\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x15\n\rlanguage_code\x18\x04 \x01(\t\"\x92\x01\n!ListTransitionRouteGroupsResponse\x12T\n\x17transition_route_groups\x18\x01 \x03(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.TransitionRouteGroup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"}\n\x1eGetTransitionRouteGroupRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.dialogflow.googleapis.com/TransitionRouteGroup\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\xdc\x01\n!CreateTransitionRouteGroupRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.dialogflow.googleapis.com/TransitionRouteGroup\x12X\n\x16transition_route_group\x18\x02 \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.TransitionRouteGroupB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"\xc5\x01\n!UpdateTransitionRouteGroupRequest\x12X\n\x16transition_route_group\x18\x01 \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.TransitionRouteGroupB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"x\n!DeleteTransitionRouteGroupRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.dialogflow.googleapis.com/TransitionRouteGroup\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\x32\xdd\x0e\n\x15TransitionRouteGroups\x12\xc3\x02\n\x19ListTransitionRouteGroups\x12?.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest\x1a@.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse\"\xa2\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x92\x01\x12J/v3/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroupsZD\x12\x42/v3/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups\x12\xb0\x02\n\x17GetTransitionRouteGroup\x12=.google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest\x1a\x33.google.cloud.dialogflow.cx.v3.TransitionRouteGroup\"\xa0\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x92\x01\x12J/v3/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}ZD\x12\x42/v3/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}\x12\xff\x02\n\x1a\x43reateTransitionRouteGroup\x12@.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest\x1a\x33.google.cloud.dialogflow.cx.v3.TransitionRouteGroup\"\xe9\x01\xda\x41\x1dparent,transition_route_group\x82\xd3\xe4\x93\x02\xc2\x01\"J/v3/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups:\x16transition_route_groupZ\\\"B/v3/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups:\x16transition_route_group\x12\xb2\x03\n\x1aUpdateTransitionRouteGroup\x12@.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest\x1a\x33.google.cloud.dialogflow.cx.v3.TransitionRouteGroup\"\x9c\x02\xda\x41\"transition_route_group,update_mask\x82\xd3\xe4\x93\x02\xf0\x01\x32\x61/v3/{transition_route_group.name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}:\x16transition_route_groupZs2Y/v3/{transition_route_group.name=projects/*/locations/*/agents/*/transitionRouteGroups/*}:\x16transition_route_group\x12\x99\x02\n\x1a\x44\x65leteTransitionRouteGroup\x12@.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest\x1a\x16.google.protobuf.Empty\"\xa0\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x92\x01*J/v3/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}ZD*B/v3/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xbc\x01\n!com.google.cloud.dialogflow.cx.v3B\x19TransitionRouteGroupProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.dialogflow.cx.v3.TransitionRoute", "google/cloud/dialogflow/cx/v3/page.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + TransitionRouteGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TransitionRouteGroup").msgclass + ListTransitionRouteGroupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest").msgclass + ListTransitionRouteGroupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse").msgclass + GetTransitionRouteGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest").msgclass + CreateTransitionRouteGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest").msgclass + UpdateTransitionRouteGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest").msgclass + DeleteTransitionRouteGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_group_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_group_services_pb.rb new file mode 100644 index 000000000000..c7b84cef5ab5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_group_services_pb.rb @@ -0,0 +1,73 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/cx/v3/transition_route_group.proto for package 'Google.Cloud.Dialogflow.CX.V3' +# 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/cx/v3/transition_route_group_pb' + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module TransitionRouteGroups + # Service for managing + # [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.cx.v3.TransitionRouteGroups' + + # Returns the list of all transition route groups in the specified flow. + rpc :ListTransitionRouteGroups, ::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsResponse + # Retrieves the specified + # [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. + rpc :GetTransitionRouteGroup, ::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest, ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup + # Creates an + # [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] + # in the specified flow. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc :CreateTransitionRouteGroup, ::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest, ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup + # Updates the specified + # [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc :UpdateTransitionRouteGroup, ::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest, ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup + # Deletes the specified + # [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + rpc :DeleteTransitionRouteGroup, ::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups.rb new file mode 100644 index 000000000000..d5fc7a737a09 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups.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/cx/v3/version" + +require "google/cloud/dialogflow/cx/v3/transition_route_groups/credentials" +require "google/cloud/dialogflow/cx/v3/transition_route_groups/paths" +require "google/cloud/dialogflow/cx/v3/transition_route_groups/client" +require "google/cloud/dialogflow/cx/v3/transition_route_groups/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroups}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/cx/v3/transition_route_groups" + # client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/cx/v3/transition_route_groups/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new + # + module TransitionRouteGroups + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "transition_route_groups", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/transition_route_groups/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb new file mode 100644 index 000000000000..0bf45be3a3f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb @@ -0,0 +1,974 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/transition_route_group_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module TransitionRouteGroups + ## + # Client for the TransitionRouteGroups service. + # + # Service for managing + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroups}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :transition_route_groups_stub + + ## + # Configure the TransitionRouteGroups Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TransitionRouteGroups clients + # ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::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", "CX", "V3"] + 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 TransitionRouteGroups 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::CX::V3::TransitionRouteGroups::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 + @transition_route_groups_stub.universe_domain + end + + ## + # Create a new TransitionRouteGroups client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TransitionRouteGroups 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/cx/v3/transition_route_group_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 + + @transition_route_groups_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::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 + ) + + @transition_route_groups_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 = @transition_route_groups_stub.endpoint + config.universe_domain = @transition_route_groups_stub.universe_domain + config.logger = @transition_route_groups_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 + @transition_route_groups_stub.logger + end + + # Service calls + + ## + # Returns the list of all transition route groups in the specified flow. + # + # @overload list_transition_route_groups(request, options = nil) + # Pass arguments to `list_transition_route_groups` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_transition_route_groups(parent: nil, page_size: nil, page_token: nil, language_code: nil) + # Pass arguments to `list_transition_route_groups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The flow to list all transition route groups for. + # Format: + # `projects//locations//agents//flows/` + # or `projects//locations//agents/. + # @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. + # @param language_code [::String] + # The language to list transition route groups for. The following fields are + # language dependent: + # + # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + # * + # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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 [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest.new + # + # # Call the list_transition_route_groups method. + # result = client.list_transition_route_groups request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::TransitionRouteGroup. + # p item + # end + # + def list_transition_route_groups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest + + # Converts hash and nil to 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_transition_route_groups.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_transition_route_groups.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_transition_route_groups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @transition_route_groups_stub.call_rpc :list_transition_route_groups, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @transition_route_groups_stub, :list_transition_route_groups, 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 + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup}. + # + # @overload get_transition_route_group(request, options = nil) + # Pass arguments to `get_transition_route_group` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_transition_route_group(name: nil, language_code: nil) + # Pass arguments to `get_transition_route_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup}. + # Format: + # `projects//locations//agents//flows//transitionRouteGroups/` + # or + # `projects//locations//agents//transitionRouteGroups/`. + # @param language_code [::String] + # The language to retrieve the transition route group for. The following + # fields are language dependent: + # + # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + # * + # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::TransitionRouteGroup] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest.new + # + # # Call the get_transition_route_group method. + # result = client.get_transition_route_group request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. + # p result + # + def get_transition_route_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest + + # Converts hash and nil to 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_transition_route_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_transition_route_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_transition_route_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @transition_route_groups_stub.call_rpc :get_transition_route_group, request, 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 + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup} + # in the specified flow. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload create_transition_route_group(request, options = nil) + # Pass arguments to `create_transition_route_group` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_transition_route_group(parent: nil, transition_route_group: nil, language_code: nil) + # Pass arguments to `create_transition_route_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The flow to create an + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup} + # for. Format: + # `projects//locations//agents//flows/` + # or `projects//locations//agents/` + # for agent-level groups. + # @param transition_route_group [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup, ::Hash] + # Required. The transition route group to create. + # @param language_code [::String] + # The language of the following fields in `TransitionRouteGroup`: + # + # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + # * + # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::TransitionRouteGroup] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest.new + # + # # Call the create_transition_route_group method. + # result = client.create_transition_route_group request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. + # p result + # + def create_transition_route_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest + + # Converts hash and nil to 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_transition_route_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_transition_route_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_transition_route_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @transition_route_groups_stub.call_rpc :create_transition_route_group, request, 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 + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup}. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload update_transition_route_group(request, options = nil) + # Pass arguments to `update_transition_route_group` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_transition_route_group(transition_route_group: nil, update_mask: nil, language_code: nil) + # Pass arguments to `update_transition_route_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param transition_route_group [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup, ::Hash] + # Required. The transition route group to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The mask to control which fields get updated. + # @param language_code [::String] + # The language of the following fields in `TransitionRouteGroup`: + # + # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + # * + # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::TransitionRouteGroup] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest.new + # + # # Call the update_transition_route_group method. + # result = client.update_transition_route_group request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. + # p result + # + def update_transition_route_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest + + # Converts hash and nil to 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_transition_route_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.transition_route_group&.name + header_params["transition_route_group.name"] = request.transition_route_group.name + end + + request_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_transition_route_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_transition_route_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @transition_route_groups_stub.call_rpc :update_transition_route_group, request, 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 + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup}. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload delete_transition_route_group(request, options = nil) + # Pass arguments to `delete_transition_route_group` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_transition_route_group(name: nil, force: nil) + # Pass arguments to `delete_transition_route_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup} + # to delete. Format: + # `projects//locations//agents//flows//transitionRouteGroups/` + # or + # `projects//locations//agents//transitionRouteGroups/`. + # @param force [::Boolean] + # This field has no effect for transition route group that no page is using. + # If the transition route group is referenced by any page: + # + # * If `force` is set to false, an error will be returned with message + # indicating pages that reference the transition route group. + # * If `force` is set to true, Dialogflow will remove the transition route + # group, as well as any reference to it. + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest.new + # + # # Call the delete_transition_route_group method. + # result = client.delete_transition_route_group request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_transition_route_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest + + # Converts hash and nil to 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_transition_route_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_transition_route_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_transition_route_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @transition_route_groups_stub.call_rpc :delete_transition_route_group, request, 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 TransitionRouteGroups API. + # + # This class represents the configuration for TransitionRouteGroups, + # 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::CX::V3::TransitionRouteGroups::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_transition_route_groups to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_transition_route_groups.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_transition_route_groups.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::CX::V3::TransitionRouteGroups::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 TransitionRouteGroups API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_transition_route_groups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_transition_route_groups + ## + # RPC-specific configuration for `get_transition_route_group` + # @return [::Gapic::Config::Method] + # + attr_reader :get_transition_route_group + ## + # RPC-specific configuration for `create_transition_route_group` + # @return [::Gapic::Config::Method] + # + attr_reader :create_transition_route_group + ## + # RPC-specific configuration for `update_transition_route_group` + # @return [::Gapic::Config::Method] + # + attr_reader :update_transition_route_group + ## + # RPC-specific configuration for `delete_transition_route_group` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_transition_route_group + + # @private + def initialize parent_rpcs = nil + list_transition_route_groups_config = parent_rpcs.list_transition_route_groups if parent_rpcs.respond_to? :list_transition_route_groups + @list_transition_route_groups = ::Gapic::Config::Method.new list_transition_route_groups_config + get_transition_route_group_config = parent_rpcs.get_transition_route_group if parent_rpcs.respond_to? :get_transition_route_group + @get_transition_route_group = ::Gapic::Config::Method.new get_transition_route_group_config + create_transition_route_group_config = parent_rpcs.create_transition_route_group if parent_rpcs.respond_to? :create_transition_route_group + @create_transition_route_group = ::Gapic::Config::Method.new create_transition_route_group_config + update_transition_route_group_config = parent_rpcs.update_transition_route_group if parent_rpcs.respond_to? :update_transition_route_group + @update_transition_route_group = ::Gapic::Config::Method.new update_transition_route_group_config + delete_transition_route_group_config = parent_rpcs.delete_transition_route_group if parent_rpcs.respond_to? :delete_transition_route_group + @delete_transition_route_group = ::Gapic::Config::Method.new delete_transition_route_group_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/credentials.rb new file mode 100644 index 000000000000..ccf23a5e9cdc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module TransitionRouteGroups + # Credentials for the TransitionRouteGroups 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/paths.rb new file mode 100644 index 000000000000..22dc12c3da95 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/paths.rb @@ -0,0 +1,231 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + module TransitionRouteGroups + # Path helper methods for the TransitionRouteGroups API. + module Paths + ## + # Create a fully-qualified Agent resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # + # @return [::String] + def agent_path project:, location:, agent: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}" + end + + ## + # Create a fully-qualified Flow resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # + # @return [::String] + def flow_path project:, location:, agent:, flow: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}" + end + + ## + # Create a fully-qualified Generator resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/generators/{generator}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param generator [String] + # + # @return [::String] + def generator_path project:, location:, agent:, generator: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/generators/#{generator}" + end + + ## + # Create a fully-qualified Intent resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/intents/{intent}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param intent [String] + # + # @return [::String] + def intent_path project:, location:, agent:, intent: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/intents/#{intent}" + end + + ## + # Create a fully-qualified Page resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # @param page [String] + # + # @return [::String] + def page_path project:, location:, agent:, flow:, page: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/pages/#{page}" + end + + ## + # Create a fully-qualified Tool resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param tool [String] + # + # @return [::String] + def tool_path project:, location:, agent:, tool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/tools/#{tool}" + end + + ## + # Create a fully-qualified TransitionRouteGroup resource string. + # + # @overload transition_route_group_path(project:, location:, agent:, flow:, transition_route_group:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # @param transition_route_group [String] + # + # @overload transition_route_group_path(project:, location:, agent:, transition_route_group:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param transition_route_group [String] + # + # @return [::String] + def transition_route_group_path **args + resources = { + "agent:flow:location:project:transition_route_group" => (proc do |project:, location:, agent:, flow:, transition_route_group:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/transitionRouteGroups/#{transition_route_group}" + end), + "agent:location:project:transition_route_group" => (proc do |project:, location:, agent:, transition_route_group:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/transitionRouteGroups/#{transition_route_group}" + 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 Webhook resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param webhook [String] + # + # @return [::String] + def webhook_path project:, location:, agent:, webhook: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/webhooks/#{webhook}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest.rb new file mode 100644 index 000000000000..f1875d7a1ea6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/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/cx/v3/version" +require "google/cloud/dialogflow/cx/v3/bindings_override" + +require "google/cloud/dialogflow/cx/v3/transition_route_groups/credentials" +require "google/cloud/dialogflow/cx/v3/transition_route_groups/paths" +require "google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroups}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/cx/v3/transition_route_groups/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new + # + module TransitionRouteGroups + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/transition_route_groups/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb new file mode 100644 index 000000000000..3f0ce20c675e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb @@ -0,0 +1,904 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/transition_route_group_pb" +require "google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module TransitionRouteGroups + module Rest + ## + # REST client for the TransitionRouteGroups service. + # + # Service for managing + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroups}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :transition_route_groups_stub + + ## + # Configure the TransitionRouteGroups Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TransitionRouteGroups clients + # ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::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", "CX", "V3"] + 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 TransitionRouteGroups 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::CX::V3::TransitionRouteGroups::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 + @transition_route_groups_stub.universe_domain + end + + ## + # Create a new TransitionRouteGroups REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TransitionRouteGroups 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 + + @transition_route_groups_stub = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @transition_route_groups_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 = @transition_route_groups_stub.endpoint + config.universe_domain = @transition_route_groups_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @transition_route_groups_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 + @transition_route_groups_stub.logger + end + + # Service calls + + ## + # Returns the list of all transition route groups in the specified flow. + # + # @overload list_transition_route_groups(request, options = nil) + # Pass arguments to `list_transition_route_groups` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_transition_route_groups(parent: nil, page_size: nil, page_token: nil, language_code: nil) + # Pass arguments to `list_transition_route_groups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The flow to list all transition route groups for. + # Format: + # `projects//locations//agents//flows/` + # or `projects//locations//agents/. + # @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. + # @param language_code [::String] + # The language to list transition route groups for. The following fields are + # language dependent: + # + # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + # * + # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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 [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest.new + # + # # Call the list_transition_route_groups method. + # result = client.list_transition_route_groups request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::TransitionRouteGroup. + # p item + # end + # + def list_transition_route_groups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest + + # Converts hash and nil to an 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_transition_route_groups.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_transition_route_groups.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_transition_route_groups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @transition_route_groups_stub.list_transition_route_groups request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @transition_route_groups_stub, :list_transition_route_groups, "transition_route_groups", 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 + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup}. + # + # @overload get_transition_route_group(request, options = nil) + # Pass arguments to `get_transition_route_group` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_transition_route_group(name: nil, language_code: nil) + # Pass arguments to `get_transition_route_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup}. + # Format: + # `projects//locations//agents//flows//transitionRouteGroups/` + # or + # `projects//locations//agents//transitionRouteGroups/`. + # @param language_code [::String] + # The language to retrieve the transition route group for. The following + # fields are language dependent: + # + # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + # * + # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::TransitionRouteGroup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest.new + # + # # Call the get_transition_route_group method. + # result = client.get_transition_route_group request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. + # p result + # + def get_transition_route_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest + + # Converts hash and nil to an 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_transition_route_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_transition_route_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_transition_route_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @transition_route_groups_stub.get_transition_route_group request, 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 + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup} + # in the specified flow. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload create_transition_route_group(request, options = nil) + # Pass arguments to `create_transition_route_group` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_transition_route_group(parent: nil, transition_route_group: nil, language_code: nil) + # Pass arguments to `create_transition_route_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The flow to create an + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup} + # for. Format: + # `projects//locations//agents//flows/` + # or `projects//locations//agents/` + # for agent-level groups. + # @param transition_route_group [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup, ::Hash] + # Required. The transition route group to create. + # @param language_code [::String] + # The language of the following fields in `TransitionRouteGroup`: + # + # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + # * + # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::TransitionRouteGroup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest.new + # + # # Call the create_transition_route_group method. + # result = client.create_transition_route_group request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. + # p result + # + def create_transition_route_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest + + # Converts hash and nil to an 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_transition_route_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_transition_route_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_transition_route_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @transition_route_groups_stub.create_transition_route_group request, 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 + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup}. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload update_transition_route_group(request, options = nil) + # Pass arguments to `update_transition_route_group` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_transition_route_group(transition_route_group: nil, update_mask: nil, language_code: nil) + # Pass arguments to `update_transition_route_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param transition_route_group [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup, ::Hash] + # Required. The transition route group to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The mask to control which fields get updated. + # @param language_code [::String] + # The language of the following fields in `TransitionRouteGroup`: + # + # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + # * + # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::TransitionRouteGroup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest.new + # + # # Call the update_transition_route_group method. + # result = client.update_transition_route_group request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. + # p result + # + def update_transition_route_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest + + # Converts hash and nil to an 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_transition_route_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_transition_route_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_transition_route_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @transition_route_groups_stub.update_transition_route_group request, 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 + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup}. + # + # Note: You should always train a flow prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + # + # @overload delete_transition_route_group(request, options = nil) + # Pass arguments to `delete_transition_route_group` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_transition_route_group(name: nil, force: nil) + # Pass arguments to `delete_transition_route_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup} + # to delete. Format: + # `projects//locations//agents//flows//transitionRouteGroups/` + # or + # `projects//locations//agents//transitionRouteGroups/`. + # @param force [::Boolean] + # This field has no effect for transition route group that no page is using. + # If the transition route group is referenced by any page: + # + # * If `force` is set to false, an error will be returned with message + # indicating pages that reference the transition route group. + # * If `force` is set to true, Dialogflow will remove the transition route + # group, as well as any reference to it. + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest.new + # + # # Call the delete_transition_route_group method. + # result = client.delete_transition_route_group request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_transition_route_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest + + # Converts hash and nil to an 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_transition_route_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_transition_route_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_transition_route_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @transition_route_groups_stub.delete_transition_route_group request, 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 TransitionRouteGroups REST API. + # + # This class represents the configuration for TransitionRouteGroups 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::CX::V3::TransitionRouteGroups::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_transition_route_groups to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_transition_route_groups.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_transition_route_groups.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 TransitionRouteGroups API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_transition_route_groups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_transition_route_groups + ## + # RPC-specific configuration for `get_transition_route_group` + # @return [::Gapic::Config::Method] + # + attr_reader :get_transition_route_group + ## + # RPC-specific configuration for `create_transition_route_group` + # @return [::Gapic::Config::Method] + # + attr_reader :create_transition_route_group + ## + # RPC-specific configuration for `update_transition_route_group` + # @return [::Gapic::Config::Method] + # + attr_reader :update_transition_route_group + ## + # RPC-specific configuration for `delete_transition_route_group` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_transition_route_group + + # @private + def initialize parent_rpcs = nil + list_transition_route_groups_config = parent_rpcs.list_transition_route_groups if parent_rpcs.respond_to? :list_transition_route_groups + @list_transition_route_groups = ::Gapic::Config::Method.new list_transition_route_groups_config + get_transition_route_group_config = parent_rpcs.get_transition_route_group if parent_rpcs.respond_to? :get_transition_route_group + @get_transition_route_group = ::Gapic::Config::Method.new get_transition_route_group_config + create_transition_route_group_config = parent_rpcs.create_transition_route_group if parent_rpcs.respond_to? :create_transition_route_group + @create_transition_route_group = ::Gapic::Config::Method.new create_transition_route_group_config + update_transition_route_group_config = parent_rpcs.update_transition_route_group if parent_rpcs.respond_to? :update_transition_route_group + @update_transition_route_group = ::Gapic::Config::Method.new update_transition_route_group_config + delete_transition_route_group_config = parent_rpcs.delete_transition_route_group if parent_rpcs.respond_to? :delete_transition_route_group + @delete_transition_route_group = ::Gapic::Config::Method.new delete_transition_route_group_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.rb new file mode 100644 index 000000000000..d5c2d03617c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.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 "google/cloud/dialogflow/cx/v3/transition_route_group_pb" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module TransitionRouteGroups + module Rest + ## + # REST service stub for the TransitionRouteGroups 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_transition_route_groups REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::ListTransitionRouteGroupsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsResponse] + # A result object deserialized from the server's reply + def list_transition_route_groups request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_transition_route_groups_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_transition_route_groups", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsResponse.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_transition_route_group REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::TransitionRouteGroup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] + # A result object deserialized from the server's reply + def get_transition_route_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_transition_route_group_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_transition_route_group", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.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_transition_route_group REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::TransitionRouteGroup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] + # A result object deserialized from the server's reply + def create_transition_route_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_transition_route_group_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_transition_route_group", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.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_transition_route_group REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::TransitionRouteGroup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] + # A result object deserialized from the server's reply + def update_transition_route_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_transition_route_group_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_transition_route_group", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.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_transition_route_group REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_transition_route_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_transition_route_group_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_transition_route_group", + 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_transition_route_groups REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest] + # 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_transition_route_groups_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/transitionRouteGroups", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/transitionRouteGroups", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_transition_route_group REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest] + # 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_transition_route_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/transitionRouteGroups/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/transitionRouteGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_transition_route_group REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest] + # 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_transition_route_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/transitionRouteGroups", + body: "transition_route_group", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/transitionRouteGroups", + body: "transition_route_group", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_transition_route_group REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest] + # 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_transition_route_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v3/{transition_route_group.name}", + body: "transition_route_group", + matches: [ + ["transition_route_group.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/transitionRouteGroups/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v3/{transition_route_group.name}", + body: "transition_route_group", + matches: [ + ["transition_route_group.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/transitionRouteGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_transition_route_group REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest] + # 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_transition_route_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/transitionRouteGroups/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/transitionRouteGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/validation_message_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/validation_message_pb.rb new file mode 100644 index 000000000000..dc1481428aa5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/validation_message_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/validation_message.proto + +require 'google/protobuf' + + +descriptor_data = "\n6google/cloud/dialogflow/cx/v3/validation_message.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\"\x9a\x05\n\x11ValidationMessage\x12T\n\rresource_type\x18\x01 \x01(\x0e\x32=.google.cloud.dialogflow.cx.v3.ValidationMessage.ResourceType\x12\x15\n\tresources\x18\x02 \x03(\tB\x02\x18\x01\x12\x43\n\x0eresource_names\x18\x06 \x03(\x0b\x32+.google.cloud.dialogflow.cx.v3.ResourceName\x12K\n\x08severity\x18\x03 \x01(\x0e\x32\x39.google.cloud.dialogflow.cx.v3.ValidationMessage.Severity\x12\x0e\n\x06\x64\x65tail\x18\x04 \x01(\t\"\xad\x02\n\x0cResourceType\x12\x1d\n\x19RESOURCE_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x41GENT\x10\x01\x12\n\n\x06INTENT\x10\x02\x12\x1a\n\x16INTENT_TRAINING_PHRASE\x10\x08\x12\x14\n\x10INTENT_PARAMETER\x10\t\x12\x0b\n\x07INTENTS\x10\n\x12\x1b\n\x17INTENT_TRAINING_PHRASES\x10\x0b\x12\x0f\n\x0b\x45NTITY_TYPE\x10\x03\x12\x10\n\x0c\x45NTITY_TYPES\x10\x0c\x12\x0b\n\x07WEBHOOK\x10\x04\x12\x08\n\x04\x46LOW\x10\x05\x12\x08\n\x04PAGE\x10\x06\x12\t\n\x05PAGES\x10\r\x12\x1a\n\x16TRANSITION_ROUTE_GROUP\x10\x07\x12 \n\x1c\x41GENT_TRANSITION_ROUTE_GROUP\x10\x0e\"F\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\"2\n\x0cResourceName\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\tB\xb9\x01\n!com.google.cloud.dialogflow.cx.v3B\x16ValidationMessageProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ValidationMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ValidationMessage").msgclass + ValidationMessage::ResourceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ValidationMessage.ResourceType").enummodule + ValidationMessage::Severity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ValidationMessage.Severity").enummodule + ResourceName = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResourceName").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version.rb new file mode 100644 index 000000000000..951b3510a05f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + VERSION = "0.0.1" + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version_pb.rb new file mode 100644 index 000000000000..fd8ea7ef8718 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version_pb.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/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/cloud/dialogflow/cx/v3/flow_pb' +require 'google/longrunning/operations_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/cx/v3/version.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/flow.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"Y\n\x1e\x43reateVersionOperationMetadata\x12\x37\n\x07version\x18\x01 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Version\"\xce\x03\n\x07Version\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x45\n\x0cnlu_settings\x18\x04 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.NluSettingsB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12@\n\x05state\x18\x06 \x01(\x0e\x32,.google.cloud.dialogflow.cx.v3.Version.StateB\x03\xe0\x41\x03\"F\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03:~\xea\x41{\n!dialogflow.googleapis.com/Version\x12Vprojects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}\"w\n\x13ListVersionsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Version\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"i\n\x14ListVersionsResponse\x12\x38\n\x08versions\x18\x01 \x03(\x0b\x32&.google.cloud.dialogflow.cx.v3.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\"\x8f\x01\n\x14\x43reateVersionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Version\x12<\n\x07version\x18\x02 \x01(\x0b\x32&.google.cloud.dialogflow.cx.v3.VersionB\x03\xe0\x41\x02\"\x8a\x01\n\x14UpdateVersionRequest\x12<\n\x07version\x18\x01 \x01(\x0b\x32&.google.cloud.dialogflow.cx.v3.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/Version\"u\n\x12LoadVersionRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Version\x12&\n\x1e\x61llow_override_agent_resources\x18\x02 \x01(\x08\"\xb3\x01\n\x16\x43ompareVersionsRequest\x12?\n\x0c\x62\x61se_version\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Version\x12\x41\n\x0etarget_version\x18\x02 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Version\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"\x93\x01\n\x17\x43ompareVersionsResponse\x12!\n\x19\x62\x61se_version_content_json\x18\x01 \x01(\t\x12#\n\x1btarget_version_content_json\x18\x02 \x01(\t\x12\x30\n\x0c\x63ompare_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xe2\x0c\n\x08Versions\x12\xc7\x01\n\x0cListVersions\x12\x32.google.cloud.dialogflow.cx.v3.ListVersionsRequest\x1a\x33.google.cloud.dialogflow.cx.v3.ListVersionsResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v3/{parent=projects/*/locations/*/agents/*/flows/*}/versions\x12\xb4\x01\n\nGetVersion\x12\x30.google.cloud.dialogflow.cx.v3.GetVersionRequest\x1a&.google.cloud.dialogflow.cx.v3.Version\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v3/{name=projects/*/locations/*/agents/*/flows/*/versions/*}\x12\xf1\x01\n\rCreateVersion\x12\x33.google.cloud.dialogflow.cx.v3.CreateVersionRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41)\n\x07Version\x12\x1e\x43reateVersionOperationMetadata\xda\x41\x0eparent,version\x82\xd3\xe4\x93\x02H\"=/v3/{parent=projects/*/locations/*/agents/*/flows/*}/versions:\x07version\x12\xda\x01\n\rUpdateVersion\x12\x33.google.cloud.dialogflow.cx.v3.UpdateVersionRequest\x1a&.google.cloud.dialogflow.cx.v3.Version\"l\xda\x41\x13version,update_mask\x82\xd3\xe4\x93\x02P2E/v3/{version.name=projects/*/locations/*/agents/*/flows/*/versions/*}:\x07version\x12\xaa\x01\n\rDeleteVersion\x12\x33.google.cloud.dialogflow.cx.v3.DeleteVersionRequest\x1a\x16.google.protobuf.Empty\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?*=/v3/{name=projects/*/locations/*/agents/*/flows/*/versions/*}\x12\xe8\x01\n\x0bLoadVersion\x12\x31.google.cloud.dialogflow.cx.v3.LoadVersionRequest\x1a\x1d.google.longrunning.Operation\"\x86\x01\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xda\x41\x04name\x82\xd3\xe4\x93\x02G\"B/v3/{name=projects/*/locations/*/agents/*/flows/*/versions/*}:load:\x01*\x12\xf1\x01\n\x0f\x43ompareVersions\x12\x35.google.cloud.dialogflow.cx.v3.CompareVersionsRequest\x1a\x36.google.cloud.dialogflow.cx.v3.CompareVersionsResponse\"o\xda\x41\x0c\x62\x61se_version\x82\xd3\xe4\x93\x02Z\"U/v3/{base_version=projects/*/locations/*/agents/*/flows/*/versions/*}:compareVersions:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xaf\x01\n!com.google.cloud.dialogflow.cx.v3B\x0cVersionProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.dialogflow.cx.v3.NluSettings", "google/cloud/dialogflow/cx/v3/flow.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + CreateVersionOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata").msgclass + Version = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Version").msgclass + Version::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Version.State").enummodule + ListVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListVersionsRequest").msgclass + ListVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListVersionsResponse").msgclass + GetVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetVersionRequest").msgclass + CreateVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateVersionRequest").msgclass + UpdateVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateVersionRequest").msgclass + DeleteVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteVersionRequest").msgclass + LoadVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.LoadVersionRequest").msgclass + CompareVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CompareVersionsRequest").msgclass + CompareVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CompareVersionsResponse").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version_services_pb.rb new file mode 100644 index 000000000000..74730cd65921 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version_services_pb.rb @@ -0,0 +1,78 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/cx/v3/version.proto for package 'Google.Cloud.Dialogflow.CX.V3' +# 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/cx/v3/version_pb' + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Versions + # Service for managing [Versions][google.cloud.dialogflow.cx.v3.Version]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.cx.v3.Versions' + + # Returns the list of all versions in the specified + # [Flow][google.cloud.dialogflow.cx.v3.Flow]. + rpc :ListVersions, ::Google::Cloud::Dialogflow::CX::V3::ListVersionsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListVersionsResponse + # Retrieves the specified [Version][google.cloud.dialogflow.cx.v3.Version]. + rpc :GetVersion, ::Google::Cloud::Dialogflow::CX::V3::GetVersionRequest, ::Google::Cloud::Dialogflow::CX::V3::Version + # Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in the specified + # [Flow][google.cloud.dialogflow.cx.v3.Flow]. + # + # 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`: + # [CreateVersionOperationMetadata][google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata] + # - `response`: [Version][google.cloud.dialogflow.cx.v3.Version] + rpc :CreateVersion, ::Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest, ::Google::Longrunning::Operation + # Updates the specified [Version][google.cloud.dialogflow.cx.v3.Version]. + rpc :UpdateVersion, ::Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest, ::Google::Cloud::Dialogflow::CX::V3::Version + # Deletes the specified [Version][google.cloud.dialogflow.cx.v3.Version]. + rpc :DeleteVersion, ::Google::Cloud::Dialogflow::CX::V3::DeleteVersionRequest, ::Google::Protobuf::Empty + # Loads resources in the specified version to the draft flow. + # + # 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`: 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) + rpc :LoadVersion, ::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest, ::Google::Longrunning::Operation + # Compares the specified base version with target version. + rpc :CompareVersions, ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest, ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions.rb new file mode 100644 index 000000000000..7b2e9d01961d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions.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/cx/v3/version" + +require "google/cloud/dialogflow/cx/v3/versions/credentials" +require "google/cloud/dialogflow/cx/v3/versions/paths" +require "google/cloud/dialogflow/cx/v3/versions/operations" +require "google/cloud/dialogflow/cx/v3/versions/client" +require "google/cloud/dialogflow/cx/v3/versions/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Version Versions}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/cx/v3/versions" + # client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/cx/v3/versions/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new + # + module Versions + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "versions", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/versions/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/client.rb new file mode 100644 index 000000000000..debccf1b4b1b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/client.rb @@ -0,0 +1,1148 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/version_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Versions + ## + # Client for the Versions service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Versions::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Versions clients + # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] + 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::CX::V3::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::CX::V3::Versions::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::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/cx/v3/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 + + @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 + + @versions_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::CX::V3::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 long-running operations. + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Versions::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 + @versions_stub.logger + end + + # Service calls + + ## + # Returns the list of all versions in the specified + # {::Google::Cloud::Dialogflow::CX::V3::Flow Flow}. + # + # @overload list_versions(request, options = nil) + # Pass arguments to `list_versions` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Flow Flow} to list all + # versions for. Format: + # `projects//locations//agents//flows/`. + # @param page_size [::Integer] + # The maximum number of items to return in a single page. By default 20 and + # at most 100. + # @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::CX::V3::Version>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Version>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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 {::Google::Cloud::Dialogflow::CX::V3::Version Version}. + # + # @overload get_version(request, options = nil) + # Pass arguments to `get_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Version Version}. + # Format: + # `projects//locations//agents//flows//versions/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Version] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Version] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetVersionRequest.new + # + # # Call the get_version method. + # result = client.get_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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 a {::Google::Cloud::Dialogflow::CX::V3::Version Version} in the specified + # {::Google::Cloud::Dialogflow::CX::V3::Flow Flow}. + # + # 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::CX::V3::CreateVersionOperationMetadata CreateVersionOperationMetadata} + # - `response`: {::Google::Cloud::Dialogflow::CX::V3::Version Version} + # + # @overload create_version(request, options = nil) + # Pass arguments to `create_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Flow Flow} to create an + # {::Google::Cloud::Dialogflow::CX::V3::Version Version} for. Format: + # `projects//locations//agents//flows/`. + # @param version [::Google::Cloud::Dialogflow::CX::V3::Version, ::Hash] + # Required. The version 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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest.new + # + # # Call the create_version method. + # result = client.create_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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| + 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 {::Google::Cloud::Dialogflow::CX::V3::Version Version}. + # + # @overload update_version(request, options = nil) + # Pass arguments to `update_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Version, ::Hash] + # Required. The version to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The mask to control which fields get updated. Currently only + # `description` and `display_name` can be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Version] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Version] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest.new + # + # # Call the update_version method. + # result = client.update_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-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 + + ## + # Deletes the specified {::Google::Cloud::Dialogflow::CX::V3::Version Version}. + # + # @overload delete_version(request, options = nil) + # Pass arguments to `delete_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Version Version} + # to delete. Format: + # `projects//locations//agents//flows//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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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 + + ## + # Loads resources in the specified version to the draft flow. + # + # 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`: 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) + # + # @overload load_version(request, options = nil) + # Pass arguments to `load_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload load_version(name: nil, allow_override_agent_resources: nil) + # Pass arguments to `load_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 {::Google::Cloud::Dialogflow::CX::V3::Version Version} to be loaded + # to draft flow. Format: + # `projects//locations//agents//flows//versions/`. + # @param allow_override_agent_resources [::Boolean] + # This field is used to prevent accidental overwrite of other agent + # resources, which can potentially impact other flow's behavior. If + # `allow_override_agent_resources` is false, conflicted agent-level resources + # will not be overridden (i.e. intents, entities, webhooks). + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest.new + # + # # Call the load_version method. + # result = client.load_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def load_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.load_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.load_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.load_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @versions_stub.call_rpc :load_version, 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 + + ## + # Compares the specified base version with target version. + # + # @overload compare_versions(request, options = nil) + # Pass arguments to `compare_versions` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload compare_versions(base_version: nil, target_version: nil, language_code: nil) + # Pass arguments to `compare_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 base_version [::String] + # Required. Name of the base flow version to compare with the target version. + # Use version ID `0` to indicate the draft version of the specified flow. + # + # Format: + # `projects//locations//agents//flows//versions/`. + # @param target_version [::String] + # Required. Name of the target flow version to compare with the + # base version. Use version ID `0` to indicate the draft version of the + # specified flow. Format: + # `projects//locations//agents//flows//versions/`. + # @param language_code [::String] + # The language to compare the flow versions for. + # + # 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::CX::V3::CompareVersionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest.new + # + # # Call the compare_versions method. + # result = client.compare_versions request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse. + # p result + # + def compare_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.compare_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.base_version + header_params["base_version"] = request.base_version + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.compare_versions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.compare_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @versions_stub.call_rpc :compare_versions, request, 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::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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. + # * `: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. + # * `: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 + ## + # RPC-specific configuration for `load_version` + # @return [::Gapic::Config::Method] + # + attr_reader :load_version + ## + # RPC-specific configuration for `compare_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :compare_versions + + # @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 + load_version_config = parent_rpcs.load_version if parent_rpcs.respond_to? :load_version + @load_version = ::Gapic::Config::Method.new load_version_config + compare_versions_config = parent_rpcs.compare_versions if parent_rpcs.respond_to? :compare_versions + @compare_versions = ::Gapic::Config::Method.new compare_versions_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/credentials.rb new file mode 100644 index 000000000000..fe12b2e33cb5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb new file mode 100644 index 000000000000..0033943804db --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/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 CX + module V3 + module Versions + # 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 Versions 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 Versions 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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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. + # * `: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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/paths.rb new file mode 100644 index 000000000000..6174fd9b5148 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/paths.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + module Versions + # Path helper methods for the Versions API. + module Paths + ## + # Create a fully-qualified Flow resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # + # @return [::String] + def flow_path project:, location:, agent:, flow: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}" + end + + ## + # Create a fully-qualified Version resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param flow [String] + # @param version [String] + # + # @return [::String] + def version_path project:, location:, agent:, flow:, version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/versions/#{version}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest.rb new file mode 100644 index 000000000000..d49861d3404b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/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/cx/v3/version" +require "google/cloud/dialogflow/cx/v3/bindings_override" + +require "google/cloud/dialogflow/cx/v3/versions/credentials" +require "google/cloud/dialogflow/cx/v3/versions/paths" +require "google/cloud/dialogflow/cx/v3/versions/rest/operations" +require "google/cloud/dialogflow/cx/v3/versions/rest/client" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Version Versions}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/cx/v3/versions/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new + # + module Versions + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/versions/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb new file mode 100644 index 000000000000..6a92c67db107 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb @@ -0,0 +1,1064 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/version_pb" +require "google/cloud/dialogflow/cx/v3/versions/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Versions + module Rest + ## + # REST client for the Versions service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Versions::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Versions clients + # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] + 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::CX::V3::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::CX::V3::Versions::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::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 + + @operations_client = ::Google::Cloud::Dialogflow::CX::V3::Versions::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 + + @versions_stub = ::Google::Cloud::Dialogflow::CX::V3::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 long-running operations. + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Versions::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 + @versions_stub.logger + end + + # Service calls + + ## + # Returns the list of all versions in the specified + # {::Google::Cloud::Dialogflow::CX::V3::Flow Flow}. + # + # @overload list_versions(request, options = nil) + # Pass arguments to `list_versions` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Flow Flow} to list all + # versions for. Format: + # `projects//locations//agents//flows/`. + # @param page_size [::Integer] + # The maximum number of items to return in a single page. By default 20 and + # at most 100. + # @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::CX::V3::Version>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Version>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 {::Google::Cloud::Dialogflow::CX::V3::Version Version}. + # + # @overload get_version(request, options = nil) + # Pass arguments to `get_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Version Version}. + # Format: + # `projects//locations//agents//flows//versions/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Version] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Version] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetVersionRequest.new + # + # # Call the get_version method. + # result = client.get_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 a {::Google::Cloud::Dialogflow::CX::V3::Version Version} in the specified + # {::Google::Cloud::Dialogflow::CX::V3::Flow Flow}. + # + # 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::CX::V3::CreateVersionOperationMetadata CreateVersionOperationMetadata} + # - `response`: {::Google::Cloud::Dialogflow::CX::V3::Version Version} + # + # @overload create_version(request, options = nil) + # Pass arguments to `create_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Flow Flow} to create an + # {::Google::Cloud::Dialogflow::CX::V3::Version Version} for. Format: + # `projects//locations//agents//flows/`. + # @param version [::Google::Cloud::Dialogflow::CX::V3::Version, ::Hash] + # Required. The version 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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest.new + # + # # Call the create_version method. + # result = client.create_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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| + 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 {::Google::Cloud::Dialogflow::CX::V3::Version Version}. + # + # @overload update_version(request, options = nil) + # Pass arguments to `update_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Version, ::Hash] + # Required. The version to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The mask to control which fields get updated. Currently only + # `description` and `display_name` can be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Version] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Version] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest.new + # + # # Call the update_version method. + # result = client.update_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # Deletes the specified {::Google::Cloud::Dialogflow::CX::V3::Version Version}. + # + # @overload delete_version(request, options = nil) + # Pass arguments to `delete_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Version Version} + # to delete. Format: + # `projects//locations//agents//flows//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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # Loads resources in the specified version to the draft flow. + # + # 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`: 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) + # + # @overload load_version(request, options = nil) + # Pass arguments to `load_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload load_version(name: nil, allow_override_agent_resources: nil) + # Pass arguments to `load_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 {::Google::Cloud::Dialogflow::CX::V3::Version Version} to be loaded + # to draft flow. Format: + # `projects//locations//agents//flows//versions/`. + # @param allow_override_agent_resources [::Boolean] + # This field is used to prevent accidental overwrite of other agent + # resources, which can potentially impact other flow's behavior. If + # `allow_override_agent_resources` is false, conflicted agent-level resources + # will not be overridden (i.e. intents, entities, webhooks). + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest.new + # + # # Call the load_version method. + # result = client.load_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def load_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.load_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.load_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.load_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @versions_stub.load_version 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 + + ## + # Compares the specified base version with target version. + # + # @overload compare_versions(request, options = nil) + # Pass arguments to `compare_versions` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload compare_versions(base_version: nil, target_version: nil, language_code: nil) + # Pass arguments to `compare_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 base_version [::String] + # Required. Name of the base flow version to compare with the target version. + # Use version ID `0` to indicate the draft version of the specified flow. + # + # Format: + # `projects//locations//agents//flows//versions/`. + # @param target_version [::String] + # Required. Name of the target flow version to compare with the + # base version. Use version ID `0` to indicate the draft version of the + # specified flow. Format: + # `projects//locations//agents//flows//versions/`. + # @param language_code [::String] + # The language to compare the flow versions for. + # + # 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::CX::V3::CompareVersionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest.new + # + # # Call the compare_versions method. + # result = client.compare_versions request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse. + # p result + # + def compare_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.compare_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.compare_versions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.compare_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @versions_stub.compare_versions request, 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::CX::V3::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::CX::V3::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::CX::V3::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. + # * `: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. + # * `: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 + ## + # RPC-specific configuration for `load_version` + # @return [::Gapic::Config::Method] + # + attr_reader :load_version + ## + # RPC-specific configuration for `compare_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :compare_versions + + # @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 + load_version_config = parent_rpcs.load_version if parent_rpcs.respond_to? :load_version + @load_version = ::Gapic::Config::Method.new load_version_config + compare_versions_config = parent_rpcs.compare_versions if parent_rpcs.respond_to? :compare_versions + @compare_versions = ::Gapic::Config::Method.new compare_versions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb new file mode 100644 index 000000000000..797d8af15f52 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/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 CX + module V3 + module Versions + 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 Versions 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 Versions 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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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. + # * `: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: "/v3/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{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: "/v3/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb new file mode 100644 index 000000000000..6ac457736b72 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb @@ -0,0 +1,514 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/version_pb" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + 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::CX::V3::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::CX::V3::ListVersionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::Version] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # 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::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_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Version] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 + + ## + # Baseline implementation for the load_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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 load_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_load_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: "load_version", + 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 compare_versions REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::CompareVersionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse] + # A result object deserialized from the server's reply + def compare_versions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_compare_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: "compare_versions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse.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::CX::V3::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: "/v3/{parent}/versions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{parent}/versions", + body: "version", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{version.name}", + body: "version", + matches: [ + ["version.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the load_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_load_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:load", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the compare_versions REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_compare_versions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{base_version}:compareVersions", + body: "*", + matches: [ + ["base_version", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb new file mode 100644 index 000000000000..35fae2f01958 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/cx/v3/webhook.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/cx/v3/response_message_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n+google/cloud/dialogflow/cx/v3/webhook.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x34google/cloud/dialogflow/cx/v3/response_message.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xdc\x14\n\x07Webhook\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12W\n\x13generic_web_service\x18\x04 \x01(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.Webhook.GenericWebServiceH\x00\x12Z\n\x11service_directory\x18\x07 \x01(\x0b\x32=.google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfigH\x00\x12*\n\x07timeout\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x10\n\x08\x64isabled\x18\x05 \x01(\x08\x1a\x82\x10\n\x11GenericWebService\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x08username\x18\x02 \x01(\tB\x02\x18\x01\x12\x14\n\x08password\x18\x03 \x01(\tB\x02\x18\x01\x12`\n$secret_version_for_username_password\x18\x13 \x01(\tB2\xe0\x41\x01\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x65\n\x0frequest_headers\x18\x04 \x03(\x0b\x32L.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.RequestHeadersEntry\x12\x8f\x01\n#secret_versions_for_request_headers\x18\x14 \x03(\x0b\x32].google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionsForRequestHeadersEntryB\x03\xe0\x41\x01\x12\x1d\n\x10\x61llowed_ca_certs\x18\x05 \x03(\x0c\x42\x03\xe0\x41\x01\x12_\n\x0coauth_config\x18\x0b \x01(\x0b\x32\x44.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfigB\x03\xe0\x41\x01\x12j\n\x12service_agent_auth\x18\x0c \x01(\x0e\x32I.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAgentAuthB\x03\xe0\x41\x01\x12{\n\x1bservice_account_auth_config\x18\x12 \x01(\x0b\x32Q.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfigB\x03\xe0\x41\x01\x12_\n\x0cwebhook_type\x18\x06 \x01(\x0e\x32\x44.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookTypeB\x03\xe0\x41\x01\x12]\n\x0bhttp_method\x18\x07 \x01(\x0e\x32\x43.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethodB\x03\xe0\x41\x01\x12\x19\n\x0crequest_body\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12n\n\x11parameter_mapping\x18\t \x03(\x0b\x32N.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ParameterMappingEntryB\x03\xe0\x41\x01\x1a\x66\n\x18SecretVersionHeaderValue\x12J\n\x0esecret_version\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x1a\xd1\x01\n\x0bOAuthConfig\x12\x16\n\tclient_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rclient_secret\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\\\n secret_version_for_client_secret\x18\x05 \x01(\tB2\xe0\x41\x01\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x1b\n\x0etoken_endpoint\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06scopes\x18\x04 \x03(\tB\x03\xe0\x41\x01\x1a\x38\n\x18ServiceAccountAuthConfig\x12\x1c\n\x0fservice_account\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a\x35\n\x13RequestHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x99\x01\n$SecretVersionsForRequestHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12`\n\x05value\x18\x02 \x01(\x0b\x32Q.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue:\x02\x38\x01\x1a\x37\n\x15ParameterMappingEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"`\n\x10ServiceAgentAuth\x12\"\n\x1eSERVICE_AGENT_AUTH_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x0c\n\x08ID_TOKEN\x10\x02\x12\x10\n\x0c\x41\x43\x43\x45SS_TOKEN\x10\x03\"G\n\x0bWebhookType\x12\x1c\n\x18WEBHOOK_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x0c\n\x08\x46LEXIBLE\x10\x02\"s\n\nHttpMethod\x12\x1b\n\x17HTTP_METHOD_UNSPECIFIED\x10\x00\x12\x08\n\x04POST\x10\x01\x12\x07\n\x03GET\x10\x02\x12\x08\n\x04HEAD\x10\x03\x12\x07\n\x03PUT\x10\x04\x12\n\n\x06\x44\x45LETE\x10\x05\x12\t\n\x05PATCH\x10\x06\x12\x0b\n\x07OPTIONS\x10\x07\x1a\xb1\x01\n\x16ServiceDirectoryConfig\x12@\n\x07service\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\x12U\n\x13generic_web_service\x18\x02 \x01(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService:q\xea\x41n\n!dialogflow.googleapis.com/Webhook\x12Iprojects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}B\t\n\x07webhook\"w\n\x13ListWebhooksRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Webhook\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"i\n\x14ListWebhooksResponse\x12\x38\n\x08webhooks\x18\x01 \x03(\x0b\x32&.google.cloud.dialogflow.cx.v3.Webhook\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x11GetWebhookRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Webhook\"\x8f\x01\n\x14\x43reateWebhookRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Webhook\x12<\n\x07webhook\x18\x02 \x01(\x0b\x32&.google.cloud.dialogflow.cx.v3.WebhookB\x03\xe0\x41\x02\"\x85\x01\n\x14UpdateWebhookRequest\x12<\n\x07webhook\x18\x01 \x01(\x0b\x32&.google.cloud.dialogflow.cx.v3.WebhookB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"^\n\x14\x44\x65leteWebhookRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Webhook\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\"\xc5\n\n\x0eWebhookRequest\x12!\n\x19\x64\x65tect_intent_response_id\x18\x01 \x01(\t\x12\x0e\n\x04text\x18\n \x01(\tH\x00\x12?\n\x0etrigger_intent\x18\x0b \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/IntentH\x00\x12\x14\n\ntranscript\x18\x0c \x01(\tH\x00\x12\x17\n\rtrigger_event\x18\x0e \x01(\tH\x00\x12\x15\n\x0b\x64tmf_digits\x18\x11 \x01(\tH\x00\x12\x15\n\rlanguage_code\x18\x0f \x01(\t\x12W\n\x10\x66ulfillment_info\x18\x06 \x01(\x0b\x32=.google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo\x12M\n\x0bintent_info\x18\x03 \x01(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo\x12:\n\tpage_info\x18\x04 \x01(\x0b\x32\'.google.cloud.dialogflow.cx.v3.PageInfo\x12@\n\x0csession_info\x18\x05 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.SessionInfo\x12@\n\x08messages\x18\x07 \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.ResponseMessage\x12(\n\x07payload\x18\x08 \x01(\x0b\x32\x17.google.protobuf.Struct\x12h\n\x19sentiment_analysis_result\x18\t \x01(\x0b\x32\x45.google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult\x12\x42\n\rlanguage_info\x18\x12 \x01(\x0b\x32+.google.cloud.dialogflow.cx.v3.LanguageInfo\x1a\x1e\n\x0f\x46ulfillmentInfo\x12\x0b\n\x03tag\x18\x01 \x01(\t\x1a\xbb\x03\n\nIntentInfo\x12\x42\n\x13last_matched_intent\x18\x01 \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/Intent\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\\\n\nparameters\x18\x02 \x03(\x0b\x32H.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.ParametersEntry\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x1a^\n\x14IntentParameterValue\x12\x16\n\x0eoriginal_value\x18\x01 \x01(\t\x12.\n\x0eresolved_value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value\x1a\x80\x01\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\\\n\x05value\x18\x02 \x01(\x0b\x32M.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue:\x02\x38\x01\x1a;\n\x17SentimentAnalysisResult\x12\r\n\x05score\x18\x01 \x01(\x02\x12\x11\n\tmagnitude\x18\x02 \x01(\x02\x42\x07\n\x05query\"\xaf\x05\n\x0fWebhookResponse\x12`\n\x14\x66ulfillment_response\x18\x01 \x01(\x0b\x32\x42.google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse\x12:\n\tpage_info\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.cx.v3.PageInfo\x12@\n\x0csession_info\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.SessionInfo\x12(\n\x07payload\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12:\n\x0btarget_page\x18\x05 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/PageH\x00\x12:\n\x0btarget_flow\x18\x06 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/FlowH\x00\x1a\x8b\x02\n\x13\x46ulfillmentResponse\x12@\n\x08messages\x18\x01 \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.ResponseMessage\x12h\n\x0emerge_behavior\x18\x02 \x01(\x0e\x32P.google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.MergeBehavior\"H\n\rMergeBehavior\x12\x1e\n\x1aMERGE_BEHAVIOR_UNSPECIFIED\x10\x00\x12\n\n\x06\x41PPEND\x10\x01\x12\x0b\n\x07REPLACE\x10\x02\x42\x0c\n\ntransition\"\xb3\x04\n\x08PageInfo\x12\x39\n\x0c\x63urrent_page\x18\x01 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Page\x12\x14\n\x0c\x64isplay_name\x18\x04 \x01(\t\x12\x43\n\tform_info\x18\x03 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo\x1a\x90\x03\n\x08\x46ormInfo\x12V\n\x0eparameter_info\x18\x02 \x03(\x0b\x32>.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo\x1a\xab\x02\n\rParameterInfo\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x10\n\x08required\x18\x02 \x01(\x08\x12\\\n\x05state\x18\x03 \x01(\x0e\x32M.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.ParameterState\x12%\n\x05value\x18\x04 \x01(\x0b\x32\x16.google.protobuf.Value\x12\x16\n\x0ejust_collected\x18\x05 \x01(\x08\"U\n\x0eParameterState\x12\x1f\n\x1bPARAMETER_STATE_UNSPECIFIED\x10\x00\x12\t\n\x05\x45MPTY\x10\x01\x12\x0b\n\x07INVALID\x10\x02\x12\n\n\x06\x46ILLED\x10\x03\"\xe1\x01\n\x0bSessionInfo\x12\x37\n\x07session\x18\x01 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Session\x12N\n\nparameters\x18\x02 \x03(\x0b\x32:.google.cloud.dialogflow.cx.v3.SessionInfo.ParametersEntry\x1aI\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"e\n\x0cLanguageInfo\x12\x1b\n\x13input_language_code\x18\x01 \x01(\t\x12\x1e\n\x16resolved_language_code\x18\x02 \x01(\t\x12\x18\n\x10\x63onfidence_score\x18\x03 \x01(\x02\x32\xb7\x08\n\x08Webhooks\x12\xbf\x01\n\x0cListWebhooks\x12\x32.google.cloud.dialogflow.cx.v3.ListWebhooksRequest\x1a\x33.google.cloud.dialogflow.cx.v3.ListWebhooksResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v3/{parent=projects/*/locations/*/agents/*}/webhooks\x12\xac\x01\n\nGetWebhook\x12\x30.google.cloud.dialogflow.cx.v3.GetWebhookRequest\x1a&.google.cloud.dialogflow.cx.v3.Webhook\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v3/{name=projects/*/locations/*/agents/*/webhooks/*}\x12\xc5\x01\n\rCreateWebhook\x12\x33.google.cloud.dialogflow.cx.v3.CreateWebhookRequest\x1a&.google.cloud.dialogflow.cx.v3.Webhook\"W\xda\x41\x0eparent,webhook\x82\xd3\xe4\x93\x02@\"5/v3/{parent=projects/*/locations/*/agents/*}/webhooks:\x07webhook\x12\xd2\x01\n\rUpdateWebhook\x12\x33.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest\x1a&.google.cloud.dialogflow.cx.v3.Webhook\"d\xda\x41\x13webhook,update_mask\x82\xd3\xe4\x93\x02H2=/v3/{webhook.name=projects/*/locations/*/agents/*/webhooks/*}:\x07webhook\x12\xa2\x01\n\rDeleteWebhook\x12\x33.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest\x1a\x16.google.protobuf.Empty\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37*5/v3/{name=projects/*/locations/*/agents/*/webhooks/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xae\x02\n!com.google.cloud.dialogflow.cx.v3B\x0cWebhookProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3\xea\x41|\n\'servicedirectory.googleapis.com/Service\x12Qprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.dialogflow.cx.v3.ResponseMessage", "google/cloud/dialogflow/cx/v3/response_message.proto"], + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dialogflow + module CX + module V3 + Webhook = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook").msgclass + Webhook::GenericWebService = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService").msgclass + Webhook::GenericWebService::SecretVersionHeaderValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue").msgclass + Webhook::GenericWebService::OAuthConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig").msgclass + Webhook::GenericWebService::ServiceAccountAuthConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig").msgclass + Webhook::GenericWebService::ServiceAgentAuth = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAgentAuth").enummodule + Webhook::GenericWebService::WebhookType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookType").enummodule + Webhook::GenericWebService::HttpMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethod").enummodule + Webhook::ServiceDirectoryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig").msgclass + ListWebhooksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListWebhooksRequest").msgclass + ListWebhooksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListWebhooksResponse").msgclass + GetWebhookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetWebhookRequest").msgclass + CreateWebhookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateWebhookRequest").msgclass + UpdateWebhookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateWebhookRequest").msgclass + DeleteWebhookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteWebhookRequest").msgclass + WebhookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookRequest").msgclass + WebhookRequest::FulfillmentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo").msgclass + WebhookRequest::IntentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo").msgclass + WebhookRequest::IntentInfo::IntentParameterValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue").msgclass + WebhookRequest::SentimentAnalysisResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult").msgclass + WebhookResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookResponse").msgclass + WebhookResponse::FulfillmentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse").msgclass + WebhookResponse::FulfillmentResponse::MergeBehavior = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.MergeBehavior").enummodule + PageInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.PageInfo").msgclass + PageInfo::FormInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.PageInfo.FormInfo").msgclass + PageInfo::FormInfo::ParameterInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo").msgclass + PageInfo::FormInfo::ParameterInfo::ParameterState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.ParameterState").enummodule + SessionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SessionInfo").msgclass + LanguageInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.LanguageInfo").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhook_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhook_services_pb.rb new file mode 100644 index 000000000000..6a53482d5b5f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhook_services_pb.rb @@ -0,0 +1,55 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/cx/v3/webhook.proto for package 'Google.Cloud.Dialogflow.CX.V3' +# 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/cx/v3/webhook_pb' + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Webhooks + # Service for managing [Webhooks][google.cloud.dialogflow.cx.v3.Webhook]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.cx.v3.Webhooks' + + # Returns the list of all webhooks in the specified agent. + rpc :ListWebhooks, ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest, ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksResponse + # Retrieves the specified webhook. + rpc :GetWebhook, ::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest, ::Google::Cloud::Dialogflow::CX::V3::Webhook + # Creates a webhook in the specified agent. + rpc :CreateWebhook, ::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest, ::Google::Cloud::Dialogflow::CX::V3::Webhook + # Updates the specified webhook. + rpc :UpdateWebhook, ::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest, ::Google::Cloud::Dialogflow::CX::V3::Webhook + # Deletes the specified webhook. + rpc :DeleteWebhook, ::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks.rb new file mode 100644 index 000000000000..aca8a2761d2c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks.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/cx/v3/version" + +require "google/cloud/dialogflow/cx/v3/webhooks/credentials" +require "google/cloud/dialogflow/cx/v3/webhooks/paths" +require "google/cloud/dialogflow/cx/v3/webhooks/client" +require "google/cloud/dialogflow/cx/v3/webhooks/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Webhook Webhooks}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/cx/v3/webhooks" + # client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/cx/v3/webhooks/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new + # + module Webhooks + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "webhooks", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/webhooks/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb new file mode 100644 index 000000000000..3e1f707d7311 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb @@ -0,0 +1,898 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/webhook_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Webhooks + ## + # Client for the Webhooks service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Webhook Webhooks}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :webhooks_stub + + ## + # Configure the Webhooks Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Webhooks clients + # ::Google::Cloud::Dialogflow::CX::V3::Webhooks::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", "CX", "V3"] + 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 Webhooks 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::CX::V3::Webhooks::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 + @webhooks_stub.universe_domain + end + + ## + # Create a new Webhooks client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Webhooks 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/cx/v3/webhook_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 + + @webhooks_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::CX::V3::Webhooks::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 + ) + + @webhooks_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 = @webhooks_stub.endpoint + config.universe_domain = @webhooks_stub.universe_domain + config.logger = @webhooks_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 + @webhooks_stub.logger + end + + # Service calls + + ## + # Returns the list of all webhooks in the specified agent. + # + # @overload list_webhooks(request, options = nil) + # Pass arguments to `list_webhooks` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_webhooks(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_webhooks` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 webhooks for. + # Format: `projects//locations//agents/`. + # @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::CX::V3::Webhook>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Webhook>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest.new + # + # # Call the list_webhooks method. + # result = client.list_webhooks request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Webhook. + # p item + # end + # + def list_webhooks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest + + # Converts hash and nil to 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_webhooks.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_webhooks.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_webhooks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @webhooks_stub.call_rpc :list_webhooks, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @webhooks_stub, :list_webhooks, 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 webhook. + # + # @overload get_webhook(request, options = nil) + # Pass arguments to `get_webhook` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_webhook(name: nil) + # Pass arguments to `get_webhook` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 webhook. + # Format: + # `projects//locations//agents//webhooks/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Webhook] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest.new + # + # # Call the get_webhook method. + # result = client.get_webhook request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. + # p result + # + def get_webhook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest + + # Converts hash and nil to 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_webhook.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_webhook.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_webhook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @webhooks_stub.call_rpc :get_webhook, request, 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 webhook in the specified agent. + # + # @overload create_webhook(request, options = nil) + # Pass arguments to `create_webhook` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_webhook(parent: nil, webhook: nil) + # Pass arguments to `create_webhook` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 webhook for. + # Format: `projects//locations//agents/`. + # @param webhook [::Google::Cloud::Dialogflow::CX::V3::Webhook, ::Hash] + # Required. The webhook to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Webhook] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest.new + # + # # Call the create_webhook method. + # result = client.create_webhook request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. + # p result + # + def create_webhook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest + + # Converts hash and nil to 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_webhook.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-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_webhook.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_webhook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @webhooks_stub.call_rpc :create_webhook, request, 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 webhook. + # + # @overload update_webhook(request, options = nil) + # Pass arguments to `update_webhook` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_webhook(webhook: nil, update_mask: nil) + # Pass arguments to `update_webhook` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param webhook [::Google::Cloud::Dialogflow::CX::V3::Webhook, ::Hash] + # Required. The webhook to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # 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::CX::V3::Webhook] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest.new + # + # # Call the update_webhook method. + # result = client.update_webhook request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. + # p result + # + def update_webhook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest + + # Converts hash and nil to 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_webhook.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.webhook&.name + header_params["webhook.name"] = request.webhook.name + end + + request_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_webhook.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_webhook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @webhooks_stub.call_rpc :update_webhook, request, 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 webhook. + # + # @overload delete_webhook(request, options = nil) + # Pass arguments to `delete_webhook` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_webhook(name: nil, force: nil) + # Pass arguments to `delete_webhook` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 webhook to delete. + # Format: + # `projects//locations//agents//webhooks/`. + # @param force [::Boolean] + # This field has no effect for webhook not being used. + # For webhooks that are used by pages/flows/transition route groups: + # + # * If `force` is set to false, an error will be returned with message + # indicating the referenced resources. + # * If `force` is set to true, Dialogflow will remove the webhook, as well + # as any references to the webhook (i.e. + # {::Google::Cloud::Dialogflow::CX::V3::Fulfillment#webhook Webhook} and + # {::Google::Cloud::Dialogflow::CX::V3::Fulfillment#tag tag}in fulfillments that + # point to this webhook will be removed). + # + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest.new + # + # # Call the delete_webhook method. + # result = client.delete_webhook request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_webhook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest + + # Converts hash and nil to 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_webhook.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_webhook.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_webhook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @webhooks_stub.call_rpc :delete_webhook, request, 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 Webhooks API. + # + # This class represents the configuration for Webhooks, + # 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::CX::V3::Webhooks::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_webhooks to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_webhooks.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_webhooks.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::CX::V3::Webhooks::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 Webhooks API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_webhooks` + # @return [::Gapic::Config::Method] + # + attr_reader :list_webhooks + ## + # RPC-specific configuration for `get_webhook` + # @return [::Gapic::Config::Method] + # + attr_reader :get_webhook + ## + # RPC-specific configuration for `create_webhook` + # @return [::Gapic::Config::Method] + # + attr_reader :create_webhook + ## + # RPC-specific configuration for `update_webhook` + # @return [::Gapic::Config::Method] + # + attr_reader :update_webhook + ## + # RPC-specific configuration for `delete_webhook` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_webhook + + # @private + def initialize parent_rpcs = nil + list_webhooks_config = parent_rpcs.list_webhooks if parent_rpcs.respond_to? :list_webhooks + @list_webhooks = ::Gapic::Config::Method.new list_webhooks_config + get_webhook_config = parent_rpcs.get_webhook if parent_rpcs.respond_to? :get_webhook + @get_webhook = ::Gapic::Config::Method.new get_webhook_config + create_webhook_config = parent_rpcs.create_webhook if parent_rpcs.respond_to? :create_webhook + @create_webhook = ::Gapic::Config::Method.new create_webhook_config + update_webhook_config = parent_rpcs.update_webhook if parent_rpcs.respond_to? :update_webhook + @update_webhook = ::Gapic::Config::Method.new update_webhook_config + delete_webhook_config = parent_rpcs.delete_webhook if parent_rpcs.respond_to? :delete_webhook + @delete_webhook = ::Gapic::Config::Method.new delete_webhook_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/credentials.rb new file mode 100644 index 000000000000..9ba0648cb130 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Webhooks + # Credentials for the Webhooks 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/paths.rb new file mode 100644 index 000000000000..8e904748dc48 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/paths.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + module Webhooks + # Path helper methods for the Webhooks API. + module Paths + ## + # Create a fully-qualified Agent resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # + # @return [::String] + def agent_path project:, location:, agent: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}" + 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 Webhook resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param webhook [String] + # + # @return [::String] + def webhook_path project:, location:, agent:, webhook: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/webhooks/#{webhook}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest.rb new file mode 100644 index 000000000000..c1ade6e1bbe3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/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/cx/v3/version" +require "google/cloud/dialogflow/cx/v3/bindings_override" + +require "google/cloud/dialogflow/cx/v3/webhooks/credentials" +require "google/cloud/dialogflow/cx/v3/webhooks/paths" +require "google/cloud/dialogflow/cx/v3/webhooks/rest/client" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + ## + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Webhook Webhooks}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/cx/v3/webhooks/rest" + # client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new + # + module Webhooks + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/cx/v3/webhooks/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb new file mode 100644 index 000000000000..b4a9046c10db --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb @@ -0,0 +1,828 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/webhook_pb" +require "google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Webhooks + module Rest + ## + # REST client for the Webhooks service. + # + # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Webhook Webhooks}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :webhooks_stub + + ## + # Configure the Webhooks Client class. + # + # See {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Webhooks clients + # ::Google::Cloud::Dialogflow::CX::V3::Webhooks::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", "CX", "V3"] + 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 Webhooks 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::CX::V3::Webhooks::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 + @webhooks_stub.universe_domain + end + + ## + # Create a new Webhooks REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Webhooks 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 + + @webhooks_stub = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @webhooks_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 = @webhooks_stub.endpoint + config.universe_domain = @webhooks_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @webhooks_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 + @webhooks_stub.logger + end + + # Service calls + + ## + # Returns the list of all webhooks in the specified agent. + # + # @overload list_webhooks(request, options = nil) + # Pass arguments to `list_webhooks` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_webhooks(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_webhooks` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 webhooks for. + # Format: `projects//locations//agents/`. + # @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::CX::V3::Webhook>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Webhook>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest.new + # + # # Call the list_webhooks method. + # result = client.list_webhooks request + # + # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Webhook. + # p item + # end + # + def list_webhooks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest + + # Converts hash and nil to an 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_webhooks.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_webhooks.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_webhooks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @webhooks_stub.list_webhooks request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @webhooks_stub, :list_webhooks, "webhooks", 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 webhook. + # + # @overload get_webhook(request, options = nil) + # Pass arguments to `get_webhook` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_webhook(name: nil) + # Pass arguments to `get_webhook` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 webhook. + # Format: + # `projects//locations//agents//webhooks/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Webhook] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest.new + # + # # Call the get_webhook method. + # result = client.get_webhook request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. + # p result + # + def get_webhook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest + + # Converts hash and nil to an 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_webhook.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_webhook.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_webhook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @webhooks_stub.get_webhook request, 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 webhook in the specified agent. + # + # @overload create_webhook(request, options = nil) + # Pass arguments to `create_webhook` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_webhook(parent: nil, webhook: nil) + # Pass arguments to `create_webhook` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 webhook for. + # Format: `projects//locations//agents/`. + # @param webhook [::Google::Cloud::Dialogflow::CX::V3::Webhook, ::Hash] + # Required. The webhook to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Webhook] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest.new + # + # # Call the create_webhook method. + # result = client.create_webhook request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. + # p result + # + def create_webhook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest + + # Converts hash and nil to an 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_webhook.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_webhook.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_webhook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @webhooks_stub.create_webhook request, 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 webhook. + # + # @overload update_webhook(request, options = nil) + # Pass arguments to `update_webhook` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_webhook(webhook: nil, update_mask: nil) + # Pass arguments to `update_webhook` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param webhook [::Google::Cloud::Dialogflow::CX::V3::Webhook, ::Hash] + # Required. The webhook to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # 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::CX::V3::Webhook] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest.new + # + # # Call the update_webhook method. + # result = client.update_webhook request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. + # p result + # + def update_webhook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest + + # Converts hash and nil to an 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_webhook.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_webhook.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_webhook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @webhooks_stub.update_webhook request, 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 webhook. + # + # @overload delete_webhook(request, options = nil) + # Pass arguments to `delete_webhook` via a request object, either of type + # {::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_webhook(name: nil, force: nil) + # Pass arguments to `delete_webhook` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 webhook to delete. + # Format: + # `projects//locations//agents//webhooks/`. + # @param force [::Boolean] + # This field has no effect for webhook not being used. + # For webhooks that are used by pages/flows/transition route groups: + # + # * If `force` is set to false, an error will be returned with message + # indicating the referenced resources. + # * If `force` is set to true, Dialogflow will remove the webhook, as well + # as any references to the webhook (i.e. + # {::Google::Cloud::Dialogflow::CX::V3::Fulfillment#webhook Webhook} and + # {::Google::Cloud::Dialogflow::CX::V3::Fulfillment#tag tag}in fulfillments that + # point to this webhook will be removed). + # @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/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest.new + # + # # Call the delete_webhook method. + # result = client.delete_webhook request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_webhook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest + + # Converts hash and nil to an 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_webhook.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_webhook.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_webhook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @webhooks_stub.delete_webhook request, 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 Webhooks REST API. + # + # This class represents the configuration for Webhooks 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::CX::V3::Webhooks::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_webhooks to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_webhooks.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_webhooks.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "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 Webhooks API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_webhooks` + # @return [::Gapic::Config::Method] + # + attr_reader :list_webhooks + ## + # RPC-specific configuration for `get_webhook` + # @return [::Gapic::Config::Method] + # + attr_reader :get_webhook + ## + # RPC-specific configuration for `create_webhook` + # @return [::Gapic::Config::Method] + # + attr_reader :create_webhook + ## + # RPC-specific configuration for `update_webhook` + # @return [::Gapic::Config::Method] + # + attr_reader :update_webhook + ## + # RPC-specific configuration for `delete_webhook` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_webhook + + # @private + def initialize parent_rpcs = nil + list_webhooks_config = parent_rpcs.list_webhooks if parent_rpcs.respond_to? :list_webhooks + @list_webhooks = ::Gapic::Config::Method.new list_webhooks_config + get_webhook_config = parent_rpcs.get_webhook if parent_rpcs.respond_to? :get_webhook + @get_webhook = ::Gapic::Config::Method.new get_webhook_config + create_webhook_config = parent_rpcs.create_webhook if parent_rpcs.respond_to? :create_webhook + @create_webhook = ::Gapic::Config::Method.new create_webhook_config + update_webhook_config = parent_rpcs.update_webhook if parent_rpcs.respond_to? :update_webhook + @update_webhook = ::Gapic::Config::Method.new update_webhook_config + delete_webhook_config = parent_rpcs.delete_webhook if parent_rpcs.respond_to? :delete_webhook + @delete_webhook = ::Gapic::Config::Method.new delete_webhook_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb new file mode 100644 index 000000000000..7d97096d31e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb @@ -0,0 +1,390 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/cx/v3/webhook_pb" + +module Google + module Cloud + module Dialogflow + module CX + module V3 + module Webhooks + module Rest + ## + # REST service stub for the Webhooks 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_webhooks REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::ListWebhooksResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::ListWebhooksResponse] + # A result object deserialized from the server's reply + def list_webhooks request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_webhooks_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_webhooks", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksResponse.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_webhook REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Webhook] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] + # A result object deserialized from the server's reply + def get_webhook request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_webhook_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_webhook", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Webhook.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_webhook REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Webhook] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] + # A result object deserialized from the server's reply + def create_webhook request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_webhook_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_webhook", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Webhook.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_webhook REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::CX::V3::Webhook] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] + # A result object deserialized from the server's reply + def update_webhook request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_webhook_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_webhook", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::CX::V3::Webhook.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_webhook REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_webhook request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_webhook_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_webhook", + 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_webhooks REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest] + # 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_webhooks_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/webhooks", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_webhook REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest] + # 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_webhook_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/webhooks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_webhook REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest] + # 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_webhook_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/webhooks", + body: "webhook", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_webhook REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest] + # 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_webhook_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v3/{webhook.name}", + body: "webhook", + matches: [ + ["webhook.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/webhooks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_webhook REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest] + # 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_webhook_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/webhooks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/README.md b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/README.md new file mode 100644 index 000000000000..ac2a0a64738f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/README.md @@ -0,0 +1,4 @@ +# Dialogflow CX V3 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-cx-v3/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/advanced_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/advanced_settings.rb new file mode 100644 index 000000000000..96938318f939 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/advanced_settings.rb @@ -0,0 +1,150 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # Hierarchical advanced settings for agent/flow/page/fulfillment/parameter. + # Settings exposed at lower level overrides the settings exposed at higher + # level. Overriding occurs at the sub-setting level. For example, the + # playback_interruption_settings at fulfillment level only overrides the + # playback_interruption_settings at the agent level, leaving other settings + # at the agent level unchanged. + # + # DTMF settings does not override each other. DTMF settings set at different + # levels define DTMF detections running in parallel. + # + # Hierarchy: Agent->Flow->Page->Fulfillment/Parameter. + # @!attribute [rw] audio_export_gcs_destination + # @return [::Google::Cloud::Dialogflow::CX::V3::GcsDestination] + # If present, incoming audio is exported by Dialogflow to the configured + # Google Cloud Storage destination. + # Exposed at the following levels: + # - Agent level + # - Flow level + # @!attribute [rw] speech_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::AdvancedSettings::SpeechSettings] + # Settings for speech to text detection. + # Exposed at the following levels: + # - Agent level + # - Flow level + # - Page level + # - Parameter level + # @!attribute [rw] dtmf_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::AdvancedSettings::DtmfSettings] + # Settings for DTMF. + # Exposed at the following levels: + # - Agent level + # - Flow level + # - Page level + # - Parameter level. + # @!attribute [rw] logging_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::AdvancedSettings::LoggingSettings] + # Settings for logging. + # Settings for Dialogflow History, Contact Center messages, StackDriver logs, + # and speech logging. + # Exposed at the following levels: + # - Agent level. + class AdvancedSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Define behaviors of speech to text detection. + # @!attribute [rw] endpointer_sensitivity + # @return [::Integer] + # Sensitivity of the speech model that detects the end of speech. + # Scale from 0 to 100. + # @!attribute [rw] no_speech_timeout + # @return [::Google::Protobuf::Duration] + # Timeout before detecting no speech. + # @!attribute [rw] use_timeout_based_endpointing + # @return [::Boolean] + # Use timeout based endpointing, interpreting endpointer sensitivity as + # seconds of timeout value. + # @!attribute [rw] models + # @return [::Google::Protobuf::Map{::String => ::String}] + # Mapping from language to Speech-to-Text model. The mapped Speech-to-Text + # model will be selected for requests from its corresponding language. + # For more information, see + # [Speech + # models](https://cloud.google.com/dialogflow/cx/docs/concept/speech-models). + class SpeechSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ModelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Define behaviors for DTMF (dual tone multi frequency). + # @!attribute [rw] enabled + # @return [::Boolean] + # If true, incoming audio is processed for DTMF (dual tone multi frequency) + # events. For example, if the caller presses a button on their telephone + # keypad and DTMF processing is enabled, Dialogflow will detect the + # event (e.g. a "3" was pressed) in the incoming audio and pass the event + # to the bot to drive business logic (e.g. when 3 is pressed, return the + # account balance). + # @!attribute [rw] max_digits + # @return [::Integer] + # Max length of DTMF digits. + # @!attribute [rw] finish_digit + # @return [::String] + # The digit that terminates a DTMF digit sequence. + # @!attribute [rw] interdigit_timeout_duration + # @return [::Google::Protobuf::Duration] + # Interdigit timeout setting for matching dtmf input to regex. + # @!attribute [rw] endpointing_timeout_duration + # @return [::Google::Protobuf::Duration] + # Endpoint timeout setting for matching dtmf input to regex. + class DtmfSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Define behaviors on logging. + # @!attribute [rw] enable_stackdriver_logging + # @return [::Boolean] + # Enables Google Cloud Logging. + # @!attribute [rw] enable_interaction_logging + # @return [::Boolean] + # Enables DF Interaction logging. + # @!attribute [rw] enable_consent_based_redaction + # @return [::Boolean] + # Enables consent-based end-user input redaction, if true, a pre-defined + # session parameter `$session.params.conversation-redaction` will be + # used to determine if the utterance should be redacted. + class LoggingSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb new file mode 100644 index 000000000000..57abb8222a12 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb @@ -0,0 +1,576 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # Settings related to speech recognition. + # @!attribute [rw] enable_speech_adaptation + # @return [::Boolean] + # Whether to use speech adaptation for speech recognition. + class SpeechToTextSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Agents are best described as Natural Language Understanding (NLU) modules + # that transform user requests into actionable data. You can include agents + # in your app, product, or service to determine user intent and respond to the + # user in a natural way. + # + # After you create an agent, you can add + # {::Google::Cloud::Dialogflow::CX::V3::Intent Intents}, [Entity + # Types][google.cloud.dialogflow.cx.v3.EntityType], + # {::Google::Cloud::Dialogflow::CX::V3::Flow Flows}, + # {::Google::Cloud::Dialogflow::CX::V3::Fulfillment Fulfillments}, + # {::Google::Cloud::Dialogflow::CX::V3::Webhook Webhooks}, + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroups} + # and so on to manage the conversation flows. + # @!attribute [rw] name + # @return [::String] + # The unique identifier of the agent. + # Required for the + # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#update_agent Agents.UpdateAgent} + # method. + # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#create_agent Agents.CreateAgent} + # populates the name automatically. + # Format: `projects//locations//agents/`. + # @!attribute [rw] display_name + # @return [::String] + # Required. The human-readable name of the agent, unique within the location. + # @!attribute [rw] default_language_code + # @return [::String] + # Required. Immutable. The default language of the agent as a language tag. + # See [Language + # Support](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # for a list of the currently supported language codes. + # This field cannot be set by the + # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#update_agent Agents.UpdateAgent} + # method. + # @!attribute [rw] supported_language_codes + # @return [::Array<::String>] + # The list of all languages supported by the agent (except for the + # `default_language_code`). + # @!attribute [rw] time_zone + # @return [::String] + # Required. The time zone of the agent from the [time zone + # database](https://www.iana.org/time-zones), e.g., America/New_York, + # Europe/Paris. + # @!attribute [rw] description + # @return [::String] + # The description of the agent. The maximum length is 500 characters. If + # exceeded, the request is rejected. + # @!attribute [rw] avatar_uri + # @return [::String] + # 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] speech_to_text_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::SpeechToTextSettings] + # Speech recognition related settings. + # @!attribute [rw] start_flow + # @return [::String] + # Name of the start flow in this agent. A start flow will be automatically + # created when the agent is created, and can only be deleted by deleting + # the agent. + # Format: + # `projects//locations//agents//flows/`. + # Currently only the default start flow with id + # "00000000-0000-0000-0000-000000000000" is allowed. + # + # Note: The following fields are mutually exclusive: `start_flow`, `start_playbook`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] start_playbook + # @return [::String] + # Name of the start playbook in this agent. A start playbook will be + # automatically created when the agent is created, and can only be deleted + # by deleting the agent. + # Format: + # `projects//locations//agents//playbooks/`. + # Currently only the + # default playbook with id + # "00000000-0000-0000-0000-000000000000" is allowed. + # + # Note: The following fields are mutually exclusive: `start_playbook`, `start_flow`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] security_settings + # @return [::String] + # Name of the + # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings} + # reference for the agent. Format: + # `projects//locations//securitySettings/`. + # @!attribute [rw] enable_stackdriver_logging + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Indicates if stackdriver logging is enabled for the agent. + # Please use + # {::Google::Cloud::Dialogflow::CX::V3::AdvancedSettings::LoggingSettings agent.advanced_settings} + # instead. + # @!attribute [rw] enable_spell_correction + # @return [::Boolean] + # Indicates if automatic spell correction is enabled in detect intent + # requests. + # @!attribute [rw] enable_multi_language_training + # @return [::Boolean] + # Optional. Enable training multi-lingual models for this agent. These models + # will be trained on all the languages supported by the agent. + # @!attribute [rw] locked + # @return [::Boolean] + # Indicates whether the agent is locked for changes. If the agent is locked, + # modifications to the agent will be rejected except for [RestoreAgent][]. + # @!attribute [rw] advanced_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::AdvancedSettings] + # Hierarchical advanced settings for this agent. The settings exposed at the + # lower level overrides the settings exposed at the higher level. + # @!attribute [rw] git_integration_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::Agent::GitIntegrationSettings] + # Git integration settings for this agent. + # @!attribute [rw] text_to_speech_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::TextToSpeechSettings] + # Settings on instructing the speech synthesizer on how to generate the + # output audio content. + # @!attribute [rw] gen_app_builder_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::Agent::GenAppBuilderSettings] + # Gen App Builder-related agent-level settings. + # @!attribute [rw] answer_feedback_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::Agent::AnswerFeedbackSettings] + # Optional. Answer feedback collection settings. + # @!attribute [rw] personalization_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::Agent::PersonalizationSettings] + # Optional. Settings for end user personalization. + # @!attribute [rw] client_certificate_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::Agent::ClientCertificateSettings] + # Optional. Settings for custom client certificates. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Optional. Output only. A read only boolean field reflecting Zone Separation + # status of the agent. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Optional. Output only. A read only boolean field reflecting Zone Isolation + # status of the agent. + class Agent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Settings for connecting to Git repository for an agent. + # @!attribute [rw] github_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::Agent::GitIntegrationSettings::GithubSettings] + # GitHub settings. + class GitIntegrationSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Settings of integration with GitHub. + # @!attribute [rw] display_name + # @return [::String] + # The unique repository display name for the GitHub repository. + # @!attribute [rw] repository_uri + # @return [::String] + # The GitHub repository URI related to the agent. + # @!attribute [rw] tracking_branch + # @return [::String] + # The branch of the GitHub repository tracked for this agent. + # @!attribute [rw] access_token + # @return [::String] + # The access token used to authenticate the access to the GitHub + # repository. + # @!attribute [rw] branches + # @return [::Array<::String>] + # A list of branches configured to be used from Dialogflow. + class GithubSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Gen App Builder. + # @!attribute [rw] engine + # @return [::String] + # Required. The full name of the Gen App Builder engine related to this + # agent if there is one. Format: `projects/{Project ID}/locations/{Location + # ID}/collections/\\{Collection ID}/engines/\\{Engine ID}` + class GenAppBuilderSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for answer feedback collection. + # @!attribute [rw] enable_answer_feedback + # @return [::Boolean] + # Optional. If enabled, end users will be able to provide + # {::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback answer feedback} to + # Dialogflow responses. Feature works only if interaction logging is + # enabled in the Dialogflow agent. + class AnswerFeedbackSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for end user personalization. + # @!attribute [rw] default_end_user_metadata + # @return [::Google::Protobuf::Struct] + # Optional. Default end user metadata, used when processing DetectIntent + # requests. Recommended to be filled as a template instead of hard-coded + # value, for example { "age": "$session.params.age" }. The data will be + # merged with the + # {::Google::Cloud::Dialogflow::CX::V3::QueryParameters#end_user_metadata QueryParameters.end_user_metadata} + # in + # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest#query_params DetectIntentRequest.query_params} + # during query processing. + class PersonalizationSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for custom client certificates. + # @!attribute [rw] ssl_certificate + # @return [::String] + # Required. The ssl certificate encoded in PEM format. This string must + # include the begin header and end footer lines. + # @!attribute [rw] private_key + # @return [::String] + # Required. The name of the SecretManager secret version resource storing + # the private key encoded in PEM format. Format: + # `projects/{project}/secrets/{secret}/versions/{version}` + # @!attribute [rw] passphrase + # @return [::String] + # Optional. The name of the SecretManager secret version resource storing + # the passphrase. 'passphrase' should be left unset if the private key is + # not encrypted. + # Format: `projects/{project}/secrets/{secret}/versions/{version}` + class ClientCertificateSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#list_agents Agents.ListAgents}. + # @!attribute [rw] parent + # @return [::String] + # Required. The location to list all agents for. + # 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 ListAgentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#list_agents Agents.ListAgents}. + # @!attribute [rw] agents + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::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 ListAgentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#get_agent Agents.GetAgent}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the agent. + # Format: `projects//locations//agents/`. + class GetAgentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#create_agent Agents.CreateAgent}. + # @!attribute [rw] parent + # @return [::String] + # Required. The location to create a agent for. + # Format: `projects//locations/`. + # @!attribute [rw] agent + # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] + # Required. The agent to create. + class CreateAgentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#update_agent Agents.UpdateAgent}. + # @!attribute [rw] agent + # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] + # Required. The agent to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The mask to control which fields get updated. If the mask is not present, + # all fields will be updated. + class UpdateAgentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#delete_agent Agents.DeleteAgent}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the agent to delete. + # Format: `projects//locations//agents/`. + class DeleteAgentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#export_agent Agents.ExportAgent}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the agent to export. + # Format: `projects//locations//agents/`. + # @!attribute [rw] agent_uri + # @return [::String] + # Optional. 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). + # @!attribute [rw] data_format + # @return [::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest::DataFormat] + # Optional. The data format of the exported agent. If not specified, `BLOB` + # is assumed. + # @!attribute [rw] environment + # @return [::String] + # Optional. Environment name. If not set, draft environment is assumed. + # Format: + # `projects//locations//agents//environments/`. + # @!attribute [rw] git_destination + # @return [::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest::GitDestination] + # Optional. The Git branch to export the agent to. + # @!attribute [rw] include_bigquery_export_settings + # @return [::Boolean] + # Optional. Whether to include BigQuery Export setting. + class ExportAgentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Settings for exporting to a git branch. + # @!attribute [rw] tracking_branch + # @return [::String] + # Tracking branch for the git push. + # @!attribute [rw] commit_message + # @return [::String] + # Commit message for the git push. + class GitDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Data format of the exported agent. + module DataFormat + # Unspecified format. + DATA_FORMAT_UNSPECIFIED = 0 + + # Agent content will be exported as raw bytes. + BLOB = 1 + + # Agent content will be exported in JSON Package format. + JSON_PACKAGE = 4 + end + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::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 + # if `agent_uri` is specified in + # {::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest ExportAgentRequest}. + # + # Note: The following fields are mutually exclusive: `agent_uri`, `agent_content`, `commit_sha`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] agent_content + # @return [::String] + # Uncompressed raw byte content for agent. This field is populated + # if none of `agent_uri` and `git_destination` are specified in + # {::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest ExportAgentRequest}. + # + # Note: The following fields are mutually exclusive: `agent_content`, `agent_uri`, `commit_sha`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] commit_sha + # @return [::String] + # Commit SHA of the git push. This field is populated if + # `git_destination` is specified in + # {::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest ExportAgentRequest}. + # + # Note: The following fields are mutually exclusive: `commit_sha`, `agent_uri`, `agent_content`. 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::CX::V3::Agents::Client#restore_agent Agents.RestoreAgent}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the agent to restore into. + # Format: `projects//locations//agents/`. + # @!attribute [rw] agent_uri + # @return [::String] + # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + # to restore agent from. The format of this URI must be + # `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`, `git_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] agent_content + # @return [::String] + # Uncompressed raw byte content for agent. + # + # Note: The following fields are mutually exclusive: `agent_content`, `agent_uri`, `git_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] git_source + # @return [::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest::GitSource] + # Setting for restoring from a git branch + # + # Note: The following fields are mutually exclusive: `git_source`, `agent_uri`, `agent_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] restore_option + # @return [::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest::RestoreOption] + # Agent restore mode. If not specified, `KEEP` is assumed. + class RestoreAgentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Settings for restoring from a git branch + # @!attribute [rw] tracking_branch + # @return [::String] + # tracking branch for the git pull + class GitSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Restore option. + module RestoreOption + # Unspecified. Treated as KEEP. + RESTORE_OPTION_UNSPECIFIED = 0 + + # Always respect the settings from the exported agent file. It may cause + # a restoration failure if some settings (e.g. model type) are not + # supported in the target agent. + KEEP = 1 + + # Fallback to default settings if some settings are not supported in the + # target agent. + FALLBACK = 2 + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#validate_agent Agents.ValidateAgent}. + # @!attribute [rw] name + # @return [::String] + # Required. The agent to validate. + # Format: `projects//locations//agents/`. + # @!attribute [rw] language_code + # @return [::String] + # If not specified, the agent's default language is used. + class ValidateAgentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#get_agent_validation_result Agents.GetAgentValidationResult}. + # @!attribute [rw] name + # @return [::String] + # Required. The agent name. + # Format: + # `projects//locations//agents//validationResult`. + # @!attribute [rw] language_code + # @return [::String] + # If not specified, the agent's default language is used. + class GetAgentValidationResultRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#get_agent_validation_result Agents.GetAgentValidationResult}. + # @!attribute [rw] name + # @return [::String] + # The unique identifier of the agent validation result. + # Format: + # `projects//locations//agents//validationResult`. + # @!attribute [rw] flow_validation_results + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult>] + # Contains all flow validation results. + class AgentValidationResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for + # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#get_generative_settings GetGenerativeSettings} + # RPC. + # @!attribute [rw] name + # @return [::String] + # Required. Format: + # `projects//locations//agents//generativeSettings`. + # @!attribute [rw] language_code + # @return [::String] + # Required. Language code of the generative settings. + class GetGenerativeSettingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for + # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#update_generative_settings UpdateGenerativeSettings} + # RPC. + # @!attribute [rw] generative_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings] + # Required. Generative settings 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 UpdateGenerativeSettingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb new file mode 100644 index 000000000000..f158cc7cc676 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb @@ -0,0 +1,401 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # 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 + + # Configuration of the barge-in behavior. Barge-in instructs the API to return + # a detected utterance at a proper time while the client is playing back the + # response audio from a previous request. When the client sees the + # utterance, it should stop the playback and immediately get ready for + # receiving the responses for the current request. + # + # The barge-in handling requires the client to start streaming audio input + # as soon as it starts playing back the audio from the previous response. The + # playback is modeled into two phases: + # + # * No barge-in phase: which goes first and during which speech detection + # should not be carried out. + # + # * Barge-in phase: which follows the no barge-in phase and during which + # the API starts speech detection and may inform the client that an utterance + # has been detected. Note that no-speech event is not expected in this + # phase. + # + # The client provides this configuration in terms of the durations of those + # two phases. The durations are measured in terms of the audio length from the + # start of the input audio. + # + # No-speech event is a response with END_OF_UTTERANCE without any transcript + # following up. + # @!attribute [rw] no_barge_in_duration + # @return [::Google::Protobuf::Duration] + # Duration that is not eligible for barge-in at the beginning of the input + # audio. + # @!attribute [rw] total_duration + # @return [::Google::Protobuf::Duration] + # Total duration for the playback at the beginning of the input audio. + class BargeInConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Instructs the speech recognizer on how to process the audio content. + # @!attribute [rw] audio_encoding + # @return [::Google::Cloud::Dialogflow::CX::V3::AudioEncoding] + # Required. 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] enable_word_info + # @return [::Boolean] + # Optional. If `true`, Dialogflow returns + # {::Google::Cloud::Dialogflow::CX::V3::SpeechWordInfo SpeechWordInfo} in + # {::Google::Cloud::Dialogflow::CX::V3::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 + # @return [::Array<::String>] + # Optional. 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. + # @!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/cx/docs/concept/speech-models). + # @!attribute [rw] model_variant + # @return [::Google::Cloud::Dialogflow::CX::V3::SpeechModelVariant] + # Optional. Which variant of the [Speech + # model][google.cloud.dialogflow.cx.v3.InputAudioConfig.model] to use. + # @!attribute [rw] single_utterance + # @return [::Boolean] + # Optional. 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. + # @!attribute [rw] barge_in_config + # @return [::Google::Cloud::Dialogflow::CX::V3::BargeInConfig] + # Configuration of barge-in behavior during the streaming of input audio. + # @!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 CX Speech model + # migration](https://cloud.google.com/dialogflow/cx/docs/concept/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::CX::V3::VoiceSelectionParams#ssml_gender ssml_gender}. + # + # For the list of available voices, please refer to [Supported voices and + # languages](https://cloud.google.com/text-to-speech/docs/voices). + # @!attribute [rw] ssml_gender + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::VoiceSelectionParams#name name}. Note that + # this is only a preference, not requirement. If a voice of the appropriate + # gender is not available, the synthesizer substitutes 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::CX::V3::VoiceSelectionParams] + # Optional. The desired voice of the synthesized audio. + class SynthesizeSpeechConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Instructs the speech synthesizer how to generate the output audio content. + # @!attribute [rw] audio_encoding + # @return [::Google::Cloud::Dialogflow::CX::V3::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_config + # @return [::Google::Cloud::Dialogflow::CX::V3::SynthesizeSpeechConfig] + # Optional. Configuration of how speech should be synthesized. + # If not specified, + # {::Google::Cloud::Dialogflow::CX::V3::Agent#text_to_speech_settings Agent.text_to_speech_settings} + # is applied. + class OutputAudioConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings related to speech synthesizing. + # @!attribute [rw] synthesize_speech_configs + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dialogflow::CX::V3::SynthesizeSpeechConfig}] + # Configuration of how speech should be synthesized, mapping from language + # (https://cloud.google.com/dialogflow/cx/docs/reference/language) to + # SynthesizeSpeechConfig. + # + # These settings affect: + # + # - The [phone + # gateway](https://cloud.google.com/dialogflow/cx/docs/concept/integration/phone-gateway) + # synthesize configuration set via + # {::Google::Cloud::Dialogflow::CX::V3::Agent#text_to_speech_settings Agent.text_to_speech_settings}. + # + # - How speech is synthesized when invoking + # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Client session} APIs. + # {::Google::Cloud::Dialogflow::CX::V3::Agent#text_to_speech_settings Agent.text_to_speech_settings} + # only applies if + # {::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig#synthesize_speech_config OutputAudioConfig.synthesize_speech_config} + # is not specified. + class TextToSpeechSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Dialogflow::CX::V3::SynthesizeSpeechConfig] + class SynthesizeSpeechConfigsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + 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). + # LINT: LEGACY_NAMES + 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.cx.v3.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][InputAudioConfig.model] that the caller is eligible for. + 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::CX::V3::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. + 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. + # LINT: LEGACY_NAMES + OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1 + + # MP3 audio at 32kbps. + OUTPUT_AUDIO_ENCODING_MP3 = 2 + + # MP3 audio at 64kbps. + # LINT: LEGACY_NAMES + 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/changelog.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/changelog.rb new file mode 100644 index 000000000000..a8c1d6c19669 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/changelog.rb @@ -0,0 +1,128 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client#list_changelogs Changelogs.ListChangelogs}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent containing the changelogs. + # Format: `projects//locations//agents/`. + # @!attribute [rw] filter + # @return [::String] + # The filter string. Supports filter by user_email, resource, type and + # create_time. Some examples: + # 1. By user email: + # user_email = "someone@google.com" + # 2. By resource name: + # resource = "projects/123/locations/global/agents/456/flows/789" + # 3. By resource display name: + # display_name = "my agent" + # 4. By action: + # action = "Create" + # 5. By type: + # type = "flows" + # 6. By create time. Currently predicates on `create_time` and + # `create_time_epoch_seconds` are supported: + # create_time_epoch_seconds > 1551790877 AND create_time <= + # 2017-01-15T01:30:15.01Z + # 7. Combination of above filters: + # resource = "projects/123/locations/global/agents/456/flows/789" + # AND user_email = "someone@google.com" + # AND create_time <= 2017-01-15T01:30:15.01Z + # @!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 ListChangelogsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client#list_changelogs Changelogs.ListChangelogs}. + # @!attribute [rw] changelogs + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Changelog>] + # The list of changelogs. There will be a maximum number of items returned + # based on the page_size field in the request. The changelogs will be ordered + # by timestamp. + # @!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 ListChangelogsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client#get_changelog Changelogs.GetChangelog}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the changelog to get. + # Format: + # `projects//locations//agents//changelogs/`. + class GetChangelogRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Changelogs represents a change made to a given agent. + # @!attribute [rw] name + # @return [::String] + # The unique identifier of the changelog. + # Format: + # `projects//locations//agents//changelogs/`. + # @!attribute [rw] user_email + # @return [::String] + # Email address of the authenticated user. + # @!attribute [rw] display_name + # @return [::String] + # The affected resource display name of the change. + # @!attribute [rw] action + # @return [::String] + # The action of the change. + # @!attribute [rw] type + # @return [::String] + # The affected resource type. + # @!attribute [rw] resource + # @return [::String] + # The affected resource name of the change. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The timestamp of the change. + # @!attribute [rw] language_code + # @return [::String] + # The affected language code of the change. + class Changelog + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/code_block.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/code_block.rb new file mode 100644 index 000000000000..f2e75e43d0ec --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/code_block.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 Cx + module V3 + # Represents a code block. + # @!attribute [rw] code + # @return [::String] + # Optional. Source code of the block in Python. + class CodeBlock + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/data_store_connection.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/data_store_connection.rb new file mode 100644 index 000000000000..5fd02bc6a3aa --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/data_store_connection.rb @@ -0,0 +1,282 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # A data store connection. It represents a data store in Discovery Engine and + # the type of the contents it contains. + # @!attribute [rw] data_store_type + # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreType] + # The type of the connected data store. + # @!attribute [rw] data_store + # @return [::String] + # The full name of the referenced data store. + # Formats: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + # `projects/{project}/locations/{location}/dataStores/{data_store}` + # @!attribute [rw] document_processing_mode + # @return [::Google::Cloud::Dialogflow::CX::V3::DocumentProcessingMode] + # The document processing mode for the data store connection. Should only be + # set for PUBLIC_WEB and UNSTRUCTURED data stores. If not set it is + # considered as DOCUMENTS, as this is the legacy mode. + class DataStoreConnection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Data store connection feature output signals. + # Might be only partially field if processing stop before the final answer. + # Reasons for this can be, but are not limited to: empty UCS search results, + # positive RAI check outcome, grounding failure, ... + # @!attribute [rw] rewriter_model_call_signals + # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::RewriterModelCallSignals] + # Optional. Diagnostic info related to the rewriter model call. + # @!attribute [rw] rewritten_query + # @return [::String] + # Optional. Rewritten string query used for search. + # @!attribute [rw] search_snippets + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::SearchSnippet>] + # Optional. Search snippets included in the answer generation prompt. + # @!attribute [rw] answer_generation_model_call_signals + # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::AnswerGenerationModelCallSignals] + # Optional. Diagnostic info related to the answer generation model call. + # @!attribute [rw] answer + # @return [::String] + # Optional. The final compiled answer. + # @!attribute [rw] answer_parts + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::AnswerPart>] + # Optional. Answer parts with relevant citations. + # Concatenation of texts should add up the `answer` (not counting + # whitespaces). + # @!attribute [rw] cited_snippets + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::CitedSnippet>] + # Optional. Snippets cited by the answer generation model from the most to + # least relevant. + # @!attribute [rw] grounding_signals + # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::GroundingSignals] + # Optional. Grounding signals. + # @!attribute [rw] safety_signals + # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::SafetySignals] + # Optional. Safety check result. + class DataStoreConnectionSignals + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Diagnostic info related to the rewriter model call. + # @!attribute [rw] rendered_prompt + # @return [::String] + # Prompt as sent to the model. + # @!attribute [rw] model_output + # @return [::String] + # Output of the generative model. + # @!attribute [rw] model + # @return [::String] + # Name of the generative model. For example, "gemini-ultra", "gemini-pro", + # "gemini-1.5-flash" etc. Defaults to "Other" if the model is unknown. + class RewriterModelCallSignals + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Search snippet details. + # @!attribute [rw] document_title + # @return [::String] + # Title of the enclosing document. + # @!attribute [rw] document_uri + # @return [::String] + # Uri for the document. Present if specified for the document. + # @!attribute [rw] text + # @return [::String] + # Text included in the prompt. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Struct] + # Metadata associated with the document. + class SearchSnippet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Diagnostic info related to the answer generation model call. + # @!attribute [rw] rendered_prompt + # @return [::String] + # Prompt as sent to the model. + # @!attribute [rw] model_output + # @return [::String] + # Output of the generative model. + # @!attribute [rw] model + # @return [::String] + # Name of the generative model. For example, "gemini-ultra", "gemini-pro", + # "gemini-1.5-flash" etc. Defaults to "Other" if the model is unknown. + class AnswerGenerationModelCallSignals + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Answer part with citation. + # @!attribute [rw] text + # @return [::String] + # Substring of the answer. + # @!attribute [rw] supporting_indices + # @return [::Array<::Integer>] + # Citations for this answer part. Indices of `search_snippets`. + class AnswerPart + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Snippet cited by the answer generation model. + # @!attribute [rw] search_snippet + # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::SearchSnippet] + # Details of the snippet. + # @!attribute [rw] snippet_index + # @return [::Integer] + # Index of the snippet in `search_snippets` field. + class CitedSnippet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Grounding signals. + # @!attribute [rw] decision + # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::GroundingSignals::GroundingDecision] + # Represents the decision of the grounding check. + # @!attribute [rw] score + # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::GroundingSignals::GroundingScoreBucket] + # Grounding score bucket setting. + class GroundingSignals + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents the decision of the grounding check. + module GroundingDecision + # Decision not specified. + GROUNDING_DECISION_UNSPECIFIED = 0 + + # Grounding have accepted the answer. + ACCEPTED_BY_GROUNDING = 1 + + # Grounding have rejected the answer. + REJECTED_BY_GROUNDING = 2 + end + + # Grounding score buckets. + module GroundingScoreBucket + # Score not specified. + GROUNDING_SCORE_BUCKET_UNSPECIFIED = 0 + + # We have very low confidence that the answer is grounded. + VERY_LOW = 1 + + # We have low confidence that the answer is grounded. + LOW = 3 + + # We have medium confidence that the answer is grounded. + MEDIUM = 4 + + # We have high confidence that the answer is grounded. + HIGH = 5 + + # We have very high confidence that the answer is grounded. + VERY_HIGH = 6 + end + end + + # Safety check results. + # @!attribute [rw] decision + # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::SafetySignals::SafetyDecision] + # Safety decision. + # @!attribute [rw] banned_phrase_match + # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::SafetySignals::BannedPhraseMatch] + # Specifies banned phrase match subject. + # @!attribute [rw] matched_banned_phrase + # @return [::String] + # The matched banned phrase if there was a match. + class SafetySignals + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Safety decision. + # All kinds of check are incorporated into this final decision, including + # banned phrases check. + module SafetyDecision + # Decision not specified. + SAFETY_DECISION_UNSPECIFIED = 0 + + # No manual or automatic safety check fired. + ACCEPTED_BY_SAFETY_CHECK = 1 + + # One ore more safety checks fired. + REJECTED_BY_SAFETY_CHECK = 2 + end + + # Specifies banned phrase match subject. + module BannedPhraseMatch + # No banned phrase check was executed. + BANNED_PHRASE_MATCH_UNSPECIFIED = 0 + + # All banned phrase checks led to no match. + BANNED_PHRASE_MATCH_NONE = 1 + + # A banned phrase matched the query. + BANNED_PHRASE_MATCH_QUERY = 2 + + # A banned phrase matched the response. + BANNED_PHRASE_MATCH_RESPONSE = 3 + end + end + end + + # Type of a data store. + # Determines how search is performed in the data store. + module DataStoreType + # Not specified. This value indicates that the data store type is not + # specified, so it will not be used during search. + DATA_STORE_TYPE_UNSPECIFIED = 0 + + # A data store that contains public web content. + PUBLIC_WEB = 1 + + # A data store that contains unstructured private data. + UNSTRUCTURED = 2 + + # A data store that contains structured data (for example FAQ). + STRUCTURED = 3 + end + + # The document processing mode of the data store. + module DocumentProcessingMode + # Not specified. This should be set for STRUCTURED type data stores. Due to + # legacy reasons this is considered as DOCUMENTS for STRUCTURED and + # PUBLIC_WEB data stores. + DOCUMENT_PROCESSING_MODE_UNSPECIFIED = 0 + + # Documents are processed as documents. + DOCUMENTS = 1 + + # Documents are converted to chunks. + CHUNKS = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/deployment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/deployment.rb new file mode 100644 index 000000000000..704cb4953d43 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/deployment.rb @@ -0,0 +1,138 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # Represents a deployment in an environment. A deployment happens when a flow + # version configured to be active in the environment. You can configure running + # pre-deployment steps, e.g. running validation test cases, experiment + # auto-rollout, etc. + # @!attribute [rw] name + # @return [::String] + # The name of the deployment. + # Format: + # projects//locations//agents//environments//deployments/. + # @!attribute [rw] flow_version + # @return [::String] + # The name of the flow version for this deployment. + # Format: + # projects//locations//agents//flows//versions/. + # @!attribute [rw] state + # @return [::Google::Cloud::Dialogflow::CX::V3::Deployment::State] + # The current state of the deployment. + # @!attribute [rw] result + # @return [::Google::Cloud::Dialogflow::CX::V3::Deployment::Result] + # Result of the deployment. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Start time of this deployment. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # End time of this deployment. + class Deployment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Result of the deployment. + # @!attribute [rw] deployment_test_results + # @return [::Array<::String>] + # Results of test cases running before the deployment. + # Format: + # `projects//locations//agents//testCases//results/`. + # @!attribute [rw] experiment + # @return [::String] + # The name of the experiment triggered by this deployment. + # Format: + # projects//locations//agents//environments//experiments/. + class Result + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The state of the deployment. + module State + # State unspecified. + STATE_UNSPECIFIED = 0 + + # The deployment is running. + RUNNING = 1 + + # The deployment succeeded. + SUCCEEDED = 2 + + # The deployment failed. + FAILED = 3 + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Deployments::Client#list_deployments Deployments.ListDeployments}. + # @!attribute [rw] parent + # @return [::String] + # Required. The {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to + # list all environments for. Format: + # `projects//locations//agents//environments/`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return in a single page. By default 20 and + # at most 100. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token value returned from a previous list request. + class ListDeploymentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Deployments::Client#list_deployments Deployments.ListDeployments}. + # @!attribute [rw] deployments + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Deployment>] + # The list of deployments. There will be a maximum number of items + # returned based on the page_size field in the request. The list may in some + # cases be empty or contain fewer entries than page_size even if this isn't + # the last page. + # @!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 ListDeploymentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Deployments::Client#get_deployment Deployments.GetDeployment}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the + # {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployment}. Format: + # `projects//locations//agents//environments//deployments/`. + class GetDeploymentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/entity_type.rb new file mode 100644 index 000000000000..27c1594fe5eb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/entity_type.rb @@ -0,0 +1,519 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # Entities are extracted from user input and represent parameters that are + # meaningful to your application. For example, a date range, a proper name + # such as a geographic location or landmark, and so on. Entities represent + # actionable data for your application. + # + # When you define an entity, you can also include synonyms that all map to + # that entity. For example, "soft drink", "soda", "pop", and so on. + # + # There are three types of entities: + # + # * **System** - entities that are defined by the Dialogflow API for common + # data types such as date, time, currency, and so on. A system entity is + # represented by the `EntityType` type. + # + # * **Custom** - entities that are defined by you that represent + # actionable data that is meaningful to your application. For example, + # you could define a `pizza.sauce` entity for red or white pizza sauce, + # a `pizza.cheese` entity for the different types of cheese on a pizza, + # a `pizza.topping` entity for different toppings, and so on. A custom + # entity is represented by the `EntityType` type. + # + # * **User** - entities that are built for an individual user such as + # favorites, preferences, playlists, and so on. A user entity is + # represented by the + # {::Google::Cloud::Dialogflow::CX::V3::SessionEntityType SessionEntityType} + # type. + # + # For more information about entity types, see the [Dialogflow + # documentation](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::CX::V3::EntityTypes::Client#update_entity_type EntityTypes.UpdateEntityType}. + # Format: + # `projects//locations//agents//entityTypes/`. + # @!attribute [rw] display_name + # @return [::String] + # Required. The human-readable name of the entity type, unique within the + # agent. + # @!attribute [rw] kind + # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType::Kind] + # Required. Indicates the kind of entity type. + # @!attribute [rw] auto_expansion_mode + # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType::AutoExpansionMode] + # Indicates whether the entity type can be automatically expanded. + # @!attribute [rw] entities + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::EntityType::Entity>] + # The collection of entity entries associated with the entity type. + # @!attribute [rw] excluded_phrases + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::EntityType::ExcludedPhrase>] + # Collection of exceptional words and phrases that shouldn't be matched. + # For example, if you have a size entity type with entry `giant`(an + # adjective), you might consider adding `giants`(a noun) as an exclusion. + # If the kind of entity type is `KIND_MAP`, then the phrases specified by + # entities and excluded phrases should be mutually exclusive. + # @!attribute [rw] enable_fuzzy_extraction + # @return [::Boolean] + # Enables fuzzy entity extraction during classification. + # @!attribute [rw] redact + # @return [::Boolean] + # Indicates whether parameters of the entity type should be redacted in log. + # If redaction is enabled, page parameters and intent parameters referring to + # the entity type will be replaced by parameter name when logging. + 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 canonical 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 + + # An excluded entity phrase that should not be matched. + # @!attribute [rw] value + # @return [::String] + # Required. The word or phrase to be excluded. + class ExcludedPhrase + 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 canonical + # value. + KIND_MAP = 1 + + # List entity types contain a set of entries that do not map to canonical + # 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::CX::V3::EntityTypes::Client#export_entity_types EntityTypes.ExportEntityTypes}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent agent to export entity types. + # Format: `projects//locations//agents/`. + # @!attribute [rw] entity_types + # @return [::Array<::String>] + # Required. The name of the entity types to export. + # Format: + # `projects//locations//agents//entityTypes/`. + # @!attribute [rw] entity_types_uri + # @return [::String] + # Optional. The [Google Cloud + # Storage](https://cloud.google.com/storage/docs/) URI to export the entity + # types to. The format of this URI must be + # `gs:///`. + # + # 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). + # + # Note: The following fields are mutually exclusive: `entity_types_uri`, `entity_types_content_inline`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] entity_types_content_inline + # @return [::Boolean] + # Optional. The option to return the serialized entity types inline. + # + # Note: The following fields are mutually exclusive: `entity_types_content_inline`, `entity_types_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] data_format + # @return [::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest::DataFormat] + # Optional. The data format of the exported entity types. If not specified, + # `BLOB` is assumed. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The language to retrieve the entity type for. The following + # fields are language dependent: + # + # * `EntityType.entities.value` + # * `EntityType.entities.synonyms` + # * `EntityType.excluded_phrases.value` + # + # If not specified, all language dependent fields will be retrieved. + # [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 ExportEntityTypesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Data format of the exported entity types. + module DataFormat + # Unspecified format. Treated as `BLOB`. + DATA_FORMAT_UNSPECIFIED = 0 + + # EntityTypes will be exported as raw bytes. + BLOB = 1 + + # EntityTypes will be exported in JSON Package format. + JSON_PACKAGE = 5 + end + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#export_entity_types EntityTypes.ExportEntityTypes}. + # @!attribute [rw] entity_types_uri + # @return [::String] + # The URI to a file containing the exported entity types. This field is + # populated only if `entity_types_uri` is specified in + # {::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest ExportEntityTypesRequest}. + # + # Note: The following fields are mutually exclusive: `entity_types_uri`, `entity_types_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] entity_types_content + # @return [::Google::Cloud::Dialogflow::CX::V3::InlineDestination] + # Uncompressed byte content for entity types. This field is populated only + # if `entity_types_content_inline` is set to true in + # {::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest ExportEntityTypesRequest}. + # + # Note: The following fields are mutually exclusive: `entity_types_content`, `entity_types_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ExportEntityTypesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata returned for the + # {::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#export_entity_types EntityTypes.ExportEntityTypes} + # long running operation. + class ExportEntityTypesMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#import_entity_types EntityTypes.ImportEntityTypes}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to import the entity types into. + # Format: `projects//locations//agents/`. + # @!attribute [rw] entity_types_uri + # @return [::String] + # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + # to import entity types from. The format of this URI must be + # `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: `entity_types_uri`, `entity_types_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] entity_types_content + # @return [::Google::Cloud::Dialogflow::CX::V3::InlineSource] + # Uncompressed byte content of entity types. + # + # Note: The following fields are mutually exclusive: `entity_types_content`, `entity_types_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] merge_option + # @return [::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest::MergeOption] + # Required. Merge option for importing entity types. + # @!attribute [rw] target_entity_type + # @return [::String] + # Optional. The target entity type to import into. + # Format: + # `projects//locations//agents//entity_types/`. + # If set, there should be only one entity type included in + # [entity_types][google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.entity_types], + # of which the type should match the type of the target entity type. All + # {::Google::Cloud::Dialogflow::CX::V3::EntityType#entities entities} in the + # imported entity type will be added to the target entity type. + class ImportEntityTypesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Merge option when display name conflicts exist during import. + module MergeOption + # Unspecified. If used, system uses REPORT_CONFLICT as default. + MERGE_OPTION_UNSPECIFIED = 0 + + # Replace the original entity type in the agent with the new entity type + # when display name conflicts exist. + REPLACE = 1 + + # Merge the original entity type with the new entity type when display name + # conflicts exist. + MERGE = 2 + + # Create new entity types with new display names to differentiate them from + # the existing entity types when display name conflicts exist. + RENAME = 3 + + # Report conflict information if display names conflict is detected. + # Otherwise, import entity types. + REPORT_CONFLICT = 4 + + # Keep the original entity type and discard the conflicting new entity type + # when display name conflicts exist. + KEEP = 5 + end + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#import_entity_types EntityTypes.ImportEntityTypes}. + # @!attribute [rw] entity_types + # @return [::Array<::String>] + # The unique identifier of the imported entity types. + # Format: + # `projects//locations//agents//entity_types/`. + # @!attribute [rw] conflicting_resources + # @return [::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesResponse::ConflictingResources] + # Info which resources have conflicts when + # [REPORT_CONFLICT][ImportEntityTypesResponse.REPORT_CONFLICT] merge_option + # is set in ImportEntityTypesRequest. + class ImportEntityTypesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Conflicting resources detected during the import process. Only filled when + # [REPORT_CONFLICT][ImportEntityTypesResponse.REPORT_CONFLICT] is set in the + # request and there are conflicts in the display names. + # @!attribute [rw] entity_type_display_names + # @return [::Array<::String>] + # Display names of conflicting entity types. + # @!attribute [rw] entity_display_names + # @return [::Array<::String>] + # Display names of conflicting entities. + class ConflictingResources + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Metadata returned for the + # {::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#import_entity_types EntityTypes.ImportEntityTypes} + # long running operation. + class ImportEntityTypesMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#list_entity_types EntityTypes.ListEntityTypes}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to list all entity types for. + # Format: `projects//locations//agents/`. + # @!attribute [rw] language_code + # @return [::String] + # The language to list entity types for. The following fields are language + # dependent: + # + # * `EntityType.entities.value` + # * `EntityType.entities.synonyms` + # * `EntityType.excluded_phrases.value` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + # @!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 ListEntityTypesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#list_entity_types EntityTypes.ListEntityTypes}. + # @!attribute [rw] entity_types + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::EntityType>] + # The list of 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::CX::V3::EntityTypes::Client#get_entity_type EntityTypes.GetEntityType}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the entity type. + # Format: + # `projects//locations//agents//entityTypes/`. + # @!attribute [rw] language_code + # @return [::String] + # The language to retrieve the entity type for. The following fields are + # language dependent: + # + # * `EntityType.entities.value` + # * `EntityType.entities.synonyms` + # * `EntityType.excluded_phrases.value` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + class GetEntityTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#create_entity_type EntityTypes.CreateEntityType}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to create a entity type for. + # Format: `projects//locations//agents/`. + # @!attribute [rw] entity_type + # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType] + # Required. The entity type to create. + # @!attribute [rw] language_code + # @return [::String] + # The language of the following fields in `entity_type`: + # + # * `EntityType.entities.value` + # * `EntityType.entities.synonyms` + # * `EntityType.excluded_phrases.value` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + class CreateEntityTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#update_entity_type EntityTypes.UpdateEntityType}. + # @!attribute [rw] entity_type + # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType] + # Required. The entity type to update. + # @!attribute [rw] language_code + # @return [::String] + # The language of the following fields in `entity_type`: + # + # * `EntityType.entities.value` + # * `EntityType.entities.synonyms` + # * `EntityType.excluded_phrases.value` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # 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::CX::V3::EntityTypes::Client#delete_entity_type EntityTypes.DeleteEntityType}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the entity type to delete. + # Format: + # `projects//locations//agents//entityTypes/`. + # @!attribute [rw] force + # @return [::Boolean] + # This field has no effect for entity type not being used. + # For entity types that are used by intents or pages: + # + # * If `force` is set to false, an error will be returned with message + # indicating the referencing resources. + # * If `force` is set to true, Dialogflow will remove the entity type, as + # well as any references to the entity type (i.e. Page + # {::Google::Cloud::Dialogflow::CX::V3::Form::Parameter parameter} of the entity + # type will be changed to + # '@sys.any' and intent + # {::Google::Cloud::Dialogflow::CX::V3::Intent::Parameter parameter} of the + # entity type will be removed). + class DeleteEntityTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/environment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/environment.rb new file mode 100644 index 000000000000..be12d21f280c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/environment.rb @@ -0,0 +1,380 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # Represents an environment for an agent. 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. + # @!attribute [rw] name + # @return [::String] + # The name of the environment. + # Format: + # `projects//locations//agents//environments/`. + # @!attribute [rw] display_name + # @return [::String] + # Required. The human-readable name of the environment (unique in an agent). + # Limit of 64 characters. + # @!attribute [rw] description + # @return [::String] + # The human-readable description of the environment. The maximum length is + # 500 characters. If exceeded, the request is rejected. + # @!attribute [rw] version_configs + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Environment::VersionConfig>] + # A list of configurations for flow versions. You should include version + # configs for all flows that are reachable from [`Start + # Flow`][Agent.start_flow] in the agent. Otherwise, an error will be + # returned. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Update time of this environment. + # @!attribute [rw] test_cases_config + # @return [::Google::Cloud::Dialogflow::CX::V3::Environment::TestCasesConfig] + # The test cases config for continuous tests of this environment. + # @!attribute [rw] webhook_config + # @return [::Google::Cloud::Dialogflow::CX::V3::Environment::WebhookConfig] + # The webhook configuration for this environment. + class Environment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration for the version. + # @!attribute [rw] version + # @return [::String] + # Required. Flow, playbook and tool versions are supported. + # Format for flow version: + # projects//locations//agents//flows//versions/. + # Format for playbook version: + # projects//locations//agents//playbooks//versions/. + # Format for tool version: + # projects//locations//agents//tools//versions/. + class VersionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The configuration for continuous tests. + # @!attribute [rw] test_cases + # @return [::Array<::String>] + # A list of test case names to run. They should be under the same agent. + # Format of each test case name: + # `projects//locations//agents//testCases/` + # @!attribute [rw] enable_continuous_run + # @return [::Boolean] + # Whether to run test cases in + # {::Google::Cloud::Dialogflow::CX::V3::Environment::TestCasesConfig#test_cases TestCasesConfig.test_cases} + # periodically. Default false. If set to true, run once a day. + # @!attribute [rw] enable_predeployment_run + # @return [::Boolean] + # Whether to run test cases in + # {::Google::Cloud::Dialogflow::CX::V3::Environment::TestCasesConfig#test_cases TestCasesConfig.test_cases} + # before deploying a flow version to the environment. Default false. + class TestCasesConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for webhooks. + # @!attribute [rw] webhook_overrides + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Webhook>] + # The list of webhooks to override for the agent environment. The webhook + # must exist in the agent. You can override fields in + # {::Google::Cloud::Dialogflow::CX::V3::Webhook#generic_web_service `generic_web_service`} + # and + # {::Google::Cloud::Dialogflow::CX::V3::Webhook#service_directory `service_directory`}. + class WebhookConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#list_environments Environments.ListEnvironments}. + # @!attribute [rw] parent + # @return [::String] + # Required. The {::Google::Cloud::Dialogflow::CX::V3::Agent Agent} to list all + # environments for. Format: + # `projects//locations//agents/`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return in a single page. By default 20 and + # at most 100. + # @!attribute [rw] page_token + # @return [::String] + # 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::CX::V3::Environments::Client#list_environments Environments.ListEnvironments}. + # @!attribute [rw] environments + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Environment>] + # The list of environments. There will be a maximum number of items + # returned based on the page_size field in the request. The list may in some + # cases be empty or contain fewer entries than page_size even if this isn't + # the last page. + # @!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::CX::V3::Environments::Client#get_environment Environments.GetEnvironment}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. Format: + # `projects//locations//agents//environments/`. + class GetEnvironmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#create_environment Environments.CreateEnvironment}. + # @!attribute [rw] parent + # @return [::String] + # Required. The {::Google::Cloud::Dialogflow::CX::V3::Agent Agent} to create an + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} for. Format: + # `projects//locations//agents/`. + # @!attribute [rw] environment + # @return [::Google::Cloud::Dialogflow::CX::V3::Environment] + # Required. The environment to create. + class CreateEnvironmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#update_environment Environments.UpdateEnvironment}. + # @!attribute [rw] environment + # @return [::Google::Cloud::Dialogflow::CX::V3::Environment] + # Required. The environment to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The mask to control which fields get updated. + class UpdateEnvironmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#delete_environment Environments.DeleteEnvironment}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to delete. Format: + # `projects//locations//agents//environments/`. + class DeleteEnvironmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#lookup_environment_history Environments.LookupEnvironmentHistory}. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the environment to look up the history for. + # Format: + # `projects//locations//agents//environments/`. + # @!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 LookupEnvironmentHistoryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#lookup_environment_history Environments.LookupEnvironmentHistory}. + # @!attribute [rw] environments + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Environment>] + # Represents a list of snapshots for an environment. Time of the snapshots is + # stored in + # {::Google::Cloud::Dialogflow::CX::V3::Environment#update_time `update_time`}. + # @!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 LookupEnvironmentHistoryResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a result from running a test case in an agent environment. + # @!attribute [rw] name + # @return [::String] + # The resource name for the continuous test result. Format: + # `projects//locations//agents//environments//continuousTestResults/`. + # @!attribute [rw] result + # @return [::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult::AggregatedTestResult] + # The result of this continuous test run, i.e. whether all the tests in this + # continuous test run pass or not. + # @!attribute [rw] test_case_results + # @return [::Array<::String>] + # A list of individual test case results names in this continuous test run. + # @!attribute [rw] run_time + # @return [::Google::Protobuf::Timestamp] + # Time when the continuous testing run starts. + class ContinuousTestResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The overall result for a continuous test run in an agent environment. + module AggregatedTestResult + # Not specified. Should never be used. + AGGREGATED_TEST_RESULT_UNSPECIFIED = 0 + + # All the tests passed. + PASSED = 1 + + # At least one test did not pass. + FAILED = 2 + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#run_continuous_test Environments.RunContinuousTest}. + # @!attribute [rw] environment + # @return [::String] + # Required. Format: + # `projects//locations//agents//environments/`. + class RunContinuousTestRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#run_continuous_test Environments.RunContinuousTest}. + # @!attribute [rw] continuous_test_result + # @return [::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult] + # The result for a continuous test run. + class RunContinuousTestResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata returned for the + # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#run_continuous_test Environments.RunContinuousTest} + # long running operation. + # @!attribute [rw] errors + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TestError>] + # The test errors. + class RunContinuousTestMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#list_continuous_test_results Environments.ListContinuousTestResults}. + # @!attribute [rw] parent + # @return [::String] + # Required. The environment to list results for. + # Format: + # `projects//locations//agents//environments/`. + # @!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 ListContinuousTestResultsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for [Environments.ListTestCaseResults][]. + # @!attribute [rw] continuous_test_results + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult>] + # The list of continuous test results. + # @!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 ListContinuousTestResultsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#deploy_flow Environments.DeployFlow}. + # @!attribute [rw] environment + # @return [::String] + # Required. The environment to deploy the flow to. + # Format: + # `projects//locations//agents//environments/`. + # @!attribute [rw] flow_version + # @return [::String] + # Required. The flow version to deploy. + # Format: + # `projects//locations//agents//flows//versions/`. + class DeployFlowRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#deploy_flow Environments.DeployFlow}. + # @!attribute [rw] environment + # @return [::Google::Cloud::Dialogflow::CX::V3::Environment] + # The updated environment where the flow is deployed. + # @!attribute [rw] deployment + # @return [::String] + # The name of the flow version + # {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployment}. Format: + # `projects//locations//agents//environments//deployments/`. + class DeployFlowResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata returned for the + # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#deploy_flow Environments.DeployFlow} + # long running operation. + # @!attribute [rw] test_errors + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TestError>] + # Errors of running deployment tests. + class DeployFlowMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/example.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/example.rb new file mode 100644 index 000000000000..4c8417fd1a9b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/example.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 Cx + module V3 + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Examples::Client#create_example Examples.CreateExample}. + # @!attribute [rw] parent + # @return [::String] + # Required. The playbook to create an example for. + # Format: + # `projects//locations//agents//playbooks/`. + # @!attribute [rw] example + # @return [::Google::Cloud::Dialogflow::CX::V3::Example] + # Required. The example to create. + class CreateExampleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Examples::Client#delete_example Examples.DeleteExample}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the example to delete. + # Format: + # `projects//locations//agents//playbooks//examples/`. + class DeleteExampleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Examples::Client#list_examples Examples.ListExamples}. + # @!attribute [rw] parent + # @return [::String] + # Required. The playbook to list the examples from. + # Format: + # `projects//locations//agents//playbooks/`. + # @!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][ListExampleResponse.next_page_token] value + # returned from a previous list request. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The language to list examples for. + # If not specified, list all examples under the playbook. + # Note: languages must be enabled in the agent before they can be used. + class ListExamplesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Examples::Client#list_examples Examples.ListExamples}. + # @!attribute [rw] examples + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Example>] + # The list of examples. There will be a maximum number of items returned + # based on the + # {::Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest#page_size 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 ListExamplesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Examples::Client#get_example Examples.GetExample}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the example. + # Format: + # `projects//locations//agents//playbooks//examples/`. + class GetExampleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Examples::Client#update_example Examples.UpdateExample}. + # @!attribute [rw] example + # @return [::Google::Cloud::Dialogflow::CX::V3::Example] + # Required. The example 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 UpdateExampleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Example represents a sample execution of the playbook in the conversation. + # + # An example consists of a list of ordered actions performed by end user + # or Dialogflow agent according the playbook instructions to fulfill the task. + # @!attribute [rw] name + # @return [::String] + # The unique identifier of the playbook example. + # Format: + # `projects//locations//agents//playbooks//examples/`. + # @!attribute [rw] playbook_input + # @return [::Google::Cloud::Dialogflow::CX::V3::PlaybookInput] + # Optional. The input to the playbook in the example. + # @!attribute [rw] playbook_output + # @return [::Google::Cloud::Dialogflow::CX::V3::PlaybookOutput] + # Optional. The output of the playbook in the example. + # @!attribute [rw] actions + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Action>] + # Required. The ordered list of actions performed by the end user and the + # Dialogflow agent. + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the example. + # @!attribute [rw] description + # @return [::String] + # Optional. The high level concise description of the example. The max number + # of characters is 200. + # @!attribute [r] token_count + # @return [::Integer] + # Output only. Estimated number of tokes current example takes when sent to + # the LLM. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp of initial example creation. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Last time the example was updated. + # @!attribute [rw] conversation_state + # @return [::Google::Cloud::Dialogflow::CX::V3::OutputState] + # Required. Example's output state. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The language code of the example. + # If not specified, the agent's default language is used. + # Note: languages must be enabled in the agent before they can be used. + # Note: example's language code is not currently used in dialogflow agents. + class Example + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/experiment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/experiment.rb new file mode 100644 index 000000000000..29adc18250ea --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/experiment.rb @@ -0,0 +1,450 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # Represents an experiment in an environment. + # @!attribute [rw] name + # @return [::String] + # The name of the experiment. + # Format: + # projects//locations//agents//environments//experiments/. + # @!attribute [rw] display_name + # @return [::String] + # Required. The human-readable name of the experiment (unique in an + # environment). Limit of 64 characters. + # @!attribute [rw] description + # @return [::String] + # The human-readable description of the experiment. + # @!attribute [rw] state + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment::State] + # The current state of the experiment. + # Transition triggered by Experiments.StartExperiment: DRAFT->RUNNING. + # Transition triggered by Experiments.CancelExperiment: DRAFT->DONE or + # RUNNING->DONE. + # @!attribute [rw] definition + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment::Definition] + # The definition of the experiment. + # @!attribute [rw] rollout_config + # @return [::Google::Cloud::Dialogflow::CX::V3::RolloutConfig] + # The configuration for auto rollout. If set, there should be exactly two + # variants in the experiment (control variant being the default version of + # the flow), the traffic allocation for the non-control variant will + # gradually increase to 100% when conditions are met, and eventually + # replace the control variant to become the default version of the flow. + # @!attribute [rw] rollout_state + # @return [::Google::Cloud::Dialogflow::CX::V3::RolloutState] + # State of the auto rollout process. + # @!attribute [rw] rollout_failure_reason + # @return [::String] + # The reason why rollout has failed. Should only be set when state is + # ROLLOUT_FAILED. + # @!attribute [rw] result + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment::Result] + # Inference result of the experiment. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Creation time of this experiment. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Start time of this experiment. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # End time of this experiment. + # @!attribute [rw] last_update_time + # @return [::Google::Protobuf::Timestamp] + # Last update time of this experiment. + # @!attribute [rw] experiment_length + # @return [::Google::Protobuf::Duration] + # Maximum number of days to run the experiment/rollout. If auto-rollout is + # not enabled, default value and maximum will be 30 days. If auto-rollout is + # enabled, default value and maximum will be 6 days. + # @!attribute [rw] variants_history + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::VariantsHistory>] + # The history of updates to the experiment variants. + class Experiment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Definition of the experiment. + # @!attribute [rw] condition + # @return [::String] + # The condition defines which subset of sessions are selected for + # this experiment. If not specified, all sessions are eligible. E.g. + # "query_input.language_code=en" See the [conditions + # reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). + # @!attribute [rw] version_variants + # @return [::Google::Cloud::Dialogflow::CX::V3::VersionVariants] + # The flow versions as the variants of this experiment. + class Definition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The inference result which includes an objective metric to optimize and the + # confidence interval. + # @!attribute [rw] version_metrics + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Experiment::Result::VersionMetrics>] + # Version variants and metrics. + # @!attribute [rw] last_update_time + # @return [::Google::Protobuf::Timestamp] + # The last time the experiment's stats data was updated. Will have default + # value if stats have never been computed for this experiment. + class Result + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A confidence interval is a range of possible values for the experiment + # objective you are trying to measure. + # @!attribute [rw] confidence_level + # @return [::Float] + # The confidence level used to construct the interval, i.e. there is X% + # chance that the true value is within this interval. + # @!attribute [rw] ratio + # @return [::Float] + # The percent change between an experiment metric's value and the value + # for its control. + # @!attribute [rw] lower_bound + # @return [::Float] + # Lower bound of the interval. + # @!attribute [rw] upper_bound + # @return [::Float] + # Upper bound of the interval. + class ConfidenceInterval + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metric and corresponding confidence intervals. + # @!attribute [rw] type + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment::Result::MetricType] + # Ratio-based metric type. Only one of type or count_type is specified in + # each Metric. + # @!attribute [rw] count_type + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment::Result::CountType] + # Count-based metric type. Only one of type or count_type is specified in + # each Metric. + # @!attribute [rw] ratio + # @return [::Float] + # Ratio value of a metric. + # + # Note: The following fields are mutually exclusive: `ratio`, `count`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] count + # @return [::Float] + # Count value of a metric. + # + # Note: The following fields are mutually exclusive: `count`, `ratio`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] confidence_interval + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment::Result::ConfidenceInterval] + # The probability that the treatment is better than all other treatments + # in the experiment + class Metric + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Version variant and associated metrics. + # @!attribute [rw] version + # @return [::String] + # The name of the flow {::Google::Cloud::Dialogflow::CX::V3::Version Version}. + # Format: + # `projects//locations//agents//flows//versions/`. + # @!attribute [rw] metrics + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Experiment::Result::Metric>] + # The metrics and corresponding confidence intervals in the inference + # result. + # @!attribute [rw] session_count + # @return [::Integer] + # Number of sessions that were allocated to this version. + class VersionMetrics + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Types of ratio-based metric for Dialogflow experiment. + module MetricType + # Metric unspecified. + METRIC_UNSPECIFIED = 0 + + # Percentage of contained sessions without user calling back in 24 hours. + CONTAINED_SESSION_NO_CALLBACK_RATE = 1 + + # Percentage of sessions that were handed to a human agent. + LIVE_AGENT_HANDOFF_RATE = 2 + + # Percentage of sessions with the same user calling back. + CALLBACK_SESSION_RATE = 3 + + # Percentage of sessions where user hung up. + ABANDONED_SESSION_RATE = 4 + + # Percentage of sessions reached Dialogflow 'END_PAGE' or + # 'END_SESSION'. + SESSION_END_RATE = 5 + end + + # Types of count-based metric for Dialogflow experiment. + module CountType + # Count type unspecified. + COUNT_TYPE_UNSPECIFIED = 0 + + # Total number of occurrences of a 'NO_MATCH'. + TOTAL_NO_MATCH_COUNT = 1 + + # Total number of turn counts. + TOTAL_TURN_COUNT = 2 + + # Average turn count in a session. + AVERAGE_TURN_COUNT = 3 + end + end + + # The state of the experiment. + module State + # State unspecified. + STATE_UNSPECIFIED = 0 + + # The experiment is created but not started yet. + DRAFT = 1 + + # The experiment is running. + RUNNING = 2 + + # The experiment is done. + DONE = 3 + + # The experiment with auto-rollout enabled has failed. + ROLLOUT_FAILED = 4 + end + end + + # A list of flow version variants. + # @!attribute [rw] variants + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::VersionVariants::Variant>] + # A list of flow version variants. + class VersionVariants + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A single flow version with specified traffic allocation. + # @!attribute [rw] version + # @return [::String] + # The name of the flow version. + # Format: + # `projects//locations//agents//flows//versions/`. + # @!attribute [rw] traffic_allocation + # @return [::Float] + # Percentage of the traffic which should be routed to this + # version of flow. Traffic allocation for a single flow must sum up to 1.0. + # @!attribute [rw] is_control_group + # @return [::Boolean] + # Whether the variant is for the control group. + class Variant + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The history of variants update. + # @!attribute [rw] version_variants + # @return [::Google::Cloud::Dialogflow::CX::V3::VersionVariants] + # The flow versions as the variants. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Update time of the variants. + class VariantsHistory + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The configuration for auto rollout. + # @!attribute [rw] rollout_steps + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::RolloutConfig::RolloutStep>] + # Steps to roll out a flow version. Steps should be sorted by percentage in + # ascending order. + # @!attribute [rw] rollout_condition + # @return [::String] + # The conditions that are used to evaluate the success of a rollout + # step. If not specified, all rollout steps will proceed to the next one + # unless failure conditions are met. E.g. "containment_rate > 60% AND + # callback_rate < 20%". See the [conditions + # reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). + # @!attribute [rw] failure_condition + # @return [::String] + # The conditions that are used to evaluate the failure of a rollout + # step. If not specified, no rollout steps will fail. E.g. "containment_rate + # < 10% OR average_turn_count < 3". See the [conditions + # reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). + class RolloutConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A single rollout step with specified traffic allocation. + # @!attribute [rw] display_name + # @return [::String] + # The name of the rollout step; + # @!attribute [rw] traffic_percent + # @return [::Integer] + # The percentage of traffic allocated to the flow version of this rollout + # step. (0%, 100%]. + # @!attribute [rw] min_duration + # @return [::Google::Protobuf::Duration] + # The minimum time that this step should last. Should be longer than 1 + # hour. If not set, the default minimum duration for each step will be 1 + # hour. + class RolloutStep + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # State of the auto-rollout process. + # @!attribute [rw] step + # @return [::String] + # Display name of the current auto rollout step. + # @!attribute [rw] step_index + # @return [::Integer] + # Index of the current step in the auto rollout steps list. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Start time of the current step. + class RolloutState + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#list_experiments Experiments.ListExperiments}. + # @!attribute [rw] parent + # @return [::String] + # Required. The {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to + # list all environments for. Format: + # `projects//locations//agents//environments/`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return in a single page. By default 20 and + # at most 100. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token value returned from a previous list request. + class ListExperimentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#list_experiments Experiments.ListExperiments}. + # @!attribute [rw] experiments + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Experiment>] + # The list of experiments. There will be a maximum number of items + # returned based on the page_size field in the request. The list may in some + # cases be empty or contain fewer entries than page_size even if this isn't + # the last page. + # @!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 ListExperimentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#get_experiment Experiments.GetExperiment}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. Format: + # `projects//locations//agents//environments//experiments/`. + class GetExperimentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#create_experiment Experiments.CreateExperiment}. + # @!attribute [rw] parent + # @return [::String] + # Required. The {::Google::Cloud::Dialogflow::CX::V3::Agent Agent} to create an + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} for. Format: + # `projects//locations//agents//environments/`. + # @!attribute [rw] experiment + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # Required. The experiment to create. + class CreateExperimentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#update_experiment Experiments.UpdateExperiment}. + # @!attribute [rw] experiment + # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] + # Required. The experiment to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The mask to control which fields get updated. + class UpdateExperimentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#delete_experiment Experiments.DeleteExperiment}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the + # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to delete. Format: + # `projects//locations//agents//environments//experiments/`. + class DeleteExperimentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#start_experiment Experiments.StartExperiment}. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the experiment to start. + # Format: + # `projects//locations//agents//environments//experiments/`. + class StartExperimentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#stop_experiment Experiments.StopExperiment}. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the experiment to stop. + # Format: + # `projects//locations//agents//environments//experiments/`. + class StopExperimentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb new file mode 100644 index 000000000000..369f1aff17be --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb @@ -0,0 +1,536 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dialogflow + module CX + module V3 + # Settings related to NLU. + # @!attribute [rw] model_type + # @return [::Google::Cloud::Dialogflow::CX::V3::NluSettings::ModelType] + # Indicates the type of NLU model. + # @!attribute [rw] classification_threshold + # @return [::Float] + # 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 no-match event 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. You can set a separate classification + # threshold for the flow in each language enabled for the agent. + # @!attribute [rw] model_training_mode + # @return [::Google::Cloud::Dialogflow::CX::V3::NluSettings::ModelTrainingMode] + # Indicates NLU model training mode. + class NluSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # NLU model type. + module ModelType + # Not specified. `MODEL_TYPE_STANDARD` will be used. + MODEL_TYPE_UNSPECIFIED = 0 + + # Use standard NLU model. + MODEL_TYPE_STANDARD = 1 + + # Use advanced NLU model. + MODEL_TYPE_ADVANCED = 3 + end + + # NLU model training mode. + module ModelTrainingMode + # Not specified. `MODEL_TRAINING_MODE_AUTOMATIC` will be used. + MODEL_TRAINING_MODE_UNSPECIFIED = 0 + + # NLU model training is automatically triggered when a flow gets modified. + # User can also manually trigger model training in this mode. + MODEL_TRAINING_MODE_AUTOMATIC = 1 + + # User needs to manually trigger NLU model training. Best for large flows + # whose models take long time to train. + MODEL_TRAINING_MODE_MANUAL = 2 + end + end + + # Flows represents the conversation flows when you build your chatbot agent. + # + # A flow consists of many pages connected by the transition routes. + # Conversations always start with the built-in Start Flow (with an all-0 ID). + # Transition routes can direct the conversation session from the current flow + # (parent flow) to another flow (sub flow). When the sub flow is finished, + # Dialogflow will bring the session back to the parent flow, where the sub flow + # is started. + # + # Usually, when a transition route is followed by a matched intent, the intent + # will be "consumed". This means the intent won't activate more transition + # routes. However, when the followed transition route moves the conversation + # session into a different flow, the matched intent can be carried over and to + # be consumed in the target flow. + # @!attribute [rw] name + # @return [::String] + # The unique identifier of the flow. + # Format: + # `projects//locations//agents//flows/`. + # @!attribute [rw] display_name + # @return [::String] + # Required. The human-readable name of the flow. + # @!attribute [rw] description + # @return [::String] + # The description of the flow. The maximum length is 500 characters. If + # exceeded, the request is rejected. + # @!attribute [rw] transition_routes + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TransitionRoute>] + # A flow's transition routes serve two purposes: + # + # * They are responsible for matching the user's first utterances in the + # flow. + # * They are inherited by every page's [transition + # routes][Page.transition_routes] and can support use cases such as the user + # saying "help" or "can I talk to a human?", which can be handled in a common + # way regardless of the current page. Transition routes defined in the page + # have higher priority than those defined in the flow. + # + # TransitionRoutes are evaluated in the following order: + # + # * TransitionRoutes with intent specified. + # * TransitionRoutes with only condition specified. + # + # TransitionRoutes with intent specified are inherited by pages in the flow. + # @!attribute [rw] event_handlers + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::EventHandler>] + # A flow's event handlers serve two purposes: + # + # * They are responsible for handling events (e.g. no match, + # webhook errors) in the flow. + # * They are inherited by every page's [event + # handlers][Page.event_handlers], which can be used to handle common events + # regardless of the current page. Event handlers defined in the page + # have higher priority than those defined in the flow. + # + # Unlike + # {::Google::Cloud::Dialogflow::CX::V3::Flow#transition_routes transition_routes}, + # these handlers are evaluated on a first-match basis. The first one that + # matches the event get executed, with the rest being ignored. + # @!attribute [rw] transition_route_groups + # @return [::Array<::String>] + # A flow's transition route group serve two purposes: + # + # * They are responsible for matching the user's first utterances in the + # flow. + # * They are inherited by every page's [transition + # route groups][Page.transition_route_groups]. Transition route groups + # defined in the page have higher priority than those defined in the flow. + # + # Format: + # `projects//locations//agents//flows//transitionRouteGroups/` + # or + # `projects//locations//agents//transitionRouteGroups/` + # for agent-level groups. + # @!attribute [rw] nlu_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::NluSettings] + # NLU related settings of the flow. + # @!attribute [rw] advanced_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::AdvancedSettings] + # Hierarchical advanced settings for this flow. The settings exposed at the + # lower level overrides the settings exposed at the higher level. + # @!attribute [rw] knowledge_connector_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::KnowledgeConnectorSettings] + # Optional. Knowledge connector configuration. + # @!attribute [rw] input_parameter_definitions + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ParameterDefinition>] + # Optional. Defined structured input parameters for this flow. + # @!attribute [rw] output_parameter_definitions + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ParameterDefinition>] + # Optional. Defined structured output parameters for this flow. + # @!attribute [rw] multi_language_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::Flow::MultiLanguageSettings] + # Optional. Multi-lingual agent settings for this flow. + # @!attribute [rw] locked + # @return [::Boolean] + # Indicates whether the flow is locked for changes. If the flow is locked, + # modifications to the flow will be rejected. + class Flow + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Settings for multi-lingual agents. + # @!attribute [rw] enable_multi_language_detection + # @return [::Boolean] + # Optional. Enable multi-language detection for this flow. This can be set + # only if [agent level multi language + # setting][Agent.enable_multi_language_training] is enabled. + # @!attribute [rw] supported_response_language_codes + # @return [::Array<::String>] + # Optional. Agent will respond in the detected language if the detected + # language code is in the supported resolved languages for this flow. This + # will be used only if multi-language training is enabled in the + # {::Google::Cloud::Dialogflow::CX::V3::Agent#enable_multi_language_training agent} + # and multi-language detection is enabled in the + # {::Google::Cloud::Dialogflow::CX::V3::Flow::MultiLanguageSettings#enable_multi_language_detection flow}. + # The supported languages must be a subset of the languages supported by + # the agent. + class MultiLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#create_flow Flows.CreateFlow}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to create a flow for. + # Format: `projects//locations//agents/`. + # @!attribute [rw] flow + # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] + # Required. The flow to create. + # @!attribute [rw] language_code + # @return [::String] + # The language of the following fields in `flow`: + # + # * `Flow.event_handlers.trigger_fulfillment.messages` + # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + # * `Flow.transition_routes.trigger_fulfillment.messages` + # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + class CreateFlowRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#delete_flow Flows.DeleteFlow}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the flow to delete. + # Format: + # `projects//locations//agents//flows/`. + # @!attribute [rw] force + # @return [::Boolean] + # This field has no effect for flows with no incoming transitions. + # For flows with incoming transitions: + # + # * If `force` is set to false, an error will be returned with message + # indicating the incoming transitions. + # * If `force` is set to true, Dialogflow will remove the flow, as well as + # any transitions to the flow (i.e. [Target + # flow][EventHandler.target_flow] in event handlers or [Target + # flow][TransitionRoute.target_flow] in transition routes that point to + # this flow will be cleared). + class DeleteFlowRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#list_flows Flows.ListFlows}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent containing the flows. + # Format: `projects//locations//agents/`. + # @!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. + # @!attribute [rw] language_code + # @return [::String] + # The language to list flows for. The following fields are language + # dependent: + # + # * `Flow.event_handlers.trigger_fulfillment.messages` + # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + # * `Flow.transition_routes.trigger_fulfillment.messages` + # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + class ListFlowsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#list_flows Flows.ListFlows}. + # @!attribute [rw] flows + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Flow>] + # The list of flows. 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 ListFlowsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#get_flow Flows.GetFlow}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the flow to get. + # Format: + # `projects//locations//agents//flows/`. + # @!attribute [rw] language_code + # @return [::String] + # The language to retrieve the flow for. The following fields are language + # dependent: + # + # * `Flow.event_handlers.trigger_fulfillment.messages` + # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + # * `Flow.transition_routes.trigger_fulfillment.messages` + # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + class GetFlowRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#update_flow Flows.UpdateFlow}. + # @!attribute [rw] flow + # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] + # Required. The flow to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The mask to control which fields get updated. If the mask is not present, + # all fields will be updated. + # @!attribute [rw] language_code + # @return [::String] + # The language of the following fields in `flow`: + # + # * `Flow.event_handlers.trigger_fulfillment.messages` + # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + # * `Flow.transition_routes.trigger_fulfillment.messages` + # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + class UpdateFlowRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#train_flow Flows.TrainFlow}. + # @!attribute [rw] name + # @return [::String] + # Required. The flow to train. + # Format: + # `projects//locations//agents//flows/`. + class TrainFlowRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#validate_flow Flows.ValidateFlow}. + # @!attribute [rw] name + # @return [::String] + # Required. The flow to validate. + # Format: + # `projects//locations//agents//flows/`. + # @!attribute [rw] language_code + # @return [::String] + # If not specified, the agent's default language is used. + class ValidateFlowRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#get_flow_validation_result Flows.GetFlowValidationResult}. + # @!attribute [rw] name + # @return [::String] + # Required. The flow name. + # Format: + # `projects//locations//agents//flows//validationResult`. + # @!attribute [rw] language_code + # @return [::String] + # If not specified, the agent's default language is used. + class GetFlowValidationResultRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#get_flow_validation_result Flows.GetFlowValidationResult}. + # @!attribute [rw] name + # @return [::String] + # The unique identifier of the flow validation result. + # Format: + # `projects//locations//agents//flows//validationResult`. + # @!attribute [rw] validation_messages + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ValidationMessage>] + # Contains all validation messages. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Last time the flow was validated. + class FlowValidationResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#import_flow Flows.ImportFlow}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to import the flow into. + # Format: `projects//locations//agents/`. + # @!attribute [rw] flow_uri + # @return [::String] + # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + # to import flow from. The format of this URI must be + # `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: `flow_uri`, `flow_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] flow_content + # @return [::String] + # Uncompressed raw byte content for flow. + # + # Note: The following fields are mutually exclusive: `flow_content`, `flow_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] import_option + # @return [::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest::ImportOption] + # Flow import mode. If not specified, `KEEP` is assumed. + # @!attribute [rw] flow_import_strategy + # @return [::Google::Cloud::Dialogflow::CX::V3::FlowImportStrategy] + # Optional. Specifies the import strategy used when resolving resource + # conflicts. + class ImportFlowRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Import option. + module ImportOption + # Unspecified. Treated as `KEEP`. + IMPORT_OPTION_UNSPECIFIED = 0 + + # Always respect settings in exported flow content. It may cause a + # import failure if some settings (e.g. custom NLU) are not supported in + # the agent to import into. + KEEP = 1 + + # Fallback to default settings if some settings are not supported in the + # agent to import into. E.g. Standard NLU will be used if custom NLU is + # not available. + FALLBACK = 2 + end + end + + # The flow import strategy used for resource conflict resolution associated + # with an {::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest ImportFlowRequest}. + # @!attribute [rw] global_import_strategy + # @return [::Google::Cloud::Dialogflow::CX::V3::ImportStrategy] + # Optional. Import strategy for resource conflict resolution, applied + # globally throughout the flow. It will be applied for all display name + # conflicts in the imported content. If not specified, 'CREATE_NEW' is + # assumed. + class FlowImportStrategy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#import_flow Flows.ImportFlow}. + # @!attribute [rw] flow + # @return [::String] + # The unique identifier of the new flow. + # Format: + # `projects//locations//agents//flows/`. + class ImportFlowResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#export_flow Flows.ExportFlow}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the flow to export. + # Format: + # `projects//locations//agents//flows/`. + # @!attribute [rw] flow_uri + # @return [::String] + # Optional. The [Google Cloud + # Storage](https://cloud.google.com/storage/docs/) URI to export the flow to. + # The format of this URI must be `gs:///`. If left + # unspecified, the serialized flow 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). + # @!attribute [rw] include_referenced_flows + # @return [::Boolean] + # Optional. Whether to export flows referenced by the specified flow. + class ExportFlowRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#export_flow Flows.ExportFlow}. + # @!attribute [rw] flow_uri + # @return [::String] + # The URI to a file containing the exported flow. This field is populated + # only if `flow_uri` is specified in + # {::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest ExportFlowRequest}. + # + # Note: The following fields are mutually exclusive: `flow_uri`, `flow_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] flow_content + # @return [::String] + # Uncompressed raw byte content for flow. + # + # Note: The following fields are mutually exclusive: `flow_content`, `flow_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ExportFlowResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/fulfillment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/fulfillment.rb new file mode 100644 index 000000000000..5b7c88814468 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/fulfillment.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 CX + module V3 + # A fulfillment can do one or more of the following actions at the same time: + # + # * Generate rich message responses. + # * Set parameter values. + # * Call the webhook. + # + # Fulfillments can be called at various stages in the + # {::Google::Cloud::Dialogflow::CX::V3::Page Page} or + # {::Google::Cloud::Dialogflow::CX::V3::Form Form} lifecycle. For example, when a + # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest DetectIntentRequest} + # drives a session to enter a new page, the page's entry fulfillment can add a + # static response to the + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} in the returning + # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse DetectIntentResponse}, + # call the webhook (for example, to load user data from a database), or both. + # @!attribute [rw] messages + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ResponseMessage>] + # The list of rich message responses to present to the user. + # @!attribute [rw] webhook + # @return [::String] + # The webhook to call. + # Format: + # `projects//locations//agents//webhooks/`. + # @!attribute [rw] return_partial_responses + # @return [::Boolean] + # Whether Dialogflow should return currently queued fulfillment response + # messages in streaming APIs. If a webhook is specified, it happens before + # Dialogflow invokes webhook. + # Warning: + # 1) This flag only affects streaming API. Responses are still queued + # and returned once in non-streaming API. + # 2) The flag can be enabled in any fulfillment but only the first 3 partial + # responses will be returned. You may only want to apply it to fulfillments + # that have slow webhooks. + # @!attribute [rw] tag + # @return [::String] + # The value of this field will be populated in the + # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest} + # `fulfillmentInfo.tag` field by Dialogflow when the associated webhook is + # called. + # The tag is typically used by the webhook service to identify which + # fulfillment is being called, but it could be used for other purposes. + # This field is required if `webhook` is specified. + # @!attribute [rw] set_parameter_actions + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Fulfillment::SetParameterAction>] + # Set parameter values before executing the webhook. + # @!attribute [rw] conditional_cases + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Fulfillment::ConditionalCases>] + # Conditional cases for this fulfillment. + # @!attribute [rw] advanced_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::AdvancedSettings] + # Hierarchical advanced settings for this fulfillment. The settings exposed + # at the lower level overrides the settings exposed at the higher level. + # @!attribute [rw] enable_generative_fallback + # @return [::Boolean] + # If the flag is true, the agent will utilize LLM to generate a text + # response. If LLM generation fails, the defined + # {::Google::Cloud::Dialogflow::CX::V3::Fulfillment#messages responses} in the + # fulfillment will be respected. This flag is only useful for fulfillments + # associated with no-match event handlers. + # @!attribute [rw] generators + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Fulfillment::GeneratorSettings>] + # A list of Generators to be called during this fulfillment. + class Fulfillment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Setting a parameter value. + # @!attribute [rw] parameter + # @return [::String] + # Display name of the parameter. + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + # The new value of the parameter. A null value clears the parameter. + class SetParameterAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A list of cascading if-else conditions. Cases are mutually exclusive. + # The first one with a matching condition is selected, all the rest ignored. + # @!attribute [rw] cases + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Fulfillment::ConditionalCases::Case>] + # A list of cascading if-else conditions. + class ConditionalCases + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Each case has a Boolean condition. When it is evaluated to be True, the + # corresponding messages will be selected and evaluated recursively. + # @!attribute [rw] condition + # @return [::String] + # The condition to activate and select this case. Empty means the + # condition is always true. The condition is evaluated against [form + # parameters][Form.parameters] or [session + # parameters][SessionInfo.parameters]. + # + # See the [conditions + # reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). + # @!attribute [rw] case_content + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Fulfillment::ConditionalCases::Case::CaseContent>] + # A list of case content. + class Case + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The list of messages or conditional cases to activate for this case. + # @!attribute [rw] message + # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage] + # Returned message. + # + # Note: The following fields are mutually exclusive: `message`, `additional_cases`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] additional_cases + # @return [::Google::Cloud::Dialogflow::CX::V3::Fulfillment::ConditionalCases] + # Additional cases to be evaluated. + # + # Note: The following fields are mutually exclusive: `additional_cases`, `message`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class CaseContent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Generator settings used by the LLM to generate a text response. + # @!attribute [rw] generator + # @return [::String] + # Required. The generator to call. + # Format: + # `projects//locations//agents//generators/`. + # @!attribute [rw] input_parameters + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from [placeholder parameter][Generator.Parameter.id] in the + # {::Google::Cloud::Dialogflow::CX::V3::Generator Generator} to corresponding + # session parameters. By default, Dialogflow uses the session parameter + # with the same name to fill in the generator template. e.g. If there is a + # placeholder parameter `city` in the Generator, Dialogflow default to fill + # in the `$city` with + # `$session.params.city`. However, you may choose to fill `$city` with + # `$session.params.desination-city`. + # - Map key: [parameter ID][Genrator.Parameter.id] + # - Map value: session parameter name + # @!attribute [rw] output_parameter + # @return [::String] + # Required. Output parameter which should contain the generator response. + class GeneratorSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class InputParametersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/gcs.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/gcs.rb new file mode 100644 index 000000000000..946cd1758d0b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/gcs.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # Google Cloud Storage location for a Dialogflow operation that writes or + # exports objects (e.g. exported agent or transcripts) outside of Dialogflow. + # @!attribute [rw] uri + # @return [::String] + # Required. The Google Cloud Storage URI for the exported objects. A URI is + # of the form: `gs://bucket/object-name-or-prefix` Whether a full object + # name, or just a prefix, its usage depends on the Dialogflow operation. + class GcsDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generative_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generative_settings.rb new file mode 100644 index 000000000000..5ac9c48f57f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generative_settings.rb @@ -0,0 +1,128 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # Settings for Generative AI. + # @!attribute [rw] name + # @return [::String] + # Format: + # `projects//locations//agents//generativeSettings`. + # @!attribute [rw] fallback_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings::FallbackSettings] + # Settings for Generative Fallback. + # @!attribute [rw] generative_safety_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::SafetySettings] + # Settings for Generative Safety. + # @!attribute [rw] knowledge_connector_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings::KnowledgeConnectorSettings] + # Settings for knowledge connector. + # @!attribute [rw] language_code + # @return [::String] + # Language for this settings. + # @!attribute [rw] llm_model_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::LlmModelSettings] + # LLM model settings. + class GenerativeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Settings for Generative Fallback. + # @!attribute [rw] selected_prompt + # @return [::String] + # Display name of the selected prompt. + # @!attribute [rw] prompt_templates + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings::FallbackSettings::PromptTemplate>] + # Stored prompts that can be selected, for example default templates like + # "conservative" or "chatty", or user defined ones. + class FallbackSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Prompt template. + # @!attribute [rw] display_name + # @return [::String] + # Prompt name. + # @!attribute [rw] prompt_text + # @return [::String] + # Prompt text that is sent to a LLM on no-match default, placeholders are + # filled downstream. For example: "Here is a conversation $conversation, + # a response is: " + # @!attribute [rw] frozen + # @return [::Boolean] + # If the flag is true, the prompt is frozen and cannot be modified by + # users. + class PromptTemplate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for knowledge connector. These parameters are used for LLM prompt + # like "You are . You are a helpful and verbose at + # , . Your task is to help humans on + # ". + # @!attribute [rw] business + # @return [::String] + # Name of the company, organization or other entity that the agent + # represents. Used for knowledge connector LLM prompt and for knowledge + # search. + # @!attribute [rw] agent + # @return [::String] + # Name of the virtual agent. Used for LLM prompt. Can be left empty. + # @!attribute [rw] agent_identity + # @return [::String] + # Identity of the agent, e.g. "virtual agent", "AI assistant". + # @!attribute [rw] business_description + # @return [::String] + # Company description, used for LLM prompt, e.g. "a family company selling + # freshly roasted coffee beans". + # @!attribute [rw] agent_scope + # @return [::String] + # Agent scope, e.g. "Example company website", "internal Example + # company website for employees", "manual of car owner". + # @!attribute [rw] disable_data_store_fallback + # @return [::Boolean] + # Whether to disable fallback to Data Store search results (in case the LLM + # couldn't pick a proper answer). Per default the feature is enabled. + class KnowledgeConnectorSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for LLM models. + # @!attribute [rw] model + # @return [::String] + # The selected LLM model. + # @!attribute [rw] prompt_text + # @return [::String] + # The custom prompt to use. + class LlmModelSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generator.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generator.rb new file mode 100644 index 000000000000..8d42c828c536 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generator.rb @@ -0,0 +1,223 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # Generators contain prompt to be sent to the LLM model to generate text. The + # prompt can contain parameters which will be resolved before calling the + # model. It can optionally contain banned phrases to ensure the model responses + # are safe. + # @!attribute [rw] name + # @return [::String] + # The unique identifier of the generator. + # Must be set for the + # {::Google::Cloud::Dialogflow::CX::V3::Generators::Client#update_generator Generators.UpdateGenerator} + # method. [Generators.CreateGenerate][] populates the name automatically. + # Format: + # `projects//locations//agents//generators/`. + # @!attribute [rw] display_name + # @return [::String] + # Required. The human-readable name of the generator, unique within the + # agent. The prompt contains pre-defined parameters such as $conversation, + # $last-user-utterance, etc. populated by Dialogflow. It can also contain + # custom placeholders which will be resolved during fulfillment. + # @!attribute [rw] prompt_text + # @return [::Google::Cloud::Dialogflow::CX::V3::Phrase] + # Required. Prompt for the LLM model. + # @!attribute [rw] placeholders + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Generator::Placeholder>] + # Optional. List of custom placeholders in the prompt text. + # @!attribute [rw] llm_model_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::LlmModelSettings] + # The LLM model settings. + # @!attribute [rw] model_parameter + # @return [::Google::Cloud::Dialogflow::CX::V3::Generator::ModelParameter] + # Parameters passed to the LLM to configure its behavior. + class Generator + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a custom placeholder in the prompt text. + # @!attribute [rw] id + # @return [::String] + # Unique ID used to map custom placeholder to parameters in fulfillment. + # @!attribute [rw] name + # @return [::String] + # Custom placeholder value in the prompt text. + class Placeholder + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Parameters to be passed to the LLM. If not set, default values will be + # used. + # @!attribute [rw] temperature + # @return [::Float] + # The temperature used for sampling. Temperature sampling occurs after both + # topP and topK have been applied. + # Valid range: [0.0, 1.0] + # Low temperature = less random. High temperature = more random. + # @!attribute [rw] max_decode_steps + # @return [::Integer] + # The maximum number of tokens to generate. + # @!attribute [rw] top_p + # @return [::Float] + # If set, only the tokens comprising the top top_p probability mass are + # considered. If both top_p and top_k are + # set, top_p will be used for further refining candidates selected with + # top_k. + # Valid range: (0.0, 1.0]. + # Small topP = less random. Large topP = more random. + # @!attribute [rw] top_k + # @return [::Integer] + # If set, the sampling process in each step is limited to the top_k tokens + # with highest probabilities. + # Valid range: [1, 40] or 1000+. + # Small topK = less random. Large topK = more random. + class ModelParameter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Text input which can be used for prompt or banned phrases. + # @!attribute [rw] text + # @return [::String] + # Required. Text input which can be used for prompt or banned phrases. + class Phrase + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Generators::Client#list_generators Generators.ListGenerators}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to list all generators for. + # Format: `projects//locations//agents/`. + # @!attribute [rw] language_code + # @return [::String] + # The language to list generators for. + # @!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 ListGeneratorsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Generators::Client#list_generators Generators.ListGenerators}. + # @!attribute [rw] generators + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Generator>] + # The list of generators. 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 ListGeneratorsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Generators::Client#get_generator Generators.GetGenerator}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the generator. + # Format: + # `projects//locations//agents//generators/`. + # @!attribute [rw] language_code + # @return [::String] + # The language to list generators for. + class GetGeneratorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Generators::Client#create_generator Generators.CreateGenerator}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to create a generator for. + # Format: `projects//locations//agents/`. + # @!attribute [rw] generator + # @return [::Google::Cloud::Dialogflow::CX::V3::Generator] + # Required. The generator to create. + # @!attribute [rw] language_code + # @return [::String] + # The language to create generators for the following fields: + # * `Generator.prompt_text.text` + # If not specified, the agent's default language is used. + class CreateGeneratorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Generators::Client#update_generator Generators.UpdateGenerator}. + # @!attribute [rw] generator + # @return [::Google::Cloud::Dialogflow::CX::V3::Generator] + # Required. The generator to update. + # @!attribute [rw] language_code + # @return [::String] + # The language to list generators for. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The mask to control which fields get updated. If the mask is not present, + # all fields will be updated. + class UpdateGeneratorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Generators::Client#delete_generator Generators.DeleteGenerator}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the generator to delete. + # Format: + # `projects//locations//agents//generators/`. + # @!attribute [rw] force + # @return [::Boolean] + # This field has no effect for generators not being used. + # For generators that are used by pages/flows/transition route groups: + # + # * If `force` is set to false, an error will be returned with message + # indicating the referenced resources. + # * If `force` is set to true, Dialogflow will remove the generator, as well + # as any references to the generator (i.e. + # [Generator][Fulfillment.generator]) in fulfillments. + class DeleteGeneratorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/import_strategy.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/import_strategy.rb new file mode 100644 index 000000000000..27b44f105db2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/import_strategy.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! + + +module Google + module Cloud + module Dialogflow + module CX + module V3 + # Import strategies for the conflict resolution of resources (i.e. intents, + # entities, and webhooks) with identical display names during import + # operations. + module ImportStrategy + # Unspecified. Treated as 'CREATE_NEW'. + IMPORT_STRATEGY_UNSPECIFIED = 0 + + # Create a new resource with a numeric suffix appended to the end of the + # existing display name. + IMPORT_STRATEGY_CREATE_NEW = 1 + + # Replace existing resource with incoming resource in the content to be + # imported. + IMPORT_STRATEGY_REPLACE = 2 + + # Keep existing resource and discard incoming resource in the content to be + # imported. + IMPORT_STRATEGY_KEEP = 3 + + # Combine existing and incoming resources when a conflict is encountered. + IMPORT_STRATEGY_MERGE = 4 + + # Throw error if a conflict is encountered. + IMPORT_STRATEGY_THROW_ERROR = 5 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/inline.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/inline.rb new file mode 100644 index 000000000000..74ecf12b5154 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/inline.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dialogflow + module CX + module V3 + # Inline destination for a Dialogflow operation that writes or exports objects + # (e.g. {::Google::Cloud::Dialogflow::CX::V3::Intent intents}) outside of Dialogflow. + # @!attribute [r] content + # @return [::String] + # Output only. The uncompressed byte content for the objects. + # Only populated in responses. + class InlineDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Inline source for a Dialogflow operation that reads or imports objects + # (e.g. {::Google::Cloud::Dialogflow::CX::V3::Intent intents}) into Dialogflow. + # @!attribute [rw] content + # @return [::String] + # The uncompressed byte content for the objects. + class InlineSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/intent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/intent.rb new file mode 100644 index 000000000000..9fe73300461d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/intent.rb @@ -0,0 +1,517 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # An intent represents a user's intent to interact with a conversational agent. + # + # You can provide information for the Dialogflow API to use to match user input + # to an intent by adding training phrases (i.e., examples of user input) to + # your intent. + # @!attribute [rw] name + # @return [::String] + # The unique identifier of the intent. + # Required for the + # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#update_intent Intents.UpdateIntent} + # method. + # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#create_intent Intents.CreateIntent} + # populates the name automatically. + # Format: + # `projects//locations//agents//intents/`. + # @!attribute [rw] display_name + # @return [::String] + # Required. The human-readable name of the intent, unique within the agent. + # @!attribute [rw] training_phrases + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Intent::TrainingPhrase>] + # The collection of training phrases the agent is trained on to identify the + # intent. + # @!attribute [rw] parameters + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Intent::Parameter>] + # The collection of parameters associated with the intent. + # @!attribute [rw] priority + # @return [::Integer] + # 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] + # Indicates whether this is a fallback intent. Currently only default + # fallback intent is allowed in the agent, which is added upon agent + # creation. + # Adding training phrases to fallback intent is useful in the case of + # requests that are mistakenly matched, since training phrases assigned to + # fallback intents act as negative examples that triggers no-match event. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The key/value metadata to label an intent. Labels can contain + # lowercase letters, digits and the symbols '-' and '_'. International + # characters are allowed, including letters from unicase alphabets. Keys must + # start with a letter. Keys and values can be no longer than 63 characters + # and no more than 128 bytes. + # + # Prefix "sys-" is reserved for Dialogflow defined labels. Currently allowed + # Dialogflow defined labels include: + # * sys-head + # * sys-contextual + # The above labels do not require value. "sys-head" means the intent is a + # head intent. "sys.contextual" means the intent is a contextual intent. + # @!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 Intent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents an example that the agent is trained on to identify the intent. + # @!attribute [r] id + # @return [::String] + # Output only. The unique identifier of the training phrase. + # @!attribute [rw] parts + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 `parameter_id` field is set. + # @!attribute [rw] repeat_count + # @return [::Integer] + # Indicates how many times this example was added to the intent. + 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] parameter_id + # @return [::String] + # The {::Google::Cloud::Dialogflow::CX::V3::Intent::Parameter parameter} used to + # annotate this part of the training phrase. This field is required for + # annotated parts of the training phrase. + class Part + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Represents an intent parameter. + # @!attribute [rw] id + # @return [::String] + # Required. The unique identifier of the parameter. This field + # is used by [training + # phrases][google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase] to annotate + # their {::Google::Cloud::Dialogflow::CX::V3::Intent::TrainingPhrase::Part parts}. + # @!attribute [rw] entity_type + # @return [::String] + # Required. The entity type of the parameter. + # Format: + # `projects/-/locations/-/agents/-/entityTypes/` for + # system entity types (for example, + # `projects/-/locations/-/agents/-/entityTypes/sys.date`), or + # `projects//locations//agents//entityTypes/` + # for developer entity types. + # @!attribute [rw] is_list + # @return [::Boolean] + # Indicates whether the parameter represents a list of values. + # @!attribute [rw] redact + # @return [::Boolean] + # Indicates whether the parameter content should be redacted in log. If + # redaction is enabled, the parameter content will be replaced by parameter + # name during logging. + # Note: the parameter content is subject to redaction if either parameter + # level redaction or [entity type level + # redaction][google.cloud.dialogflow.cx.v3.EntityType.redact] is enabled. + class Parameter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#list_intents Intents.ListIntents}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to list all intents for. + # Format: `projects//locations//agents/`. + # @!attribute [rw] language_code + # @return [::String] + # The language to list intents for. The following fields are language + # dependent: + # + # * `Intent.training_phrases.parts.text` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + # @!attribute [rw] intent_view + # @return [::Google::Cloud::Dialogflow::CX::V3::IntentView] + # The resource view to apply to the returned intent. + # @!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 ListIntentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#list_intents Intents.ListIntents}. + # @!attribute [rw] intents + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Intent>] + # The list of 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::CX::V3::Intents::Client#get_intent Intents.GetIntent}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the intent. + # Format: + # `projects//locations//agents//intents/`. + # @!attribute [rw] language_code + # @return [::String] + # The language to retrieve the intent for. The following fields are language + # dependent: + # + # * `Intent.training_phrases.parts.text` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + class GetIntentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#create_intent Intents.CreateIntent}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to create an intent for. + # Format: `projects//locations//agents/`. + # @!attribute [rw] intent + # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] + # Required. The intent to create. + # @!attribute [rw] language_code + # @return [::String] + # The language of the following fields in `intent`: + # + # * `Intent.training_phrases.parts.text` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + class CreateIntentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#update_intent Intents.UpdateIntent}. + # @!attribute [rw] intent + # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] + # Required. The intent to update. + # @!attribute [rw] language_code + # @return [::String] + # The language of the following fields in `intent`: + # + # * `Intent.training_phrases.parts.text` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The mask to control which fields get updated. If the mask is not present, + # all fields will be updated. + class UpdateIntentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#delete_intent Intents.DeleteIntent}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the intent to delete. + # Format: + # `projects//locations//agents//intents/`. + class DeleteIntentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#import_intents Intents.ImportIntents}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to import the intents into. + # Format: `projects//locations//agents/`. + # @!attribute [rw] intents_uri + # @return [::String] + # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + # to import intents from. The format of this URI must be + # `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: `intents_uri`, `intents_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] intents_content + # @return [::Google::Cloud::Dialogflow::CX::V3::InlineSource] + # Uncompressed byte content of intents. + # + # Note: The following fields are mutually exclusive: `intents_content`, `intents_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] merge_option + # @return [::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest::MergeOption] + # Merge option for importing intents. If not specified, `REJECT` is assumed. + class ImportIntentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Merge option when display name conflicts exist during import. + module MergeOption + # Unspecified. Should not be used. + MERGE_OPTION_UNSPECIFIED = 0 + + # DEPRECATED: Please use + # [REPORT_CONFLICT][ImportIntentsRequest.REPORT_CONFLICT] instead. + # Fail the request if there are intents whose display names conflict with + # the display names of intents in the agent. + REJECT = 1 + + # Replace the original intent in the agent with the new intent when display + # name conflicts exist. + REPLACE = 2 + + # Merge the original intent with the new intent when display name conflicts + # exist. + MERGE = 3 + + # Create new intents with new display names to differentiate them from the + # existing intents when display name conflicts exist. + RENAME = 4 + + # Report conflict information if display names conflict is detected. + # Otherwise, import intents. + REPORT_CONFLICT = 5 + + # Keep the original intent and discard the conflicting new intent when + # display name conflicts exist. + KEEP = 6 + end + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#import_intents Intents.ImportIntents}. + # @!attribute [rw] intents + # @return [::Array<::String>] + # The unique identifier of the imported intents. + # Format: + # `projects//locations//agents//intents/`. + # @!attribute [rw] conflicting_resources + # @return [::Google::Cloud::Dialogflow::CX::V3::ImportIntentsResponse::ConflictingResources] + # Info which resources have conflicts when + # [REPORT_CONFLICT][ImportIntentsResponse.REPORT_CONFLICT] merge_option is + # set in ImportIntentsRequest. + class ImportIntentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Conflicting resources detected during the import process. Only filled when + # [REPORT_CONFLICT][ImportIntentsResponse.REPORT_CONFLICT] is set in the + # request and there are conflicts in the display names. + # @!attribute [rw] intent_display_names + # @return [::Array<::String>] + # Display names of conflicting intents. + # @!attribute [rw] entity_display_names + # @return [::Array<::String>] + # Display names of conflicting entities. + class ConflictingResources + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Metadata returned for the + # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#import_intents Intents.ImportIntents} + # long running operation. + class ImportIntentsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#export_intents Intents.ExportIntents}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent agent to export intents. + # Format: `projects//locations//agents/`. + # @!attribute [rw] intents + # @return [::Array<::String>] + # Required. The name of the intents to export. + # Format: + # `projects//locations//agents//intents/`. + # @!attribute [rw] intents_uri + # @return [::String] + # Optional. The [Google Cloud + # Storage](https://cloud.google.com/storage/docs/) URI to export the + # intents to. The format of this URI must be + # `gs:///`. + # + # 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). + # + # Note: The following fields are mutually exclusive: `intents_uri`, `intents_content_inline`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] intents_content_inline + # @return [::Boolean] + # Optional. The option to return the serialized intents inline. + # + # Note: The following fields are mutually exclusive: `intents_content_inline`, `intents_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] data_format + # @return [::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest::DataFormat] + # Optional. The data format of the exported intents. If not specified, `BLOB` + # is assumed. + class ExportIntentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Data format of the exported intents. + module DataFormat + # Unspecified format. Treated as `BLOB`. + DATA_FORMAT_UNSPECIFIED = 0 + + # Intents will be exported as raw bytes. + BLOB = 1 + + # Intents will be exported in JSON format. + JSON = 2 + + # Intents will be exported in CSV format. + CSV = 3 + end + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#export_intents Intents.ExportIntents}. + # @!attribute [rw] intents_uri + # @return [::String] + # The URI to a file containing the exported intents. This field is + # populated only if `intents_uri` is specified in + # {::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest ExportIntentsRequest}. + # + # Note: The following fields are mutually exclusive: `intents_uri`, `intents_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] intents_content + # @return [::Google::Cloud::Dialogflow::CX::V3::InlineDestination] + # Uncompressed byte content for intents. This field is populated only if + # `intents_content_inline` is set to true in + # {::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest ExportIntentsRequest}. + # + # Note: The following fields are mutually exclusive: `intents_content`, `intents_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ExportIntentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata returned for the + # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#export_intents Intents.ExportIntents} + # long running operation. + class ExportIntentsMetadata + 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. + module IntentView + # Not specified. Treated as INTENT_VIEW_FULL. + INTENT_VIEW_UNSPECIFIED = 0 + + # Training phrases field is not populated in the response. + INTENT_VIEW_PARTIAL = 1 + + # All fields are populated. + INTENT_VIEW_FULL = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/page.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/page.rb new file mode 100644 index 000000000000..fb399e930d9b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/page.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! + + +module Google + module Cloud + module Dialogflow + module CX + module V3 + # A Dialogflow CX conversation (session) can be described and visualized as a + # state machine. The states of a CX session are represented by pages. + # + # For each flow, you define many pages, where your combined pages can handle a + # complete conversation on the topics the flow is designed for. At any given + # moment, exactly one page is the current page, the current page is considered + # active, and the flow associated with that page is considered active. Every + # flow has a special start page. When a flow initially becomes active, the + # start page page becomes the current page. For each conversational turn, the + # current page will either stay the same or transition to another page. + # + # You configure each page to collect information from the end-user that is + # relevant for the conversational state represented by the page. + # + # For more information, see the + # [Page guide](https://cloud.google.com/dialogflow/cx/docs/concept/page). + # @!attribute [rw] name + # @return [::String] + # The unique identifier of the page. + # Required for the + # {::Google::Cloud::Dialogflow::CX::V3::Pages::Client#update_page Pages.UpdatePage} method. + # {::Google::Cloud::Dialogflow::CX::V3::Pages::Client#create_page Pages.CreatePage} + # populates the name automatically. + # Format: + # `projects//locations//agents//flows//pages/`. + # @!attribute [rw] display_name + # @return [::String] + # Required. The human-readable name of the page, unique within the flow. + # @!attribute [rw] description + # @return [::String] + # The description of the page. The maximum length is 500 characters. + # @!attribute [rw] entry_fulfillment + # @return [::Google::Cloud::Dialogflow::CX::V3::Fulfillment] + # The fulfillment to call when the session is entering the page. + # @!attribute [rw] form + # @return [::Google::Cloud::Dialogflow::CX::V3::Form] + # The form associated with the page, used for collecting parameters + # relevant to the page. + # @!attribute [rw] transition_route_groups + # @return [::Array<::String>] + # Ordered list of + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup `TransitionRouteGroups`} + # added to the page. Transition route groups must be unique within a page. If + # the page links both flow-level transition route groups and agent-level + # transition route groups, the flow-level ones will have higher priority and + # will be put before the agent-level ones. + # + # * If multiple transition routes within a page scope refer to the same + # intent, then the precedence order is: page's transition route -> page's + # transition route group -> flow's transition routes. + # + # * If multiple transition route groups within a page contain the same + # intent, then the first group in the ordered list takes precedence. + # + # Format:`projects//locations//agents//flows//transitionRouteGroups/` + # or + # `projects//locations//agents//transitionRouteGroups/` + # for agent-level groups. + # @!attribute [rw] transition_routes + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TransitionRoute>] + # A list of transitions for the transition rules of this page. + # They route the conversation to another page in the same flow, or another + # flow. + # + # When we are in a certain page, the TransitionRoutes are evaluated in the + # following order: + # + # * TransitionRoutes defined in the page with intent specified. + # * TransitionRoutes defined in the + # [transition route + # groups][google.cloud.dialogflow.cx.v3.Page.transition_route_groups] + # with intent specified. + # * TransitionRoutes defined in flow with intent specified. + # * TransitionRoutes defined in the + # [transition route + # groups][google.cloud.dialogflow.cx.v3.Flow.transition_route_groups] + # with intent specified. + # * TransitionRoutes defined in the page with only condition specified. + # * TransitionRoutes defined in the + # [transition route + # groups][google.cloud.dialogflow.cx.v3.Page.transition_route_groups] + # with only condition specified. + # @!attribute [rw] event_handlers + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::EventHandler>] + # Handlers associated with the page to handle events such as webhook errors, + # no match or no input. + # @!attribute [rw] advanced_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::AdvancedSettings] + # Hierarchical advanced settings for this page. The settings exposed at the + # lower level overrides the settings exposed at the higher level. + # @!attribute [rw] knowledge_connector_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::KnowledgeConnectorSettings] + # Optional. Knowledge connector configuration. + class Page + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A form is a data model that groups related parameters that can be collected + # from the user. The process in which the agent prompts the user and collects + # parameter values from the user is called form filling. A form can be added to + # a {::Google::Cloud::Dialogflow::CX::V3::Page page}. When form filling is done, the + # filled parameters will be written to the + # {::Google::Cloud::Dialogflow::CX::V3::SessionInfo#parameters session}. + # @!attribute [rw] parameters + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Form::Parameter>] + # Parameters to collect from the user. + class Form + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a form parameter. + # @!attribute [rw] display_name + # @return [::String] + # Required. The human-readable name of the parameter, unique within the + # form. + # @!attribute [rw] required + # @return [::Boolean] + # Indicates whether the parameter is required. Optional parameters will not + # trigger prompts; however, they are filled if the user specifies them. + # Required parameters must be filled before form filling concludes. + # @!attribute [rw] entity_type + # @return [::String] + # Required. The entity type of the parameter. + # Format: + # `projects/-/locations/-/agents/-/entityTypes/` for + # system entity types (for example, + # `projects/-/locations/-/agents/-/entityTypes/sys.date`), or + # `projects//locations//agents//entityTypes/` + # for developer entity types. + # @!attribute [rw] is_list + # @return [::Boolean] + # Indicates whether the parameter represents a list of values. + # @!attribute [rw] fill_behavior + # @return [::Google::Cloud::Dialogflow::CX::V3::Form::Parameter::FillBehavior] + # Required. Defines fill behavior for the parameter. + # @!attribute [rw] default_value + # @return [::Google::Protobuf::Value] + # The default value of an optional parameter. If the parameter is required, + # the default value will be ignored. + # @!attribute [rw] redact + # @return [::Boolean] + # Indicates whether the parameter content should be redacted in log. If + # redaction is enabled, the parameter content will be replaced by parameter + # name during logging. + # Note: the parameter content is subject to redaction if either parameter + # level redaction or [entity type level + # redaction][google.cloud.dialogflow.cx.v3.EntityType.redact] is enabled. + # @!attribute [rw] advanced_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::AdvancedSettings] + # Hierarchical advanced settings for this parameter. The settings exposed + # at the lower level overrides the settings exposed at the higher level. + class Parameter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration for how the filling of a parameter should be handled. + # @!attribute [rw] initial_prompt_fulfillment + # @return [::Google::Cloud::Dialogflow::CX::V3::Fulfillment] + # Required. The fulfillment to provide the initial prompt that the agent + # can present to the user in order to fill the parameter. + # @!attribute [rw] reprompt_event_handlers + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::EventHandler>] + # The handlers for parameter-level events, used to provide reprompt for + # the parameter or transition to a different page/flow. The supported + # events are: + # * `sys.no-match-`, where N can be from 1 to 6 + # * `sys.no-match-default` + # * `sys.no-input-`, where N can be from 1 to 6 + # * `sys.no-input-default` + # * `sys.invalid-parameter` + # + # `initial_prompt_fulfillment` provides the first prompt for the + # parameter. + # + # If the user's response does not fill the parameter, a + # no-match/no-input event will be triggered, and the fulfillment + # associated with the `sys.no-match-1`/`sys.no-input-1` handler (if + # defined) will be called to provide a prompt. The + # `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to + # the next no-match/no-input event, and so on. + # + # A `sys.no-match-default` or `sys.no-input-default` handler will be used + # to handle all following no-match/no-input events after all numbered + # no-match/no-input handlers for the parameter are consumed. + # + # A `sys.invalid-parameter` handler can be defined to handle the case + # where the parameter values have been `invalidated` by webhook. For + # example, if the user's response fill the parameter, however the + # parameter was invalidated by webhook, the fulfillment associated with + # the `sys.invalid-parameter` handler (if defined) will be called to + # provide a prompt. + # + # If the event handler for the corresponding event can't be found on the + # parameter, `initial_prompt_fulfillment` will be re-prompted. + class FillBehavior + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # An event handler specifies an + # {::Google::Cloud::Dialogflow::CX::V3::EventHandler#event event} that can be handled + # during a session. When the specified event happens, the following actions are + # taken in order: + # + # * If there is a + # {::Google::Cloud::Dialogflow::CX::V3::EventHandler#trigger_fulfillment `trigger_fulfillment`} + # associated with the event, it will be called. + # * If there is a + # {::Google::Cloud::Dialogflow::CX::V3::EventHandler#target_page `target_page`} + # associated with the event, the session will transition into the specified + # page. + # * If there is a + # {::Google::Cloud::Dialogflow::CX::V3::EventHandler#target_flow `target_flow`} + # associated with the event, the session will transition into the specified + # flow. + # @!attribute [r] name + # @return [::String] + # Output only. The unique identifier of this event handler. + # @!attribute [rw] event + # @return [::String] + # Required. The name of the event to handle. + # @!attribute [rw] trigger_fulfillment + # @return [::Google::Cloud::Dialogflow::CX::V3::Fulfillment] + # The fulfillment to call when the event occurs. + # Handling webhook errors with a fulfillment enabled with webhook could + # cause infinite loop. It is invalid to specify such fulfillment for a + # handler handling webhooks. + # @!attribute [rw] target_page + # @return [::String] + # The target page to transition to. + # Format: + # `projects//locations//agents//flows//pages/`. + # + # Note: The following fields are mutually exclusive: `target_page`, `target_flow`, `target_playbook`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] target_flow + # @return [::String] + # The target flow to transition to. + # Format: + # `projects//locations//agents//flows/`. + # + # Note: The following fields are mutually exclusive: `target_flow`, `target_page`, `target_playbook`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] target_playbook + # @return [::String] + # The target playbook to transition to. + # Format: + # `projects//locations//agents//playbooks/`. + # + # Note: The following fields are mutually exclusive: `target_playbook`, `target_page`, `target_flow`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class EventHandler + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A transition route specifies a {::Google::Cloud::Dialogflow::CX::V3::Intent intent} + # that can be matched and/or a data condition that can be evaluated during a + # session. When a specified transition is matched, the following actions are + # taken in order: + # + # * If there is a + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRoute#trigger_fulfillment `trigger_fulfillment`} + # associated with the transition, it will be called. + # * If there is a + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRoute#target_page `target_page`} + # associated with the transition, the session will transition into the + # specified page. + # * If there is a + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRoute#target_flow `target_flow`} + # associated with the transition, the session will transition into the + # specified flow. + # @!attribute [r] name + # @return [::String] + # Output only. The unique identifier of this transition route. + # @!attribute [rw] description + # @return [::String] + # Optional. The description of the transition route. The maximum length is + # 500 characters. + # @!attribute [rw] intent + # @return [::String] + # The unique identifier of an {::Google::Cloud::Dialogflow::CX::V3::Intent Intent}. + # Format: + # `projects//locations//agents//intents/`. + # Indicates that the transition can only happen when the given intent is + # matched. + # At least one of `intent` or `condition` must be specified. When both + # `intent` and `condition` are specified, the transition can only happen + # when both are fulfilled. + # @!attribute [rw] condition + # @return [::String] + # The condition to evaluate against [form + # parameters][google.cloud.dialogflow.cx.v3.Form.parameters] or [session + # parameters][google.cloud.dialogflow.cx.v3.SessionInfo.parameters]. + # + # See the [conditions + # reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). + # At least one of `intent` or `condition` must be specified. When both + # `intent` and `condition` are specified, the transition can only happen + # when both are fulfilled. + # @!attribute [rw] trigger_fulfillment + # @return [::Google::Cloud::Dialogflow::CX::V3::Fulfillment] + # The fulfillment to call when the condition is satisfied. At least one of + # `trigger_fulfillment` and `target` must be specified. When both are + # defined, `trigger_fulfillment` is executed first. + # @!attribute [rw] target_page + # @return [::String] + # The target page to transition to. + # Format: + # `projects//locations//agents//flows//pages/`. + # + # Note: The following fields are mutually exclusive: `target_page`, `target_flow`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] target_flow + # @return [::String] + # The target flow to transition to. + # Format: + # `projects//locations//agents//flows/`. + # + # Note: The following fields are mutually exclusive: `target_flow`, `target_page`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class TransitionRoute + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Pages::Client#list_pages Pages.ListPages}. + # @!attribute [rw] parent + # @return [::String] + # Required. The flow to list all pages for. + # Format: + # `projects//locations//agents//flows/`. + # @!attribute [rw] language_code + # @return [::String] + # The language to list pages for. The following fields are language + # dependent: + # + # * `Page.entry_fulfillment.messages` + # * `Page.entry_fulfillment.conditional_cases` + # * `Page.event_handlers.trigger_fulfillment.messages` + # * `Page.event_handlers.trigger_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + # * + # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + # * + # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + # * `Page.transition_routes.trigger_fulfillment.messages` + # * `Page.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + # @!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 ListPagesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Pages::Client#list_pages Pages.ListPages}. + # @!attribute [rw] pages + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Page>] + # The list of pages. 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 ListPagesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Pages::Client#get_page Pages.GetPage}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the page. + # Format: + # `projects//locations//agents//flows//pages/`. + # @!attribute [rw] language_code + # @return [::String] + # The language to retrieve the page for. The following fields are language + # dependent: + # + # * `Page.entry_fulfillment.messages` + # * `Page.entry_fulfillment.conditional_cases` + # * `Page.event_handlers.trigger_fulfillment.messages` + # * `Page.event_handlers.trigger_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + # * + # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + # * + # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + # * `Page.transition_routes.trigger_fulfillment.messages` + # * `Page.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + class GetPageRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Pages::Client#create_page Pages.CreatePage}. + # @!attribute [rw] parent + # @return [::String] + # Required. The flow to create a page for. + # Format: + # `projects//locations//agents//flows/`. + # @!attribute [rw] page + # @return [::Google::Cloud::Dialogflow::CX::V3::Page] + # Required. The page to create. + # @!attribute [rw] language_code + # @return [::String] + # The language of the following fields in `page`: + # + # * `Page.entry_fulfillment.messages` + # * `Page.entry_fulfillment.conditional_cases` + # * `Page.event_handlers.trigger_fulfillment.messages` + # * `Page.event_handlers.trigger_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + # * + # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + # * + # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + # * `Page.transition_routes.trigger_fulfillment.messages` + # * `Page.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + class CreatePageRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Pages::Client#update_page Pages.UpdatePage}. + # @!attribute [rw] page + # @return [::Google::Cloud::Dialogflow::CX::V3::Page] + # Required. The page to update. + # @!attribute [rw] language_code + # @return [::String] + # The language of the following fields in `page`: + # + # * `Page.entry_fulfillment.messages` + # * `Page.entry_fulfillment.conditional_cases` + # * `Page.event_handlers.trigger_fulfillment.messages` + # * `Page.event_handlers.trigger_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + # * + # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + # * + # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + # * `Page.transition_routes.trigger_fulfillment.messages` + # * `Page.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The mask to control which fields get updated. If the mask is not present, + # all fields will be updated. + class UpdatePageRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Pages::Client#delete_page Pages.DeletePage}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the page to delete. + # Format: + # `projects//locations//agents//Flows//pages/`. + # @!attribute [rw] force + # @return [::Boolean] + # This field has no effect for pages with no incoming transitions. + # For pages with incoming transitions: + # + # * If `force` is set to false, an error will be returned with message + # indicating the incoming transitions. + # * If `force` is set to true, Dialogflow will remove the page, as well as + # any transitions to the page (i.e. [Target + # page][EventHandler.target_page] in event handlers or [Target + # page][TransitionRoute.target_page] in transition routes that point to + # this page will be cleared). + class DeletePageRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Knowledge Connector settings for this page or flow. + # This includes information such as the attached Knowledge Bases, and the way + # to execute fulfillment. + # @!attribute [rw] enabled + # @return [::Boolean] + # Whether Knowledge Connector is enabled or not. + # @!attribute [rw] trigger_fulfillment + # @return [::Google::Cloud::Dialogflow::CX::V3::Fulfillment] + # The fulfillment to be triggered. + # + # When the answers from the Knowledge Connector are selected by Dialogflow, + # you can utitlize the request scoped parameter `$request.knowledge.answers` + # (contains up to the 5 highest confidence answers) and + # `$request.knowledge.questions` (contains the corresponding questions) to + # construct the fulfillment. + # @!attribute [rw] target_page + # @return [::String] + # The target page to transition to. + # Format: + # `projects//locations//agents//flows//pages/`. + # + # Note: The following fields are mutually exclusive: `target_page`, `target_flow`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] target_flow + # @return [::String] + # The target flow to transition to. + # Format: + # `projects//locations//agents//flows/`. + # + # Note: The following fields are mutually exclusive: `target_flow`, `target_page`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] data_store_connections + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::DataStoreConnection>] + # Optional. List of related data store connections. + class KnowledgeConnectorSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/parameter_definition.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/parameter_definition.rb new file mode 100644 index 000000000000..0cd62239c00a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/parameter_definition.rb @@ -0,0 +1,137 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dialogflow + module Cx + module V3 + # Defines the properties of a parameter. + # Used to define parameters used in the agent and the + # input / output parameters for each fulfillment. + # @!attribute [rw] name + # @return [::String] + # Required. Name of parameter. + # @!attribute [rw] type + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::Dialogflow::CX::V3::ParameterDefinition::ParameterType] + # Type of parameter. + # @!attribute [rw] type_schema + # @return [::Google::Cloud::Dialogflow::CX::V3::TypeSchema] + # Optional. Type schema of parameter. + # @!attribute [rw] description + # @return [::String] + # Human-readable description of the parameter. Limited to 300 characters. + class ParameterDefinition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Parameter types are used for validation. + # These types are consistent with + # {::Google::Protobuf::Value google.protobuf.Value}. + module ParameterType + # Not specified. No validation will be performed. + PARAMETER_TYPE_UNSPECIFIED = 0 + + # Represents any string value. + STRING = 1 + + # Represents any number value. + NUMBER = 2 + + # Represents a boolean value. + BOOLEAN = 3 + + # Represents a null value. + NULL = 4 + + # Represents any object value. + OBJECT = 5 + + # Represents a repeated value. + LIST = 6 + end + end + + # Encapsulates different type schema variations: either a reference to an + # a schema that's already defined by a tool, or an inline definition. + # @!attribute [rw] inline_schema + # @return [::Google::Cloud::Dialogflow::CX::V3::InlineSchema] + # Set if this is an inline schema definition. + # + # Note: The following fields are mutually exclusive: `inline_schema`, `schema_reference`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] schema_reference + # @return [::Google::Cloud::Dialogflow::CX::V3::TypeSchema::SchemaReference] + # Set if this is a schema reference. + # + # Note: The following fields are mutually exclusive: `schema_reference`, `inline_schema`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class TypeSchema + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A reference to the schema of an existing tool. + # @!attribute [rw] tool + # @return [::String] + # The tool that contains this schema definition. + # Format: + # `projects//locations//agents//tools/`. + # @!attribute [rw] schema + # @return [::String] + # The name of the schema. + class SchemaReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A type schema object that's specified inline. + # @!attribute [rw] type + # @return [::Google::Cloud::Dialogflow::CX::V3::DataType] + # Data type of the schema. + # @!attribute [rw] items + # @return [::Google::Cloud::Dialogflow::CX::V3::TypeSchema] + # Schema of the elements if this is an ARRAY type. + class InlineSchema + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines data types that are supported for inlined schemas. These types are + # consistent with {::Google::Protobuf::Value google.protobuf.Value}. + module DataType + # Not specified. + DATA_TYPE_UNSPECIFIED = 0 + + # Represents any string value. + STRING = 1 + + # Represents any number value. + NUMBER = 2 + + # Represents a boolean value. + BOOLEAN = 3 + + # Represents a repeated value. + ARRAY = 6 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/playbook.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/playbook.rb new file mode 100644 index 000000000000..19d12a0b8a57 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/playbook.rb @@ -0,0 +1,546 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 Cx + module V3 + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#create_playbook Playbooks.CreatePlaybook}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to create a playbook for. + # Format: `projects//locations//agents/`. + # @!attribute [rw] playbook + # @return [::Google::Cloud::Dialogflow::CX::V3::Playbook] + # Required. The playbook to create. + class CreatePlaybookRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#delete_playbook Playbooks.DeletePlaybook}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the playbook to delete. + # Format: + # `projects//locations//agents//playbooks/`. + class DeletePlaybookRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#list_playbooks Playbooks.ListPlaybooks}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to list playbooks from. + # Format: `projects//locations//agents/`. + # @!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 ListPlaybooksRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#list_playbooks Playbooks.ListPlaybooks}. + # @!attribute [rw] playbooks + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Playbook>] + # The list of playbooks. 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 ListPlaybooksResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#get_playbook Playbooks.GetPlaybook}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the playbook. + # Format: + # `projects//locations//agents//playbooks/`. + class GetPlaybookRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#update_playbook Playbooks.UpdatePlaybook}. + # @!attribute [rw] playbook + # @return [::Google::Cloud::Dialogflow::CX::V3::Playbook] + # Required. The playbook to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The mask to control which fields get updated. If the mask is not present, + # all fields will be updated. + class UpdatePlaybookRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Playbook is the basic building block to instruct the LLM how to execute a + # certain task. + # + # A playbook consists of a goal to accomplish, an optional list of step by step + # instructions (the step instruction may refers to name of the custom or + # default plugin tools to use) to perform the task, + # a list of contextual input data to be passed in at the beginning of the + # invoked, and a list of output parameters to store the playbook result. + # @!attribute [rw] name + # @return [::String] + # The unique identifier of the playbook. + # Format: + # `projects//locations//agents//playbooks/`. + # @!attribute [rw] display_name + # @return [::String] + # Required. The human-readable name of the playbook, unique within an agent. + # @!attribute [rw] goal + # @return [::String] + # Required. High level description of the goal the playbook intend to + # accomplish. A goal should be concise since it's visible to other playbooks + # that may reference this playbook. + # @!attribute [rw] input_parameter_definitions + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ParameterDefinition>] + # Optional. Defined structured input parameters for this playbook. + # @!attribute [rw] output_parameter_definitions + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ParameterDefinition>] + # Optional. Defined structured output parameters for this playbook. + # @!attribute [rw] instruction + # @return [::Google::Cloud::Dialogflow::CX::V3::Playbook::Instruction] + # Instruction to accomplish target goal. + # @!attribute [r] token_count + # @return [::Integer] + # Output only. Estimated number of tokes current playbook takes when sent to + # the LLM. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp of initial playbook creation. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Last time the playbook version was updated. + # @!attribute [r] referenced_playbooks + # @return [::Array<::String>] + # Output only. The resource name of other playbooks referenced by the current + # playbook in the instructions. + # @!attribute [r] referenced_flows + # @return [::Array<::String>] + # Output only. The resource name of flows referenced by the current playbook + # in the instructions. + # @!attribute [rw] referenced_tools + # @return [::Array<::String>] + # Optional. The resource name of tools referenced by the current playbook in + # the instructions. If not provided explicitly, they are will + # be implied using the tool being referenced in goal and steps. + # @!attribute [r] inline_actions + # @return [::Array<::String>] + # Optional. Output only. Names of inline actions scoped to this playbook. + # These actions are in addition to those belonging to referenced tools, child + # playbooks, and flows, e.g. actions that are defined in the playbook's code + # block. + # @!attribute [rw] code_block + # @return [::Google::Cloud::Dialogflow::CX::V3::CodeBlock] + # Optional. The playbook's scoped code block, which may implement handlers + # and actions. + # @!attribute [rw] llm_model_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::LlmModelSettings] + # Optional. Llm model settings for the playbook. + # @!attribute [rw] handlers + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Handler>] + # Optional. A list of registered handlers to execuate based on the specified + # triggers. + # @!attribute [rw] playbook_type + # @return [::Google::Cloud::Dialogflow::CX::V3::Playbook::PlaybookType] + # Optional. Type of the playbook. + class Playbook + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Message of single step execution. + # @!attribute [rw] text + # @return [::String] + # Step instruction in text format. + # @!attribute [rw] steps + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Playbook::Step>] + # Sub-processing needed to execute the current step. + class Step + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message of the Instruction of the playbook. + # @!attribute [rw] guidelines + # @return [::String] + # General guidelines for the playbook. These are unstructured instructions + # that are not directly part of the goal, e.g. "Always be polite". It's + # valid for this text to be long and used instead of steps altogether. + # @!attribute [rw] steps + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Playbook::Step>] + # Ordered list of step by step execution instructions to accomplish + # target goal. + class Instruction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Type of the playbook. + module PlaybookType + # Unspecified type. Default to TASK. + PLAYBOOK_TYPE_UNSPECIFIED = 0 + + # Task playbook. + TASK = 1 + + # Routine playbook. + ROUTINE = 3 + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#create_playbook_version Playbooks.CreatePlaybookVersion}. + # @!attribute [rw] parent + # @return [::String] + # Required. The playbook to create a version for. + # Format: + # `projects//locations//agents//playbooks/`. + # @!attribute [rw] playbook_version + # @return [::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion] + # Required. The playbook version to create. + class CreatePlaybookVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Playbook version is a snapshot of the playbook at certain timestamp. + # @!attribute [rw] name + # @return [::String] + # The unique identifier of the playbook version. + # Format: + # `projects//locations//agents//playbooks//versions/`. + # @!attribute [rw] description + # @return [::String] + # Optional. The description of the playbook version. + # @!attribute [r] playbook + # @return [::Google::Cloud::Dialogflow::CX::V3::Playbook] + # Output only. Snapshot of the playbook when the playbook version is created. + # @!attribute [r] examples + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Example>] + # Output only. Snapshot of the examples belonging to the playbook when the + # playbook version is created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Last time the playbook version was created or modified. + class PlaybookVersion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#get_playbook_version Playbooks.GetPlaybookVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the playbook version. + # Format: + # `projects//locations//agents//playbooks//versions/`. + class GetPlaybookVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#restore_playbook_version Playbooks.RestorePlaybookVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the playbook version. + # Format: + # `projects//locations//agents//playbooks//versions/`. + class RestorePlaybookVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#restore_playbook_version Playbooks.RestorePlaybookVersion}. + # @!attribute [rw] playbook + # @return [::Google::Cloud::Dialogflow::CX::V3::Playbook] + # The updated playbook. + class RestorePlaybookVersionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#list_playbook_versions Playbooks.ListPlaybookVersions}. + # @!attribute [rw] parent + # @return [::String] + # Required. The playbook to list versions for. + # Format: + # `projects//locations//agents//playbooks/`. + # @!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 ListPlaybookVersionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#list_playbook_versions Playbooks.ListPlaybookVersions}. + # @!attribute [rw] playbook_versions + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion>] + # The list of playbook version. 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 ListPlaybookVersionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#delete_playbook_version Playbooks.DeletePlaybookVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the playbook version to delete. + # Format: + # `projects//locations//agents//playbooks//versions/`. + class DeletePlaybookVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#export_playbook Playbooks.ExportPlaybook}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the playbook to export. + # Format: + # `projects//locations//agents//playbooks/`. + # @!attribute [rw] playbook_uri + # @return [::String] + # Optional. The [Google Cloud + # Storage](https://cloud.google.com/storage/docs/) URI to export the playbook + # to. The format of this URI must be `gs:///`. If + # left unspecified, the serialized playbook 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). + # @!attribute [rw] data_format + # @return [::Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest::DataFormat] + # Optional. The data format of the exported agent. If not specified, `BLOB` + # is assumed. + class ExportPlaybookRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Data format of the exported playbook. + module DataFormat + # Unspecified format. + DATA_FORMAT_UNSPECIFIED = 0 + + # Flow content will be exported as raw bytes. + BLOB = 1 + + # Flow content will be exported in JSON format. + JSON = 2 + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#import_playbook Playbooks.ImportPlaybook}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to import the playbook into. + # Format: `projects//locations//agents/`. + # @!attribute [rw] playbook_uri + # @return [::String] + # [Dialogflow access + # control] + # (https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + # + # Note: The following fields are mutually exclusive: `playbook_uri`, `playbook_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] playbook_content + # @return [::String] + # Uncompressed raw byte content for playbook. + # + # Note: The following fields are mutually exclusive: `playbook_content`, `playbook_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] import_strategy + # @return [::Google::Cloud::Dialogflow::CX::V3::PlaybookImportStrategy] + # Optional. Specifies the import strategy used when resolving resource + # conflicts. + class ImportPlaybookRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The playbook import strategy used for resource conflict resolution associated + # with an + # {::Google::Cloud::Dialogflow::CX::V3::ImportPlaybookRequest ImportPlaybookRequest}. + # @!attribute [rw] main_playbook_import_strategy + # @return [::Google::Cloud::Dialogflow::CX::V3::ImportStrategy] + # Optional. Specifies the import strategy used when resolving conflicts with + # the main playbook. If not specified, 'CREATE_NEW' is assumed. + # @!attribute [rw] nested_resource_import_strategy + # @return [::Google::Cloud::Dialogflow::CX::V3::ImportStrategy] + # Optional. Specifies the import strategy used when resolving referenced + # playbook/flow conflicts. If not specified, 'CREATE_NEW' is assumed. + # @!attribute [rw] tool_import_strategy + # @return [::Google::Cloud::Dialogflow::CX::V3::ImportStrategy] + # Optional. Specifies the import strategy used when resolving tool conflicts. + # If not specified, 'CREATE_NEW' is assumed. This will be applied after the + # main playbook and nested resource import strategies, meaning if the + # playbook that references the tool is skipped, the tool will also be + # skipped. + class PlaybookImportStrategy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#import_playbook Playbooks.ImportPlaybook}. + # @!attribute [rw] playbook + # @return [::String] + # The unique identifier of the new playbook. + # Format: + # `projects//locations//agents//playbooks/`. + # @!attribute [rw] conflicting_resources + # @return [::Google::Cloud::Dialogflow::CX::V3::ImportPlaybookResponse::ConflictingResources] + # Info which resources have conflicts when + # [REPORT_CONFLICTS][ImportPlaybookResponse.REPORT_CONFLICTS] import strategy + # is set for all resources in ImportPlaybookRequest. + class ImportPlaybookResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Conflicting resources detected during the import process. Only filled when + # [REPORT_CONFLICTS][ImportPlaybookResponse.REPORT_CONFLICTS] is set in the + # request and there are conflicts in the display names. + # @!attribute [rw] main_playbook_display_name + # @return [::String] + # Display name of conflicting main playbook. + # @!attribute [rw] nested_playbook_display_names + # @return [::Array<::String>] + # Display names of conflicting nested playbooks. + # @!attribute [rw] tool_display_names + # @return [::Array<::String>] + # Display names of conflicting tools. + class ConflictingResources + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#export_playbook Playbooks.ExportPlaybook}. + # @!attribute [rw] playbook_uri + # @return [::String] + # The URI to a file containing the exported playbook. This field is + # populated only if `playbook_uri` is specified in + # {::Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest ExportPlaybookRequest}. + # + # Note: The following fields are mutually exclusive: `playbook_uri`, `playbook_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] playbook_content + # @return [::String] + # Uncompressed raw byte content for playbook. + # + # Note: The following fields are mutually exclusive: `playbook_content`, `playbook_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ExportPlaybookResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Handler can be used to define custom logic to be executed based on the + # user-specified triggers. + # @!attribute [rw] event_handler + # @return [::Google::Cloud::Dialogflow::CX::V3::Handler::EventHandler] + # A handler triggered by event. + # + # Note: The following fields are mutually exclusive: `event_handler`, `lifecycle_handler`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] lifecycle_handler + # @return [::Google::Cloud::Dialogflow::CX::V3::Handler::LifecycleHandler] + # A handler triggered during specific lifecycle of the playbook execution. + # + # Note: The following fields are mutually exclusive: `lifecycle_handler`, `event_handler`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Handler + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A handler that is triggered by the specified + # {::Google::Cloud::Dialogflow::CX::V3::Handler::EventHandler#event event}. + # @!attribute [rw] event + # @return [::String] + # Required. The name of the event that triggers this handler. + # @!attribute [rw] condition + # @return [::String] + # Optional. The condition that must be satisfied to trigger this handler. + # @!attribute [rw] fulfillment + # @return [::Google::Cloud::Dialogflow::CX::V3::Fulfillment] + # Required. The fulfillment to call when the event occurs. + class EventHandler + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A handler that is triggered on the specific + # {::Google::Cloud::Dialogflow::CX::V3::Handler::LifecycleHandler#lifecycle_stage lifecycle_stage} + # of the playbook execution. + # @!attribute [rw] lifecycle_stage + # @return [::String] + # Required. The name of the lifecycle stage that triggers this handler. + # Supported values: + # * `playbook-start` + # * `pre-action-selection` + # * `pre-action-execution` + # @!attribute [rw] condition + # @return [::String] + # Optional. The condition that must be satisfied to trigger this handler. + # @!attribute [rw] fulfillment + # @return [::Google::Cloud::Dialogflow::CX::V3::Fulfillment] + # Required. The fulfillment to call when this handler is triggered. + class LifecycleHandler + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb new file mode 100644 index 000000000000..1f681b5b02f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb @@ -0,0 +1,319 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # Represents a response message that can be returned by a conversational agent. + # + # Response messages are also used for output audio synthesis. The approach is + # as follows: + # + # * If at least one OutputAudioText response is present, then all + # OutputAudioText responses are linearly concatenated, and the result is used + # for output audio synthesis. + # * If the OutputAudioText responses are a mixture of text and SSML, then the + # concatenated result is treated as SSML; otherwise, the result is treated as + # either text or SSML as appropriate. The agent designer should ideally use + # either text or SSML consistently throughout the bot design. + # * Otherwise, all Text responses are linearly concatenated, and the result is + # used for output audio synthesis. + # + # This approach allows for more sophisticated user experience scenarios, where + # the text displayed to the user may differ from what is heard. + # @!attribute [rw] text + # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::Text] + # Returns a text response. + # + # Note: The following fields are mutually exclusive: `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. 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] + # Returns a response containing a custom, platform-specific payload. + # + # Note: The following fields are mutually exclusive: `payload`, `text`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] conversation_success + # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::ConversationSuccess] + # Indicates that the conversation succeeded. + # + # Note: The following fields are mutually exclusive: `conversation_success`, `text`, `payload`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] output_audio_text + # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::OutputAudioText] + # A text or ssml response that is preferentially used for TTS output audio + # synthesis, as described in the comment on the ResponseMessage message. + # + # Note: The following fields are mutually exclusive: `output_audio_text`, `text`, `payload`, `conversation_success`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] live_agent_handoff + # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::LiveAgentHandoff] + # Hands off conversation to a human agent. + # + # Note: The following fields are mutually exclusive: `live_agent_handoff`, `text`, `payload`, `conversation_success`, `output_audio_text`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] end_interaction + # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::EndInteraction] + # Output only. A signal that indicates the interaction with the Dialogflow + # agent has ended. This message is generated by Dialogflow only when the + # conversation reaches `END_SESSION` page. It is not supposed to be defined + # by the user. + # + # It's guaranteed that there is at most one such message in each response. + # + # Note: The following fields are mutually exclusive: `end_interaction`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] play_audio + # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::PlayAudio] + # Signal that the client should play an audio clip hosted at a + # client-specific URI. Dialogflow uses this to construct + # {::Google::Cloud::Dialogflow::CX::V3::ResponseMessage#mixed_audio mixed_audio}. + # However, Dialogflow itself does not try to read or process the URI in any + # way. + # + # Note: The following fields are mutually exclusive: `play_audio`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] mixed_audio + # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::MixedAudio] + # Output only. An audio response message composed of both the synthesized + # Dialogflow agent responses and responses defined via + # {::Google::Cloud::Dialogflow::CX::V3::ResponseMessage#play_audio play_audio}. + # This message is generated by Dialogflow only and not supposed to be + # defined by the user. + # + # Note: The following fields are mutually exclusive: `mixed_audio`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] telephony_transfer_call + # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::TelephonyTransferCall] + # A signal that the client should transfer the phone call connected to + # this agent to a third-party endpoint. + # + # Note: The following fields are mutually exclusive: `telephony_transfer_call`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] knowledge_info_card + # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::KnowledgeInfoCard] + # Represents info card for knowledge answers, to be better rendered in + # Dialogflow Messenger. + # + # Note: The following fields are mutually exclusive: `knowledge_info_card`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] tool_call + # @return [::Google::Cloud::Dialogflow::CX::V3::ToolCall] + # Returns the definition of a tool call that should be executed by the + # client. + # + # Note: The following fields are mutually exclusive: `tool_call`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response_type + # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::ResponseType] + # Response type. + # @!attribute [rw] channel + # @return [::String] + # The channel which the response is associated with. Clients can specify the + # channel via + # {::Google::Cloud::Dialogflow::CX::V3::QueryParameters#channel QueryParameters.channel}, + # and only associated channel response will be returned. + class ResponseMessage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The text response message. + # @!attribute [rw] text + # @return [::Array<::String>] + # Required. A collection of text response variants. If multiple variants + # are defined, only one text response variant is returned at runtime. + # @!attribute [r] allow_playback_interruption + # @return [::Boolean] + # Output only. Whether the playback of this message can be interrupted by + # the end user's speech and the client can then starts the next Dialogflow + # request. + class Text + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Indicates that the conversation should be handed off to a live agent. + # + # Dialogflow only uses this to determine which conversations were handed off + # to a human agent for measurement purposes. What else to do with this signal + # is up to you and your handoff procedures. + # + # You may set this, for example: + # * In the + # {::Google::Cloud::Dialogflow::CX::V3::Page#entry_fulfillment entry_fulfillment} + # of a {::Google::Cloud::Dialogflow::CX::V3::Page Page} if + # entering the page indicates something went extremely wrong in the + # conversation. + # * In a webhook response when you determine that the customer issue can only + # be handled by a human. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Struct] + # Custom metadata for your handoff procedure. Dialogflow doesn't impose + # any structure on this. + class LiveAgentHandoff + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Indicates that the conversation succeeded, i.e., the bot handled the issue + # that the customer talked to it about. + # + # Dialogflow only uses this to determine which conversations should be + # counted as successful and doesn't process the metadata in this message in + # any way. Note that Dialogflow also considers conversations that get to the + # conversation end page as successful even if they don't return + # {::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::ConversationSuccess ConversationSuccess}. + # + # You may set this, for example: + # * In the + # {::Google::Cloud::Dialogflow::CX::V3::Page#entry_fulfillment entry_fulfillment} + # of a {::Google::Cloud::Dialogflow::CX::V3::Page Page} if + # entering the page indicates that the conversation succeeded. + # * In a webhook response when you determine that you handled the customer + # issue. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Struct] + # Custom metadata. Dialogflow doesn't impose any structure on this. + class ConversationSuccess + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A text or ssml response that is preferentially used for TTS output audio + # synthesis, as described in the comment on the ResponseMessage message. + # @!attribute [rw] text + # @return [::String] + # The raw text to be synthesized. + # + # Note: The following fields are mutually exclusive: `text`, `ssml`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ssml + # @return [::String] + # The SSML text to be synthesized. For more information, see + # [SSML](/speech/text-to-speech/docs/ssml). + # + # Note: The following fields are mutually exclusive: `ssml`, `text`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] allow_playback_interruption + # @return [::Boolean] + # Output only. Whether the playback of this message can be interrupted by + # the end user's speech and the client can then starts the next Dialogflow + # request. + class OutputAudioText + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Indicates that interaction with the Dialogflow agent has ended. + # This message is generated by Dialogflow only and not supposed to be + # defined by the user. + class EndInteraction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies an audio clip to be played by the client as part of the response. + # @!attribute [rw] audio_uri + # @return [::String] + # Required. URI of the audio clip. Dialogflow does not impose any + # validation on this value. It is specific to the client that reads it. + # @!attribute [r] allow_playback_interruption + # @return [::Boolean] + # Output only. Whether the playback of this message can be interrupted by + # the end user's speech and the client can then starts the next Dialogflow + # request. + class PlayAudio + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents an audio message that is composed of both segments + # synthesized from the Dialogflow agent prompts and ones hosted externally + # at the specified URIs. + # The external URIs are specified via + # {::Google::Cloud::Dialogflow::CX::V3::ResponseMessage#play_audio play_audio}. + # This message is generated by Dialogflow only and not supposed to be + # defined by the user. + # @!attribute [rw] segments + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::MixedAudio::Segment>] + # Segments this audio response is composed of. + class MixedAudio + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents one segment of audio. + # @!attribute [rw] audio + # @return [::String] + # Raw audio synthesized from the Dialogflow agent's response using + # the output config specified in the request. + # + # Note: The following fields are mutually exclusive: `audio`, `uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] uri + # @return [::String] + # Client-specific URI that points to an audio clip accessible to the + # client. Dialogflow does not impose any validation on it. + # + # Note: The following fields are mutually exclusive: `uri`, `audio`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] allow_playback_interruption + # @return [::Boolean] + # Output only. Whether the playback of this segment can be interrupted by + # the end user's speech and the client should then start the next + # Dialogflow request. + class Segment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Represents the signal that telles the client to transfer the phone call + # connected to the agent to a third-party endpoint. + # @!attribute [rw] phone_number + # @return [::String] + # Transfer the call to a phone number + # in [E.164 format](https://en.wikipedia.org/wiki/E.164). + class TelephonyTransferCall + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents info card response. If the response contains generative + # knowledge prediction, Dialogflow will return a payload with Infobot + # Messenger compatible info card. + # + # Otherwise, the info card response is skipped. + class KnowledgeInfoCard + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents different response types. + module ResponseType + # Not specified. + RESPONSE_TYPE_UNSPECIFIED = 0 + + # The response is from an [entry + # prompt][google.cloud.dialogflow.cx.v3.Page.entry_fulfillment] in the + # page. + ENTRY_PROMPT = 1 + + # The response is from [form-filling + # prompt][google.cloud.dialogflow.cx.v3.Form.Parameter.fill_behavior] in + # the page. + PARAMETER_PROMPT = 2 + + # The response is from a [transition + # route][google.cloud.dialogflow.cx.v3.TransitionRoute] or an [event + # handler][EventHandler] in the page or flow or transition route group. + HANDLER_PROMPT = 3 + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/safety_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/safety_settings.rb new file mode 100644 index 000000000000..2f4160c36863 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/safety_settings.rb @@ -0,0 +1,143 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dialogflow + module CX + module V3 + # Settings for Generative Safety. + # @!attribute [rw] default_banned_phrase_match_strategy + # @return [::Google::Cloud::Dialogflow::CX::V3::SafetySettings::PhraseMatchStrategy] + # Optional. Default phrase match strategy for banned phrases. + # @!attribute [rw] banned_phrases + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::SafetySettings::Phrase>] + # Banned phrases for generated text. + # @!attribute [rw] rai_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::SafetySettings::RaiSettings] + # Optional. Settings for Responsible AI checks. + # @!attribute [rw] default_rai_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::SafetySettings::RaiSettings] + # Optional. Immutable. Default RAI settings to be annotated on the agent, so + # that users will be able to restore their RAI configurations to the default + # settings. Read-only field for the API proto only. + # @!attribute [rw] prompt_security_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::SafetySettings::PromptSecuritySettings] + # Optional. Settings for prompt security checks. + class SafetySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Text input which can be used for prompt or banned phrases. + # @!attribute [rw] text + # @return [::String] + # Required. Text input which can be used for prompt or banned phrases. + # @!attribute [rw] language_code + # @return [::String] + # Required. Language code of the phrase. + class Phrase + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Responsible AI. + # @!attribute [rw] category_filters + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::SafetySettings::RaiSettings::CategoryFilter>] + # Optional. RAI blocking configurations. + class RaiSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration of the sensitivity level for blocking an RAI category. + # @!attribute [rw] category + # @return [::Google::Cloud::Dialogflow::CX::V3::SafetySettings::RaiSettings::SafetyCategory] + # RAI category to configure. + # @!attribute [rw] filter_level + # @return [::Google::Cloud::Dialogflow::CX::V3::SafetySettings::RaiSettings::SafetyFilterLevel] + # Blocking sensitivity level to configure for the RAI category. + class CategoryFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Sensitivity level for RAI categories. + module SafetyFilterLevel + # Unspecified -- uses default sensitivity levels. + SAFETY_FILTER_LEVEL_UNSPECIFIED = 0 + + # Block no text -- effectively disables the category. + BLOCK_NONE = 1 + + # Block a few suspicious texts. + BLOCK_FEW = 2 + + # Block some suspicious texts. + BLOCK_SOME = 3 + + # Block most suspicious texts. + BLOCK_MOST = 4 + end + + # RAI categories to configure. + module SafetyCategory + # Unspecified. + SAFETY_CATEGORY_UNSPECIFIED = 0 + + # Dangerous content. + DANGEROUS_CONTENT = 1 + + # Hate speech. + HATE_SPEECH = 2 + + # Harassment. + HARASSMENT = 3 + + # Sexually explicit content. + SEXUALLY_EXPLICIT_CONTENT = 4 + end + end + + # Settings for prompt security checks. + # @!attribute [rw] enable_prompt_security + # @return [::Boolean] + # Optional. Enable prompt security checks. + class PromptSecuritySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Strategy for matching phrases. + module PhraseMatchStrategy + # Unspecified, defaults to PARTIAL_MATCH. + PHRASE_MATCH_STRATEGY_UNSPECIFIED = 0 + + # Text that contains the phrase as a substring will be matched, e.g. "foo" + # will match "afoobar". + PARTIAL_MATCH = 1 + + # Text that contains the tokenized words of the phrase will be matched, + # e.g. "foo" will match "a foo bar" and "foo bar", but not "foobar". + WORD_MATCH = 2 + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb new file mode 100644 index 000000000000..ea43ecbb112f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb @@ -0,0 +1,327 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#get_security_settings SecuritySettingsService.GetSecuritySettings}. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the settings. + # Format: + # `projects//locations//securitySettings/`. + class GetSecuritySettingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#update_security_settings SecuritySettingsService.UpdateSecuritySettings}. + # @!attribute [rw] security_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] + # Required. [SecuritySettings] object that contains values for each of the + # fields 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 UpdateSecuritySettingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for [SecuritySettings.ListSecuritySettings][]. + # @!attribute [rw] parent + # @return [::String] + # Required. The location to list all security settings for. + # Format: `projects//locations/`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return in a single page. By default 20 and + # at most 100. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token value returned from a previous list request. + class ListSecuritySettingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for [SecuritySettings.ListSecuritySettings][]. + # @!attribute [rw] security_settings + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::SecuritySettings>] + # The list of security settings. + # @!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 ListSecuritySettingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for [SecuritySettings.CreateSecuritySettings][]. + # @!attribute [rw] parent + # @return [::String] + # Required. The location to create an + # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings} for. + # Format: `projects//locations/`. + # @!attribute [rw] security_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] + # Required. The security settings to create. + class CreateSecuritySettingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for [SecuritySettings.DeleteSecuritySettings][]. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the + # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings} to + # delete. Format: + # `projects//locations//securitySettings/`. + class DeleteSecuritySettingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the settings related to security issues, such as data redaction + # and data retention. It may take hours for updates on the settings to + # propagate to all the related components and take effect. + # @!attribute [rw] name + # @return [::String] + # Resource name of the settings. + # Required for the + # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#update_security_settings SecuritySettingsService.UpdateSecuritySettings} + # method. + # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#create_security_settings SecuritySettingsService.CreateSecuritySettings} + # populates the name automatically. Format: + # `projects//locations//securitySettings/`. + # @!attribute [rw] display_name + # @return [::String] + # Required. The human-readable name of the security settings, unique within + # the location. + # @!attribute [rw] redaction_strategy + # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings::RedactionStrategy] + # Strategy that defines how we do redaction. + # @!attribute [rw] redaction_scope + # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings::RedactionScope] + # Defines the data for which Dialogflow applies redaction. Dialogflow does + # not redact data that it does not have access to – for example, Cloud + # logging. + # @!attribute [rw] inspect_template + # @return [::String] + # [DLP](https://cloud.google.com/dlp/docs) inspect template name. Use this + # template to define inspect base settings. + # + # The `DLP Inspect Templates Reader` role is needed on the Dialogflow + # service identity service account (has the form + # `service-PROJECT_NUMBER@gcp-sa-dialogflow.iam.gserviceaccount.com`) + # for your agent's project. + # + # If empty, we use the default DLP inspect config. + # + # The template name will have one of the following formats: + # `projects//locations//inspectTemplates/` + # OR + # `organizations//locations//inspectTemplates/` + # + # Note: `inspect_template` must be located in the same region as the + # `SecuritySettings`. + # @!attribute [rw] deidentify_template + # @return [::String] + # [DLP](https://cloud.google.com/dlp/docs) deidentify template name. Use this + # template to define de-identification configuration for the content. + # + # The `DLP De-identify Templates Reader` role is needed on the Dialogflow + # service identity service account (has the form + # `service-PROJECT_NUMBER@gcp-sa-dialogflow.iam.gserviceaccount.com`) + # for your agent's project. + # + # If empty, Dialogflow replaces sensitive info with `[redacted]` text. + # + # The template name will have one of the following formats: + # `projects//locations//deidentifyTemplates/` + # OR + # `organizations//locations//deidentifyTemplates/` + # + # Note: `deidentify_template` must be located in the same region as the + # `SecuritySettings`. + # @!attribute [rw] retention_window_days + # @return [::Integer] + # Retains the data for the specified number of days. + # User must set a value lower than Dialogflow's default 365d TTL (30 days + # for Agent Assist traffic), higher value will be ignored and use default. + # Setting a value higher than that has no effect. A missing value or + # setting to 0 also means we use default TTL. + # When data retention configuration is changed, it only applies to the data + # created after the change; the TTL of existing data created before the + # change stays intact. + # + # Note: The following fields are mutually exclusive: `retention_window_days`, `retention_strategy`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] retention_strategy + # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings::RetentionStrategy] + # Specifies the retention behavior defined by + # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings::RetentionStrategy SecuritySettings.RetentionStrategy}. + # + # Note: The following fields are mutually exclusive: `retention_strategy`, `retention_window_days`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] purge_data_types + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::SecuritySettings::PurgeDataType>] + # List of types of data to remove when retention settings triggers purge. + # @!attribute [rw] audio_export_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings::AudioExportSettings] + # Controls audio export settings for post-conversation analytics when + # ingesting audio to conversations via [Participants.AnalyzeContent][] or + # [Participants.StreamingAnalyzeContent][]. + # + # If + # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings#retention_strategy retention_strategy} + # is set to REMOVE_AFTER_CONVERSATION or [audio_export_settings.gcs_bucket][] + # is empty, audio export is disabled. + # + # If audio export is enabled, audio is recorded and saved to + # [audio_export_settings.gcs_bucket][], subject to retention policy of + # [audio_export_settings.gcs_bucket][]. + # + # This setting won't effect audio input for implicit sessions via + # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#detect_intent Sessions.DetectIntent} + # or + # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#streaming_detect_intent Sessions.StreamingDetectIntent}. + # @!attribute [rw] insights_export_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings::InsightsExportSettings] + # Controls conversation exporting settings to Insights after conversation is + # completed. + # + # If + # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings#retention_strategy retention_strategy} + # is set to REMOVE_AFTER_CONVERSATION, Insights export is disabled no matter + # what you configure here. + class SecuritySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Settings for exporting audio. + # @!attribute [rw] gcs_bucket + # @return [::String] + # Cloud Storage bucket to export audio record to. + # Setting this field would grant the Storage Object Creator role to + # the Dialogflow Service Agent. + # API caller that tries to modify this field should have the permission of + # storage.buckets.setIamPolicy. + # @!attribute [rw] audio_export_pattern + # @return [::String] + # Filename pattern for exported audio. + # \\{conversation} and \\{timestamp} are placeholders that will be replaced + # with the conversation ID and epoch micros of the conversation. + # For example, "\\{conversation}/recording_\\{timestamp}.mulaw". + # @!attribute [rw] enable_audio_redaction + # @return [::Boolean] + # Enable audio redaction if it is true. + # Note that this only redacts end-user audio data; + # Synthesised audio from the virtual agent is not redacted. + # @!attribute [rw] audio_format + # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings::AudioExportSettings::AudioFormat] + # File format for exported audio file. Currently only in telephony + # recordings. + # @!attribute [rw] store_tts_audio + # @return [::Boolean] + # Whether to store TTS audio. By default, TTS audio from the virtual agent + # is not exported. + class AudioExportSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # File format for exported audio file. Currently only in telephony + # recordings. + module AudioFormat + # Unspecified. Do not use. + AUDIO_FORMAT_UNSPECIFIED = 0 + + # G.711 mu-law PCM with 8kHz sample rate. + MULAW = 1 + + # MP3 file format. + MP3 = 2 + + # OGG Vorbis. + OGG = 3 + end + end + + # Settings for exporting conversations to + # [Insights](https://cloud.google.com/contact-center/insights/docs). + # @!attribute [rw] enable_insights_export + # @return [::Boolean] + # If enabled, we will automatically exports + # conversations to Insights and Insights runs its analyzers. + class InsightsExportSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines how we redact data. + module RedactionStrategy + # Do not redact. + REDACTION_STRATEGY_UNSPECIFIED = 0 + + # Call redaction service to clean up the data to be persisted. + REDACT_WITH_SERVICE = 1 + end + + # Defines what types of data to redact. + module RedactionScope + # Don't redact any kind of data. + REDACTION_SCOPE_UNSPECIFIED = 0 + + # On data to be written to disk or similar devices that are capable of + # holding data even if power is disconnected. This includes data that are + # temporarily saved on disk. + REDACT_DISK_STORAGE = 2 + end + + # Defines how long we retain persisted data that contains sensitive info. + module RetentionStrategy + # Retains the persisted data with Dialogflow's internal default 365d TTLs. + RETENTION_STRATEGY_UNSPECIFIED = 0 + + # Removes data when the conversation ends. If there is no [Conversation][] + # explicitly established, a default conversation ends when the + # corresponding Dialogflow session ends. + REMOVE_AFTER_CONVERSATION = 1 + end + + # Type of data we purge after retention settings triggers purge. + module PurgeDataType + # Unspecified. Do not use. + PURGE_DATA_TYPE_UNSPECIFIED = 0 + + # Dialogflow history. This does not include Cloud logging, which is + # owned by the user - not Dialogflow. + DIALOGFLOW_HISTORY = 1 + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/session.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/session.rb new file mode 100644 index 000000000000..e12784721138 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/session.rb @@ -0,0 +1,1348 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # Stores information about feedback provided by users about a response. + # @!attribute [rw] rating + # @return [::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback::Rating] + # Optional. Rating from user for the specific Dialogflow response. + # @!attribute [rw] rating_reason + # @return [::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback::RatingReason] + # Optional. In case of thumbs down rating provided, users can optionally + # provide context about the rating. + # @!attribute [rw] custom_rating + # @return [::String] + # Optional. Custom rating from the user about the provided answer, with + # maximum length of 1024 characters. For example, client could use a + # customized JSON object to indicate the rating. + class AnswerFeedback + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Stores extra information about why users provided thumbs down rating. + # @!attribute [rw] reason_labels + # @return [::Array<::String>] + # Optional. Custom reason labels for thumbs down rating provided by the + # user. The maximum number of labels allowed is 10 and the maximum length + # of a single label is 128 characters. + # @!attribute [rw] feedback + # @return [::String] + # Optional. Additional feedback about the rating. + # This field can be populated without choosing a predefined `reason`. + class RatingReason + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents thumbs up/down rating provided by user about a response. + module Rating + # Rating not specified. + RATING_UNSPECIFIED = 0 + + # Thumbs up feedback from user. + THUMBS_UP = 1 + + # Thumbs down feedback from user. + THUMBS_DOWN = 2 + end + end + + # The request to set the feedback for a bot answer. + # @!attribute [rw] session + # @return [::String] + # Required. The name of the session the feedback was sent to. + # @!attribute [rw] response_id + # @return [::String] + # Required. ID of the response to update its feedback. This is the same as + # DetectIntentResponse.response_id. + # @!attribute [rw] answer_feedback + # @return [::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback] + # Required. Feedback provided for a bot answer. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. The mask to control which fields to update. If the mask is not + # present, all fields will be updated. + class SubmitAnswerFeedbackRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # 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//locations//agents//sessions/` or + # `projects//locations//agents//environments//sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. + # 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 of the `Session ID` must not exceed 36 characters. + # + # For more information, see the [sessions + # guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + # + # Note: Always use agent versions for production traffic. + # See [Versions and + # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + # @!attribute [rw] query_params + # @return [::Google::Cloud::Dialogflow::CX::V3::QueryParameters] + # The parameters of this query. + # @!attribute [rw] query_input + # @return [::Google::Cloud::Dialogflow::CX::V3::QueryInput] + # Required. The input specification. + # @!attribute [rw] output_audio_config + # @return [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig] + # Instructs the speech synthesizer how to generate the output audio. + # @!attribute [rw] response_view + # @return [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponseView] + # Optional. Specifies which fields in the + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} to return. If not + # set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. + 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] + # Output only. 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::CX::V3::QueryResult] + # The result of the conversational query. + # @!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 + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult#response_messages `query_result.response_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::CX::V3::OutputAudioConfig] + # The config used by the speech synthesizer to generate the output audio. + # @!attribute [rw] response_type + # @return [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse::ResponseType] + # Response type. + # @!attribute [rw] allow_cancellation + # @return [::Boolean] + # Indicates whether the partial response can be cancelled when a later + # response arrives. e.g. if the agent specified some music as partial + # response, it can be cancelled. + class DetectIntentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents different DetectIntentResponse types. + module ResponseType + # Not specified. This should never happen. + RESPONSE_TYPE_UNSPECIFIED = 0 + + # Partial response. e.g. Aggregated responses in a Fulfillment that enables + # `return_partial_response` can be returned as partial response. + # WARNING: partial response is not eligible for barge-in. + PARTIAL = 1 + + # Final response. + FINAL = 2 + end + end + + # The top-level message sent by the client to the + # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#streaming_detect_intent Sessions.StreamingDetectIntent} + # method. + # + # Multiple request messages should be sent in order: + # + # 1. The first message must contain + # {::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest#session session}, + # {::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest#query_input query_input} + # plus optionally + # {::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest#query_params query_params}. + # If the client wants to receive an audio response, it should also contain + # {::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest#output_audio_config output_audio_config}. + # + # 2. If + # {::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest#query_input query_input} + # was set to + # {::Google::Cloud::Dialogflow::CX::V3::AudioInput#config query_input.audio.config}, + # all subsequent messages must contain + # {::Google::Cloud::Dialogflow::CX::V3::AudioInput#audio query_input.audio.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::CX::V3::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] + # The name of the session this query is sent to. + # Format: + # `projects//locations//agents//sessions/` + # or + # `projects//locations//agents//environments//sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. + # 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 of the `Session ID` must not exceed 36 characters. + # Note: session must be set in the first request. + # + # For more information, see the [sessions + # guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + # + # Note: Always use agent versions for production traffic. + # See [Versions and + # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + # @!attribute [rw] query_params + # @return [::Google::Cloud::Dialogflow::CX::V3::QueryParameters] + # The parameters of this query. + # @!attribute [rw] query_input + # @return [::Google::Cloud::Dialogflow::CX::V3::QueryInput] + # Required. The input specification. + # @!attribute [rw] output_audio_config + # @return [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig] + # Instructs the speech synthesizer how to generate the output audio. + # @!attribute [rw] enable_partial_response + # @return [::Boolean] + # Enable partial detect intent response. If this flag is not enabled, + # response stream still contains only one final `DetectIntentResponse` even + # if some `Fulfillment`s in the agent have been configured to return partial + # responses. + # @!attribute [rw] enable_debugging_info + # @return [::Boolean] + # If true, `StreamingDetectIntentResponse.debugging_info` will get populated. + # @!attribute [rw] response_view + # @return [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponseView] + # Optional. Specifies which fields in the + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} to return. If not + # set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. + 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 + # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#streaming_detect_intent StreamingDetectIntent} + # method. + # + # Multiple response messages can be returned in order: + # + # * If the `StreamingDetectIntentRequest.query_input.audio` field was + # set, the first M 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`. + # + # * If the `StreamingDetectIntentRequest.enable_partial_response` field was + # true, the `detect_intent_response` field is populated for each + # of the following N responses, where 0 <= N <= 5. + # These responses set the + # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse#response_type DetectIntentResponse.response_type} + # field to `PARTIAL`. + # + # For the last response message, the `detect_intent_response` is fully + # populated, and + # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse#response_type DetectIntentResponse.response_type} + # is set to `FINAL`. + # @!attribute [rw] recognition_result + # @return [::Google::Cloud::Dialogflow::CX::V3::StreamingRecognitionResult] + # The result of speech recognition. + # + # Note: The following fields are mutually exclusive: `recognition_result`, `detect_intent_response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] detect_intent_response + # @return [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse] + # The response from detect intent. + # + # Note: The following fields are mutually exclusive: `detect_intent_response`, `recognition_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] debugging_info + # @return [::Google::Cloud::Dialogflow::CX::V3::CloudConversationDebuggingInfo] + # Debugging info that would get populated when + # `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 7 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 + # ``` + # + # 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::CX::V3::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] stability + # @return [::Float] + # An estimate of the likelihood that the speech recognizer will + # not change its guess about this interim recognition result: + # * If the value is unspecified or 0.0, Dialogflow didn't compute the + # stability. In particular, Dialogflow will only provide stability for + # `TRANSCRIPT` results with `is_final = false`. + # * Otherwise, the value is in (0.0, 1.0] where 0.0 means completely + # unstable and 1.0 means completely stable. + # @!attribute [rw] speech_word_info + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::SpeechWordInfo>] + # Word-specific information for the words recognized by Speech in + # {::Google::Cloud::Dialogflow::CX::V3::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 speech. 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 + # {::Google::Cloud::Dialogflow::CX::V3::InputAudioConfig#single_utterance `single_utterance`} + # was set to `true`, and is not used otherwise. + END_OF_SINGLE_UTTERANCE = 2 + end + end + + # Represents the parameters of a 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 the agent is + # used. + # @!attribute [rw] geo_location + # @return [::Google::Type::LatLng] + # The geo location of this conversational query. + # @!attribute [rw] session_entity_types + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::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 into the webhook associated with + # the agent. Arbitrary JSON objects are supported. + # 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" + # } + # } + # ``` + # @!attribute [rw] parameters + # @return [::Google::Protobuf::Struct] + # Additional parameters to be put into [session + # parameters][SessionInfo.parameters]. To remove a + # parameter from the session, clients should explicitly set the parameter + # value to null. + # + # You can reference the session parameters in the agent with the following + # format: $session.params.parameter-id. + # + # 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] parameter_scope + # @return [::String] + # Scope for the parameters. If not specified, parameters will be treated as + # session parameters. Parameters with custom scope will not be put into + # {::Google::Cloud::Dialogflow::CX::V3::SessionInfo#parameters session parameters}. + # + # You can reference the parameters with custom scope in the agent with the + # following format: $parameter-scope.params.parameter-id. + # @!attribute [rw] current_page + # @return [::String] + # The unique identifier of the {::Google::Cloud::Dialogflow::CX::V3::Page page} to + # override the [current page][QueryResult.current_page] in the session. + # Format: + # `projects//locations//agents//flows//pages/`. + # + # If `current_page` is specified, the previous state of the session will be + # ignored by Dialogflow, including the [previous + # page][QueryResult.current_page] and the [previous session + # parameters][QueryResult.parameters]. + # In most cases, + # {::Google::Cloud::Dialogflow::CX::V3::QueryParameters#current_page current_page} + # and {::Google::Cloud::Dialogflow::CX::V3::QueryParameters#parameters parameters} + # should be configured together to direct a session to a specific state. + # @!attribute [rw] disable_webhook + # @return [::Boolean] + # Whether to disable webhook calls for this request. + # @!attribute [rw] analyze_query_text_sentiment + # @return [::Boolean] + # Configures whether sentiment analysis should be performed. 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 Dialogflow web console. The headers defined + # within this field will overwrite the headers configured through 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] flow_versions + # @return [::Array<::String>] + # A list of flow versions to override for the request. + # Format: + # `projects//locations//agents//flows//versions/`. + # + # If version 1 of flow X is included in this list, the traffic of + # flow X will go through version 1 regardless of the version configuration in + # the environment. Each flow can have at most one version specified in this + # list. + # @!attribute [rw] current_playbook + # @return [::String] + # Optional. The unique identifier of the + # {::Google::Cloud::Dialogflow::CX::V3::Playbook playbook} to start or continue the + # session with. If `current_playbook` is specified, the previous state of the + # session will be ignored by Dialogflow. + # + # Format: + # `projects//locations//agents//playbooks/`. + # @!attribute [rw] llm_model_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::LlmModelSettings] + # Optional. Use the specified LLM model settings for processing the request. + # @!attribute [rw] channel + # @return [::String] + # The channel which this query is for. + # + # If specified, only the + # {::Google::Cloud::Dialogflow::CX::V3::ResponseMessage ResponseMessage} associated + # with the channel will be returned. If no + # {::Google::Cloud::Dialogflow::CX::V3::ResponseMessage ResponseMessage} is + # associated with the channel, it falls back to the + # {::Google::Cloud::Dialogflow::CX::V3::ResponseMessage ResponseMessage} with + # unspecified channel. + # + # If unspecified, the + # {::Google::Cloud::Dialogflow::CX::V3::ResponseMessage ResponseMessage} with + # unspecified channel will be returned. + # @!attribute [rw] session_ttl + # @return [::Google::Protobuf::Duration] + # Optional. Configure lifetime of the Dialogflow session. + # By default, a Dialogflow 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. + # @!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::CX::V3::SearchConfig] + # Optional. Search configuration for UCS search queries. + # @!attribute [rw] populate_data_store_connection_signals + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Optional. If set to true and data stores are involved in serving the + # request then + # DetectIntentResponse.query_result.data_store_connection_signals + # will be filled with data that can help evaluations. + 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 + + # Search configuration for UCS search queries. + # @!attribute [rw] boost_specs + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::BoostSpecs>] + # Optional. Boosting configuration for the datastores. + # + # 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::CX::V3::FilterSpecs>] + # Optional. Filter configuration for the datastores. + # + # Maps 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 + end + + # 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::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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 + + # 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::CX::V3::BoostSpec>] + # Optional. A list of boosting specifications. + class BoostSpecs + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Filter 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] 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 + + # Represents the query input. It can contain one of: + # + # 1. A conversational query in the form of text. + # + # 2. An intent query that specifies which intent to trigger. + # + # 3. Natural language speech audio to be processed. + # + # 4. An event to be triggered. + # + # 5. DTMF digits to invoke an intent and fill in parameter value. + # + # 6. The results of a tool executed by the client. + # @!attribute [rw] text + # @return [::Google::Cloud::Dialogflow::CX::V3::TextInput] + # The natural language text to be processed. + # + # Note: The following fields are mutually exclusive: `text`, `intent`, `audio`, `event`, `dtmf`, `tool_call_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] intent + # @return [::Google::Cloud::Dialogflow::CX::V3::IntentInput] + # The intent to be triggered. + # + # Note: The following fields are mutually exclusive: `intent`, `text`, `audio`, `event`, `dtmf`, `tool_call_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] audio + # @return [::Google::Cloud::Dialogflow::CX::V3::AudioInput] + # The natural language speech audio to be processed. + # + # Note: The following fields are mutually exclusive: `audio`, `text`, `intent`, `event`, `dtmf`, `tool_call_result`. 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::CX::V3::EventInput] + # The event to be triggered. + # + # Note: The following fields are mutually exclusive: `event`, `text`, `intent`, `audio`, `dtmf`, `tool_call_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] dtmf + # @return [::Google::Cloud::Dialogflow::CX::V3::DtmfInput] + # The DTMF event to be handled. + # + # Note: The following fields are mutually exclusive: `dtmf`, `text`, `intent`, `audio`, `event`, `tool_call_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] tool_call_result + # @return [::Google::Cloud::Dialogflow::CX::V3::ToolCallResult] + # The results of a tool executed by the client. + # + # Note: The following fields are mutually exclusive: `tool_call_result`, `text`, `intent`, `audio`, `event`, `dtmf`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] language_code + # @return [::String] + # Required. The language of the input. See [Language + # Support](https://cloud.google.com/dialogflow/cx/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 QueryInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the result of a conversational query. + # @!attribute [rw] text + # @return [::String] + # If {::Google::Cloud::Dialogflow::CX::V3::TextInput natural language text} was + # provided as input, this field will contain a copy of the text. + # + # Note: The following fields are mutually exclusive: `text`, `trigger_intent`, `transcript`, `trigger_event`, `dtmf`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] trigger_intent + # @return [::String] + # If an {::Google::Cloud::Dialogflow::CX::V3::IntentInput intent} was provided as + # input, this field will contain a copy of the intent identifier. Format: + # `projects//locations//agents//intents/`. + # + # Note: The following fields are mutually exclusive: `trigger_intent`, `text`, `transcript`, `trigger_event`, `dtmf`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] transcript + # @return [::String] + # If [natural language speech + # audio][google.cloud.dialogflow.cx.v3.AudioInput] was provided as input, + # this field will contain the transcript for the audio. + # + # Note: The following fields are mutually exclusive: `transcript`, `text`, `trigger_intent`, `trigger_event`, `dtmf`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] trigger_event + # @return [::String] + # If an {::Google::Cloud::Dialogflow::CX::V3::EventInput event} was provided as + # input, this field will contain the name of the event. + # + # Note: The following fields are mutually exclusive: `trigger_event`, `text`, `trigger_intent`, `transcript`, `dtmf`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] dtmf + # @return [::Google::Cloud::Dialogflow::CX::V3::DtmfInput] + # If a {::Google::Cloud::Dialogflow::CX::V3::DtmfInput DTMF} was provided as + # input, this field will contain a copy of the + # {::Google::Cloud::Dialogflow::CX::V3::DtmfInput DtmfInput}. + # + # Note: The following fields are mutually exclusive: `dtmf`, `text`, `trigger_intent`, `transcript`, `trigger_event`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] language_code + # @return [::String] + # The language that was triggered during intent detection. + # See [Language + # Support](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # for a list of the currently supported language codes. + # @!attribute [rw] parameters + # @return [::Google::Protobuf::Struct] + # The collected [session + # parameters][google.cloud.dialogflow.cx.v3.SessionInfo.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] response_messages + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ResponseMessage>] + # The list of rich messages returned to the client. Responses vary from + # simple text messages to more sophisticated, structured payloads used + # to drive complex logic. + # @!attribute [rw] webhook_statuses + # @return [::Array<::Google::Rpc::Status>] + # The list of webhook call status in the order of call sequence. + # @!attribute [rw] webhook_payloads + # @return [::Array<::Google::Protobuf::Struct>] + # The list of webhook payload in + # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse#payload WebhookResponse.payload}, + # in the order of call sequence. If some webhook call fails or doesn't return + # any payload, an empty `Struct` would be used instead. + # @!attribute [rw] current_page + # @return [::Google::Cloud::Dialogflow::CX::V3::Page] + # The current {::Google::Cloud::Dialogflow::CX::V3::Page Page}. Some, not all + # fields are filled in this message, including but not limited to `name` and + # `display_name`. + # @!attribute [rw] current_flow + # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] + # The current {::Google::Cloud::Dialogflow::CX::V3::Flow Flow}. Some, not all + # fields are filled in this message, including but not limited to `name` and + # `display_name`. + # @!attribute [rw] intent + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] + # The {::Google::Cloud::Dialogflow::CX::V3::Intent Intent} that matched the + # conversational query. Some, not all fields are filled in this message, + # including but not limited to: `name` and `display_name`. This field is + # deprecated, please use + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult#match QueryResult.match} + # instead. + # @!attribute [rw] intent_detection_confidence + # @deprecated This field is deprecated and may be removed in the next major version update. + # @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. + # This field is deprecated, please use + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult#match QueryResult.match} + # instead. + # @!attribute [rw] match + # @return [::Google::Cloud::Dialogflow::CX::V3::Match] + # Intent match result, could be an intent or an event. + # @!attribute [rw] diagnostic_info + # @return [::Google::Protobuf::Struct] + # The free-form diagnostic info. For example, this field could contain + # webhook call latency. The fields of this data can change without notice, + # so you should not write code that depends on its structure. + # + # One of the fields is called "Alternative Matched Intents", which may + # aid with debugging. The following describes these intent results: + # + # - The list is empty if no intent was matched to end-user input. + # - Only intents that are referenced in the currently active flow are + # included. + # - The matched intent is included. + # - Other intents that could have matched end-user input, but did not match + # because they are referenced by intent routes that are out of + # [scope](https://cloud.google.com/dialogflow/cx/docs/concept/handler#scope), + # are included. + # - Other intents referenced by intent routes in scope that matched end-user + # input, but had a lower confidence score. + # @!attribute [rw] sentiment_analysis_result + # @return [::Google::Cloud::Dialogflow::CX::V3::SentimentAnalysisResult] + # The sentiment analyss result, which depends on + # [`analyze_query_text_sentiment`] + # [google.cloud.dialogflow.cx.v3.QueryParameters.analyze_query_text_sentiment], + # specified in the request. + # @!attribute [rw] advanced_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::AdvancedSettings] + # Returns the current advanced settings including IVR settings. Even though + # the operations configured by these settings are performed by Dialogflow, + # the client may need to perform special logic at the moment. For example, if + # Dialogflow exports audio to Google Cloud Storage, then the client may need + # to wait for the resulting object to appear in the bucket before proceeding. + # @!attribute [rw] allow_answer_feedback + # @return [::Boolean] + # Indicates whether the Thumbs up/Thumbs down rating controls are need to be + # shown for the response in the Dialogflow Messenger widget. + # @!attribute [rw] data_store_connection_signals + # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals] + # Optional. Data store connection feature output signals. + # Filled only when data stores are involved in serving the query. + class QueryResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the natural language text to be processed. + # @!attribute [rw] text + # @return [::String] + # Required. The UTF-8 encoded natural language text to be processed. + class TextInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the intent to trigger programmatically rather than as a result of + # natural language processing. + # @!attribute [rw] intent + # @return [::String] + # Required. The unique identifier of the intent. + # Format: + # `projects//locations//agents//intents/`. + class IntentInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the natural speech audio to be processed. + # @!attribute [rw] config + # @return [::Google::Cloud::Dialogflow::CX::V3::InputAudioConfig] + # Required. Instructs the speech recognizer how to process the speech audio. + # @!attribute [rw] audio + # @return [::String] + # The natural language speech audio to be processed. + # A single request can contain up to 2 minutes of speech audio data. + # The [transcribed + # text][google.cloud.dialogflow.cx.v3.QueryResult.transcript] cannot contain + # more than 256 bytes. + # + # For non-streaming audio detect intent, both `config` and `audio` must be + # provided. + # For streaming audio detect intent, `config` must be provided in + # the first request and `audio` must be provided in all following requests. + class AudioInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the event to trigger. + # @!attribute [rw] event + # @return [::String] + # Name of the event. + class EventInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the input for dtmf event. + # @!attribute [rw] digits + # @return [::String] + # The dtmf digits. + # @!attribute [rw] finish_digit + # @return [::String] + # The finish digit (if any). + class DtmfInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents one match result of [MatchIntent][]. + # @!attribute [rw] intent + # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] + # The {::Google::Cloud::Dialogflow::CX::V3::Intent Intent} that matched the query. + # Some, not all fields are filled in this message, including but not limited + # to: `name` and `display_name`. Only filled for + # {::Google::Cloud::Dialogflow::CX::V3::Match::MatchType `INTENT`} match type. + # @!attribute [rw] event + # @return [::String] + # The event that matched the query. Filled for + # {::Google::Cloud::Dialogflow::CX::V3::Match::MatchType `EVENT`}, + # {::Google::Cloud::Dialogflow::CX::V3::Match::MatchType `NO_MATCH`} and + # {::Google::Cloud::Dialogflow::CX::V3::Match::MatchType `NO_INPUT`} match types. + # @!attribute [rw] parameters + # @return [::Google::Protobuf::Struct] + # The collection of parameters extracted from the query. + # + # 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] resolved_input + # @return [::String] + # Final text input which was matched during MatchIntent. This value can be + # different from original input sent in request because of spelling + # correction or other processing. + # @!attribute [rw] match_type + # @return [::Google::Cloud::Dialogflow::CX::V3::Match::MatchType] + # Type of this {::Google::Cloud::Dialogflow::CX::V3::Match Match}. + # @!attribute [rw] confidence + # @return [::Float] + # The confidence of this match. 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. + class Match + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type of a Match. + module MatchType + # Not specified. Should never be used. + MATCH_TYPE_UNSPECIFIED = 0 + + # The query was matched to an intent. + INTENT = 1 + + # The query directly triggered an intent. + DIRECT_INTENT = 2 + + # The query was used for parameter filling. + PARAMETER_FILLING = 3 + + # No match was found for the query. + NO_MATCH = 4 + + # Indicates an empty query. + NO_INPUT = 5 + + # The query directly triggered an event. + EVENT = 6 + + # The query was matched to a Knowledge Connector answer. + KNOWLEDGE_CONNECTOR = 8 + + # The query was handled by a + # {::Google::Cloud::Dialogflow::CX::V3::Playbook `Playbook`}. + PLAYBOOK = 9 + end + end + + # Request of [MatchIntent][]. + # @!attribute [rw] session + # @return [::String] + # Required. The name of the session this query is sent to. + # Format: + # `projects//locations//agents//sessions/` + # or + # `projects//locations//agents//environments//sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. + # 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 of the `Session ID` must not exceed 36 characters. + # + # For more information, see the [sessions + # guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + # @!attribute [rw] query_params + # @return [::Google::Cloud::Dialogflow::CX::V3::QueryParameters] + # The parameters of this query. + # @!attribute [rw] query_input + # @return [::Google::Cloud::Dialogflow::CX::V3::QueryInput] + # Required. The input specification. + # @!attribute [rw] persist_parameter_changes + # @return [::Boolean] + # Persist session parameter changes from `query_params`. + class MatchIntentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of [MatchIntent][]. + # @!attribute [rw] text + # @return [::String] + # If {::Google::Cloud::Dialogflow::CX::V3::TextInput natural language text} was + # provided as input, this field will contain a copy of the text. + # + # Note: The following fields are mutually exclusive: `text`, `trigger_intent`, `transcript`, `trigger_event`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] trigger_intent + # @return [::String] + # If an {::Google::Cloud::Dialogflow::CX::V3::IntentInput intent} was provided as + # input, this field will contain a copy of the intent identifier. Format: + # `projects//locations//agents//intents/`. + # + # Note: The following fields are mutually exclusive: `trigger_intent`, `text`, `transcript`, `trigger_event`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] transcript + # @return [::String] + # If [natural language speech + # audio][google.cloud.dialogflow.cx.v3.AudioInput] was provided as input, + # this field will contain the transcript for the audio. + # + # Note: The following fields are mutually exclusive: `transcript`, `text`, `trigger_intent`, `trigger_event`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] trigger_event + # @return [::String] + # If an {::Google::Cloud::Dialogflow::CX::V3::EventInput event} was provided as + # input, this field will contain a copy of the event name. + # + # Note: The following fields are mutually exclusive: `trigger_event`, `text`, `trigger_intent`, `transcript`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] matches + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Match>] + # Match results, if more than one, ordered descendingly by the confidence + # we have that the particular intent matches the query. + # @!attribute [rw] current_page + # @return [::Google::Cloud::Dialogflow::CX::V3::Page] + # The current {::Google::Cloud::Dialogflow::CX::V3::Page Page}. Some, not all + # fields are filled in this message, including but not limited to `name` and + # `display_name`. + class MatchIntentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request of [FulfillIntent][] + # @!attribute [rw] match_intent_request + # @return [::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest] + # Must be same as the corresponding MatchIntent request, otherwise the + # behavior is undefined. + # @!attribute [rw] match + # @return [::Google::Cloud::Dialogflow::CX::V3::Match] + # The matched intent/event to fulfill. + # @!attribute [rw] output_audio_config + # @return [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig] + # Instructs the speech synthesizer how to generate output audio. + class FulfillIntentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of [FulfillIntent][] + # @!attribute [rw] response_id + # @return [::String] + # Output only. 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::CX::V3::QueryResult] + # The result of the conversational query. + # @!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 + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult#response_messages `query_result.response_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::CX::V3::OutputAudioConfig] + # The config used by the speech synthesizer to generate the output audio. + class FulfillIntentResponse + 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. + # @!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 SentimentAnalysisResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response view specifies which fields in the + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} to return. + module DetectIntentResponseView + # Not specified. `DETECT_INTENT_RESPONSE_VIEW_DEFAULT` will be used. + DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED = 0 + + # Full response view includes all fields. + DETECT_INTENT_RESPONSE_VIEW_FULL = 1 + + # Basic response view omits the following fields: + # - + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult#diagnostic_info QueryResult.diagnostic_info} + DETECT_INTENT_RESPONSE_VIEW_BASIC = 2 + + # Default response view omits the following fields: + # - + # [QueryResult.trace_blocks][google.cloud.dialogflow.cx.v3.QueryResult.trace_blocks] + DETECT_INTENT_RESPONSE_VIEW_DEFAULT = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/session_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/session_entity_type.rb new file mode 100644 index 000000000000..0c36904bb5b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/session_entity_type.rb @@ -0,0 +1,193 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # Session entity types are referred to as **User** entity types and are + # entities that are built for an individual user such as favorites, + # preferences, playlists, and so on. + # + # You can redefine a session entity type at the session level to extend or + # replace a {::Google::Cloud::Dialogflow::CX::V3::EntityType custom entity type} at + # the user session level (we refer to the entity types defined at the agent + # level as "custom entity types"). + # + # Note: session entity types apply to all queries, regardless of the language. + # + # For more information about entity types, see the [Dialogflow + # documentation](https://cloud.google.com/dialogflow/docs/entities-overview). + # @!attribute [rw] name + # @return [::String] + # Required. The unique identifier of the session entity type. + # Format: + # `projects//locations//agents//sessions//entityTypes/` + # or + # `projects//locations//agents//environments//sessions//entityTypes/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. + # @!attribute [rw] entity_override_mode + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityType::Entity>] + # Required. The collection of entities to override or supplement the custom + # entity type. + class SessionEntityType + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The types of modifications for the 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::CX::V3::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::CX::V3::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//locations//agents//sessions/` + # or + # `projects//locations//agents//environments//sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. + # @!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 ListSessionEntityTypesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client#list_session_entity_types SessionEntityTypes.ListSessionEntityTypes}. + # @!attribute [rw] session_entity_types + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityTypes::Client#get_session_entity_type SessionEntityTypes.GetSessionEntityType}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the session entity type. + # Format: + # `projects//locations//agents//sessions//entityTypes/` + # or + # `projects//locations//agents//environments//sessions//entityTypes/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. + class GetSessionEntityTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::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//locations//agents//sessions/` + # or + # `projects//locations//agents//environments//sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. + # @!attribute [rw] session_entity_type + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityTypes::Client#update_session_entity_type SessionEntityTypes.UpdateSessionEntityType}. + # @!attribute [rw] session_entity_type + # @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] + # Required. The session entity type to update. + # Format: + # `projects//locations//agents//sessions//entityTypes/` + # or + # `projects//locations//agents//environments//sessions//entityTypes/`. + # If `Environment ID` is not specified, + # we assume default 'draft' environment. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # 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::CX::V3::SessionEntityTypes::Client#delete_session_entity_type SessionEntityTypes.DeleteSessionEntityType}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the session entity type to delete. + # Format: + # `projects//locations//agents//sessions//entityTypes/` + # or + # `projects//locations//agents//environments//sessions//entityTypes/`. + # If `Environment ID` is not specified, + # we assume default 'draft' environment. + class DeleteSessionEntityTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/test_case.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/test_case.rb new file mode 100644 index 000000000000..474fed46f6a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/test_case.rb @@ -0,0 +1,835 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # Represents a test case. + # @!attribute [rw] name + # @return [::String] + # The unique identifier of the test case. + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#create_test_case TestCases.CreateTestCase} + # will populate the name automatically. Otherwise use format: + # `projects//locations//agents//testCases/`. + # @!attribute [rw] tags + # @return [::Array<::String>] + # Tags are short descriptions that users may apply to test cases for + # organizational and filtering purposes. Each tag should start with "#" and + # has a limit of 30 characters. + # @!attribute [rw] display_name + # @return [::String] + # Required. The human-readable name of the test case, unique within the + # agent. Limit of 200 characters. + # @!attribute [rw] notes + # @return [::String] + # Additional freeform notes about the test case. Limit of 400 characters. + # @!attribute [rw] test_config + # @return [::Google::Cloud::Dialogflow::CX::V3::TestConfig] + # Config for the test case. + # @!attribute [rw] test_case_conversation_turns + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ConversationTurn>] + # The conversation turns uttered when the test case was created, in + # chronological order. These include the canonical set of agent utterances + # that should occur when the agent is working properly. + # @!attribute [r] creation_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the test was created. + # @!attribute [rw] last_test_result + # @return [::Google::Cloud::Dialogflow::CX::V3::TestCaseResult] + # The latest test result. + class TestCase + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a result from running a test case in an agent environment. + # @!attribute [rw] name + # @return [::String] + # The resource name for the test case result. Format: + # `projects//locations//agents//testCases//results/`. + # @!attribute [rw] environment + # @return [::String] + # Environment where the test was run. If not set, it indicates the draft + # environment. + # @!attribute [rw] conversation_turns + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ConversationTurn>] + # The conversation turns uttered during the test case replay in chronological + # order. + # @!attribute [rw] test_result + # @return [::Google::Cloud::Dialogflow::CX::V3::TestResult] + # Whether the test case passed in the agent environment. + # @!attribute [rw] test_time + # @return [::Google::Protobuf::Timestamp] + # The time that the test was run. + class TestCaseResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents configurations for a test case. + # @!attribute [rw] tracking_parameters + # @return [::Array<::String>] + # Session parameters to be compared when calculating differences. + # @!attribute [rw] flow + # @return [::String] + # Flow name to start the test case with. + # Format: + # `projects//locations//agents//flows/`. + # + # Only one of `flow` and `page` should be set to indicate the starting point + # of the test case. If neither is set, the test case will start with start + # page on the default start flow. + # @!attribute [rw] page + # @return [::String] + # The {::Google::Cloud::Dialogflow::CX::V3::Page page} to start the test case with. + # Format: + # `projects//locations//agents//flows//pages/`. + # + # Only one of `flow` and `page` should be set to indicate the starting point + # of the test case. If neither is set, the test case will start with start + # page on the default start flow. + class TestConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One interaction between a human and virtual agent. The human provides some + # input and the virtual agent provides a response. + # @!attribute [rw] user_input + # @return [::Google::Cloud::Dialogflow::CX::V3::ConversationTurn::UserInput] + # The user input. + # @!attribute [rw] virtual_agent_output + # @return [::Google::Cloud::Dialogflow::CX::V3::ConversationTurn::VirtualAgentOutput] + # The virtual agent output. + class ConversationTurn + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The input from the human user. + # @!attribute [rw] input + # @return [::Google::Cloud::Dialogflow::CX::V3::QueryInput] + # Supports {::Google::Cloud::Dialogflow::CX::V3::QueryInput#text text input}, + # {::Google::Cloud::Dialogflow::CX::V3::QueryInput#event event input}, [dtmf + # input][google.cloud.dialogflow.cx.v3.QueryInput.dtmf] in the test case. + # @!attribute [rw] injected_parameters + # @return [::Google::Protobuf::Struct] + # Parameters that need to be injected into the conversation during intent + # detection. + # @!attribute [rw] is_webhook_enabled + # @return [::Boolean] + # If webhooks should be allowed to trigger in response to the user + # utterance. Often if parameters are injected, webhooks should not be + # enabled. + # @!attribute [rw] enable_sentiment_analysis + # @return [::Boolean] + # Whether sentiment analysis is enabled. + class UserInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The output from the virtual agent. + # @!attribute [rw] session_parameters + # @return [::Google::Protobuf::Struct] + # The session parameters available to the bot at this point. + # @!attribute [r] differences + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TestRunDifference>] + # Output only. If this is part of a [result conversation + # turn][TestCaseResult.conversation_turns], the list of differences + # between the original run and the replay for this output, if any. + # @!attribute [rw] diagnostic_info + # @return [::Google::Protobuf::Struct] + # Required. Input only. The diagnostic + # [info][Session.DetectIntentResponse.QueryResult.diagnostic_info] + # output for the turn. Required to calculate the testing coverage. + # @!attribute [rw] triggered_intent + # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] + # The {::Google::Cloud::Dialogflow::CX::V3::Intent Intent} that triggered the + # response. Only name and displayName will be set. + # @!attribute [rw] current_page + # @return [::Google::Cloud::Dialogflow::CX::V3::Page] + # The {::Google::Cloud::Dialogflow::CX::V3::Page Page} on which the utterance was + # spoken. Only name and displayName will be set. + # @!attribute [rw] text_responses + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::Text>] + # The {::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::Text text} responses + # from the agent for the turn. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # Response error from the agent in the test result. If set, other output + # is empty. + class VirtualAgentOutput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The description of differences between original and replayed agent output. + # @!attribute [rw] type + # @return [::Google::Cloud::Dialogflow::CX::V3::TestRunDifference::DiffType] + # The type of diff. + # @!attribute [rw] description + # @return [::String] + # A human readable description of the diff, showing the actual output vs + # expected output. + class TestRunDifference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # What part of the message replay differs from the test case. + module DiffType + # Should never be used. + DIFF_TYPE_UNSPECIFIED = 0 + + # The intent. + INTENT = 1 + + # The page. + PAGE = 2 + + # The parameters. + PARAMETERS = 3 + + # The message utterance. + UTTERANCE = 4 + + # The flow. + FLOW = 5 + end + end + + # Transition coverage represents the percentage of all possible page + # transitions (page-level transition routes and event handlers, excluding + # transition route groups) present within any of a parent's test cases. + # @!attribute [rw] transitions + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TransitionCoverage::Transition>] + # The list of Transitions present in the agent. + # @!attribute [rw] coverage_score + # @return [::Float] + # The percent of transitions in the agent that are covered. + class TransitionCoverage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The source or target of a transition. + # @!attribute [rw] page + # @return [::Google::Cloud::Dialogflow::CX::V3::Page] + # Indicates a transition to a {::Google::Cloud::Dialogflow::CX::V3::Page Page}. + # Only some fields such as name and displayname will be set. + # + # Note: The following fields are mutually exclusive: `page`, `flow`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] flow + # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] + # Indicates a transition to a {::Google::Cloud::Dialogflow::CX::V3::Flow Flow}. + # Only some fields such as name and displayname will be set. + # + # Note: The following fields are mutually exclusive: `flow`, `page`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class TransitionNode + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A transition in a page. + # @!attribute [rw] source + # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionCoverage::TransitionNode] + # The start node of a transition. + # @!attribute [rw] index + # @return [::Integer] + # The index of a transition in the transition list. Starting from 0. + # @!attribute [rw] target + # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionCoverage::TransitionNode] + # The end node of a transition. + # @!attribute [rw] covered + # @return [::Boolean] + # Whether the transition is covered by at least one of the + # agent's test cases. + # @!attribute [rw] transition_route + # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRoute] + # Intent route or condition route. + # + # Note: The following fields are mutually exclusive: `transition_route`, `event_handler`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] event_handler + # @return [::Google::Cloud::Dialogflow::CX::V3::EventHandler] + # Event handler. + # + # Note: The following fields are mutually exclusive: `event_handler`, `transition_route`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Transition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Transition route group coverage represents the percentage of all possible + # transition routes present within any of a parent's test cases. The results + # are grouped by the transition route group. + # @!attribute [rw] coverages + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroupCoverage::Coverage>] + # Transition route group coverages. + # @!attribute [rw] coverage_score + # @return [::Float] + # The percent of transition routes in all the transition route groups that + # are covered. + class TransitionRouteGroupCoverage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Coverage result message for one transition route group. + # @!attribute [rw] route_group + # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] + # Transition route group metadata. Only name and displayName will be set. + # @!attribute [rw] transitions + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroupCoverage::Coverage::Transition>] + # The list of transition routes and coverage in the transition route group. + # @!attribute [rw] coverage_score + # @return [::Float] + # The percent of transition routes in the transition route group that are + # covered. + class Coverage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A transition coverage in a transition route group. + # @!attribute [rw] transition_route + # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRoute] + # Intent route or condition route. + # @!attribute [rw] covered + # @return [::Boolean] + # Whether the transition route is covered by at least one of the + # agent's test cases. + class Transition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Intent coverage represents the percentage of all possible intents in the + # agent that are triggered in any of a parent's test cases. + # @!attribute [rw] intents + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::IntentCoverage::Intent>] + # The list of Intents present in the agent + # @!attribute [rw] coverage_score + # @return [::Float] + # The percent of intents in the agent that are covered. + class IntentCoverage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The agent's intent. + # @!attribute [rw] intent + # @return [::String] + # The intent full resource name + # @!attribute [rw] covered + # @return [::Boolean] + # Whether the intent is covered by at least one of the agent's + # test cases. + class Intent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#calculate_coverage TestCases.CalculateCoverage}. + # @!attribute [rw] agent + # @return [::String] + # Required. The agent to calculate coverage for. + # Format: `projects//locations//agents/`. + # @!attribute [rw] type + # @return [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest::CoverageType] + # Required. The type of coverage requested. + class CalculateCoverageRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of coverage score requested. + module CoverageType + # Should never be used. + COVERAGE_TYPE_UNSPECIFIED = 0 + + # Intent coverage. + INTENT = 1 + + # Page transition coverage. + PAGE_TRANSITION = 2 + + # Transition route group coverage. + TRANSITION_ROUTE_GROUP = 3 + end + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#calculate_coverage TestCases.CalculateCoverage}. + # @!attribute [rw] agent + # @return [::String] + # The agent to calculate coverage for. + # Format: `projects//locations//agents/`. + # @!attribute [rw] intent_coverage + # @return [::Google::Cloud::Dialogflow::CX::V3::IntentCoverage] + # Intent coverage. + # + # Note: The following fields are mutually exclusive: `intent_coverage`, `transition_coverage`, `route_group_coverage`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] transition_coverage + # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionCoverage] + # Transition (excluding transition route groups) coverage. + # + # Note: The following fields are mutually exclusive: `transition_coverage`, `intent_coverage`, `route_group_coverage`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] route_group_coverage + # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroupCoverage] + # Transition route group coverage. + # + # Note: The following fields are mutually exclusive: `route_group_coverage`, `intent_coverage`, `transition_coverage`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class CalculateCoverageResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_cases TestCases.ListTestCases}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to list all pages for. + # Format: `projects//locations//agents/`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return in a single page. By default 20. + # Note that when TestCaseView = FULL, the maximum page size allowed is 20. + # When TestCaseView = BASIC, the maximum page size allowed is 500. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token value returned from a previous list request. + # @!attribute [rw] view + # @return [::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest::TestCaseView] + # Specifies whether response should include all fields or just the metadata. + class ListTestCasesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specifies how much test case information to include in the response. + module TestCaseView + # The default / unset value. + # The API will default to the BASIC view. + TEST_CASE_VIEW_UNSPECIFIED = 0 + + # Include basic metadata about the test case, but not the conversation + # turns. This is the default value. + BASIC = 1 + + # Include everything. + FULL = 2 + end + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_cases TestCases.ListTestCases}. + # @!attribute [rw] test_cases + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TestCase>] + # The list of test cases. 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 ListTestCasesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_delete_test_cases TestCases.BatchDeleteTestCases}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to delete test cases from. + # Format: `projects//locations//agents/`. + # @!attribute [rw] names + # @return [::Array<::String>] + # Required. Format of test case names: + # `projects//locations//agents//testCases/`. + class BatchDeleteTestCasesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#create_test_case TestCases.CreateTestCase}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to create the test case for. + # Format: `projects//locations//agents/`. + # @!attribute [rw] test_case + # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] + # Required. The test case to create. + class CreateTestCaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#update_test_case TestCases.UpdateTestCase}. + # @!attribute [rw] test_case + # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] + # Required. The test case to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The mask to specify which fields should be updated. The + # {::Google::Cloud::Dialogflow::CX::V3::TestCase#creation_time `creationTime`} and + # {::Google::Cloud::Dialogflow::CX::V3::TestCase#last_test_result `lastTestResult`} + # cannot be updated. + class UpdateTestCaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#get_test_case TestCases.GetTestCase}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the testcase. + # Format: + # `projects//locations//agents//testCases/`. + class GetTestCaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#run_test_case TestCases.RunTestCase}. + # @!attribute [rw] name + # @return [::String] + # Required. Format of test case name to run: + # `projects//locations//agents//testCases/`. + # @!attribute [rw] environment + # @return [::String] + # Optional. Environment name. If not set, draft environment is assumed. + # Format: + # `projects//locations//agents//environments/`. + class RunTestCaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#run_test_case TestCases.RunTestCase}. + # @!attribute [rw] result + # @return [::Google::Cloud::Dialogflow::CX::V3::TestCaseResult] + # The result. + class RunTestCaseResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata returned for the + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#run_test_case TestCases.RunTestCase} + # long running operation. This message currently has no fields. + class RunTestCaseMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_run_test_cases TestCases.BatchRunTestCases}. + # @!attribute [rw] parent + # @return [::String] + # Required. Agent name. Format: + # `projects//locations//agents/`. + # @!attribute [rw] environment + # @return [::String] + # Optional. If not set, draft environment is assumed. Format: + # `projects//locations//agents//environments/`. + # @!attribute [rw] test_cases + # @return [::Array<::String>] + # Required. Format: + # `projects//locations//agents//testCases/`. + class BatchRunTestCasesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_run_test_cases TestCases.BatchRunTestCases}. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>] + # The test case results. The detailed + # [conversation + # turns][google.cloud.dialogflow.cx.v3.TestCaseResult.conversation_turns] are + # empty in this response. + class BatchRunTestCasesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata returned for the + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_run_test_cases TestCases.BatchRunTestCases} + # long running operation. + # @!attribute [rw] errors + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TestError>] + # The test errors. + class BatchRunTestCasesMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Error info for running a test. + # @!attribute [rw] test_case + # @return [::String] + # The test case resource name. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # The status associated with the test. + # @!attribute [rw] test_time + # @return [::Google::Protobuf::Timestamp] + # The timestamp when the test was completed. + class TestError + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#import_test_cases TestCases.ImportTestCases}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to import test cases to. + # Format: `projects//locations//agents/`. + # @!attribute [rw] gcs_uri + # @return [::String] + # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + # to import test cases from. The format of this URI must be + # `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: `gcs_uri`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] content + # @return [::String] + # Uncompressed raw byte content for test cases. + # + # Note: The following fields are mutually exclusive: `content`, `gcs_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ImportTestCasesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#import_test_cases TestCases.ImportTestCases}. + # @!attribute [rw] names + # @return [::Array<::String>] + # The unique identifiers of the new test cases. + # Format: + # `projects//locations//agents//testCases/`. + class ImportTestCasesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata returned for the + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#import_test_cases TestCases.ImportTestCases} + # long running operation. + # @!attribute [rw] errors + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TestCaseError>] + # Errors for failed test cases. + class ImportTestCasesMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Error info for importing a test. + # @!attribute [rw] test_case + # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] + # The test case. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # The status associated with the test case. + class TestCaseError + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#export_test_cases TestCases.ExportTestCases}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent where to export test cases from. + # Format: `projects//locations//agents/`. + # @!attribute [rw] gcs_uri + # @return [::String] + # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to + # export the test cases to. The format of this URI must be + # `gs:///`. If unspecified, the serialized test + # cases 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). + # @!attribute [rw] data_format + # @return [::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest::DataFormat] + # The data format of the exported test cases. If not specified, `BLOB` is + # assumed. + # @!attribute [rw] filter + # @return [::String] + # The filter expression used to filter exported test cases, see + # [API Filtering](https://aip.dev/160). The expression is case insensitive + # and supports the following syntax: + # + # name = [OR name = ] ... + # + # For example: + # + # * "name = t1 OR name = t2" matches the test case with the exact resource + # name "t1" or "t2". + class ExportTestCasesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Data format of the exported test cases. + module DataFormat + # Unspecified format. + DATA_FORMAT_UNSPECIFIED = 0 + + # Raw bytes. + BLOB = 1 + + # JSON format. + JSON = 2 + end + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#export_test_cases TestCases.ExportTestCases}. + # @!attribute [rw] gcs_uri + # @return [::String] + # The URI to a file containing the exported test cases. This field is + # populated only if `gcs_uri` is specified in + # {::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest ExportTestCasesRequest}. + # + # Note: The following fields are mutually exclusive: `gcs_uri`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] content + # @return [::String] + # Uncompressed raw byte content for test cases. + # + # Note: The following fields are mutually exclusive: `content`, `gcs_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ExportTestCasesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata returned for the + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#export_test_cases TestCases.ExportTestCases} + # long running operation. This message currently has no fields. + class ExportTestCasesMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_case_results TestCases.ListTestCaseResults}. + # @!attribute [rw] parent + # @return [::String] + # Required. The test case to list results for. + # Format: + # `projects//locations//agents//testCases/`. + # Specify a `-` as a wildcard for TestCase ID to + # list results across multiple test cases. + # @!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. + # @!attribute [rw] filter + # @return [::String] + # The filter expression used to filter test case results. See + # [API Filtering](https://aip.dev/160). + # + # The expression is case insensitive. Only 'AND' is supported for logical + # operators. The supported syntax is listed below in detail: + # + # [AND ] ... + # [AND latest] + # + # The supported fields and operators are: + # field operator + # `environment` `=`, `IN` (Use value `draft` for draft environment) + # `test_time` `>`, `<` + # + # `latest` only returns the latest test result in all results for each test + # case. + # + # Examples: + # * "environment=draft AND latest" matches the latest test result for each + # test case in the draft environment. + # * "environment IN (e1,e2)" matches any test case results with an + # environment resource name of either "e1" or "e2". + # * "test_time > 1602540713" matches any test case results with test time + # later than a unix timestamp in seconds 1602540713. + class ListTestCaseResultsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_case_results TestCases.ListTestCaseResults}. + # @!attribute [rw] test_case_results + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>] + # The list of test case results. + # @!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 ListTestCaseResultsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#get_test_case_result TestCases.GetTestCaseResult}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the testcase. + # Format: + # `projects//locations//agents//testCases//results/`. + class GetTestCaseResultRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The test result for a test case and an agent environment. + module TestResult + # Not specified. Should never be used. + TEST_RESULT_UNSPECIFIED = 0 + + # The test passed. + PASSED = 1 + + # The test did not pass. + FAILED = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/tool.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/tool.rb new file mode 100644 index 000000000000..2b20fd673837 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/tool.rb @@ -0,0 +1,588 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 Cx + module V3 + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Tools::Client#create_tool Tools.CreateTool}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to create a Tool for. + # Format: `projects//locations//agents/`. + # @!attribute [rw] tool + # @return [::Google::Cloud::Dialogflow::CX::V3::Tool] + # Required. The Tool to be created. + class CreateToolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Tools::Client#list_tools Tools.ListTools}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to list the Tools from. + # Format: `projects//locations//agents/`. + # @!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 ListToolsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Tools::Client#list_tools Tools.ListTools}. + # @!attribute [rw] tools + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Tool>] + # The list of Tools. 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 ListToolsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Tools::Client#get_tool Tools.GetTool}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Tool. + # Format: + # `projects//locations//agents//tools/`. + class GetToolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Tools::Client#update_tool Tools.UpdateTool}. + # @!attribute [rw] tool + # @return [::Google::Cloud::Dialogflow::CX::V3::Tool] + # Required. The Tool to be updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The mask to control which fields get updated. If the mask is not present, + # all fields will be updated. + class UpdateToolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Tools::Client#delete_tool Tools.DeleteTool}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Tool to be deleted. + # Format: + # `projects//locations//agents//tools/`. + # @!attribute [rw] force + # @return [::Boolean] + # This field has no effect for Tools not being used. + # For Tools that are used: + # + # * If `force` is set to false, an error will be returned with message + # indicating the referenced resources. + # * If `force` is set to true, Dialogflow will remove the tool, as well + # as any references to the tool. + class DeleteToolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A tool provides a list of actions which are available to the + # {::Google::Cloud::Dialogflow::CX::V3::Playbook Playbook} to attain its goal. A Tool + # consists of a description of the tool's usage and a specification of the tool + # which contains the schema and authentication information. + # @!attribute [rw] name + # @return [::String] + # The unique identifier of the Tool. + # Format: + # `projects//locations//agents//tools/`. + # @!attribute [rw] display_name + # @return [::String] + # Required. The human-readable name of the Tool, unique within an agent. + # @!attribute [rw] description + # @return [::String] + # Required. High level description of the Tool and its usage. + # @!attribute [rw] open_api_spec + # @return [::Google::Cloud::Dialogflow::CX::V3::Tool::OpenApiTool] + # OpenAPI specification of the Tool. + # + # Note: The following fields are mutually exclusive: `open_api_spec`, `data_store_spec`, `function_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] data_store_spec + # @return [::Google::Cloud::Dialogflow::CX::V3::Tool::DataStoreTool] + # Data store search tool specification. + # + # Note: The following fields are mutually exclusive: `data_store_spec`, `open_api_spec`, `function_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::CX::V3::Tool::FunctionTool] + # Client side executed function specification. + # + # Note: The following fields are mutually exclusive: `function_spec`, `open_api_spec`, `data_store_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] tool_type + # @return [::Google::Cloud::Dialogflow::CX::V3::Tool::ToolType] + # Output only. The tool type. + class Tool + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # 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::CX::V3::Tool::Authentication] + # Optional. Authentication information required by the API. + # @!attribute [rw] tls_config + # @return [::Google::Cloud::Dialogflow::CX::V3::Tool::TLSConfig] + # Optional. TLS configuration for the HTTPS verification. + # @!attribute [rw] service_directory_config + # @return [::Google::Cloud::Dialogflow::CX::V3::Tool::ServiceDirectoryConfig] + # Optional. Service Directory configuration. + class OpenApiTool + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A DataStoreTool is a way to provide specifications needed to search a + # list of data stores. + # @!attribute [rw] data_store_connections + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::DataStoreConnection>] + # Required. List of data stores to search. + # @!attribute [rw] fallback_prompt + # @return [::Google::Cloud::Dialogflow::CX::V3::Tool::DataStoreTool::FallbackPrompt] + # Required. Fallback prompt configurations to use. + class DataStoreTool + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A FallbackPrompt is a way to provide specifications for the Data Store + # fallback prompt when generating responses. + class FallbackPrompt + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + 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. + class FunctionTool + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Authentication information required for API calls + # @!attribute [rw] api_key_config + # @return [::Google::Cloud::Dialogflow::CX::V3::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`, `service_account_auth_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::CX::V3::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`, `service_account_auth_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::CX::V3::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`, `service_account_auth_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::CX::V3::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`, `service_account_auth_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] service_account_auth_config + # @return [::Google::Cloud::Dialogflow::CX::V3::Tool::Authentication::ServiceAccountAuthConfig] + # Configuration for service account authentication. + # + # Note: The following fields are mutually exclusive: `service_account_auth_config`, `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. + 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::CX::V3::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::CX::V3::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 [Diglogflow service + # agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + # @!attribute [rw] service_agent_auth + # @return [::Google::Cloud::Dialogflow::CX::V3::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 [Diglogflow 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 + + # Configuration for authentication using a service account. + # @!attribute [rw] service_account + # @return [::String] + # Required. The email address of the service account used to authenticate + # the tool call. Dialogflow uses this service account to exchange an + # access token and the access token is then sent in the `Authorization` + # header of the tool request. + # + # The service account must have the + # `roles/iam.serviceAccountTokenCreator` role granted to the + # [Dialogflow service + # agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + class ServiceAccountAuthConfig + 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::CX::V3::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 agent. + class ServiceDirectoryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the type of the tool. + module ToolType + # Default value. This value is unused. + TOOL_TYPE_UNSPECIFIED = 0 + + # Customer provided tool. + CUSTOMIZED_TOOL = 1 + + # First party built-in tool created by Dialogflow which cannot be modified. + BUILTIN_TOOL = 2 + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Tools::Client#list_tool_versions Tools.ListToolVersions}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the tool versions. + # Format: + # `projects//locations//agents//tools/`. + # @!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 ListToolVersionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Tools::Client#list_tool_versions Tools.ListToolVersions}. + # @!attribute [rw] tool_versions + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ToolVersion>] + # The list of tool 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 ListToolVersionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Tools::Client#create_tool_version Tools.CreateToolVersion}. + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Tools::Client#create_tool_version Tools.CreateToolVersion}. + # @!attribute [rw] parent + # @return [::String] + # Required. The tool to create a version for. + # Format: + # `projects//locations//agents//tools/`. + # @!attribute [rw] tool_version + # @return [::Google::Cloud::Dialogflow::CX::V3::ToolVersion] + # Required. The tool version to create. + class CreateToolVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Tools::Client#get_tool_version Tools.GetToolVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the tool version. + # Format: + # `projects//locations//agents//tools//versions/`. + class GetToolVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Tools::Client#delete_tool_version Tools.DeleteToolVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the tool version to delete. + # Format: + # `projects//locations//agents//tools//versions/`. + # @!attribute [rw] force + # @return [::Boolean] + # Optional. This field has no effect for Tools not being used. + # For Tools that are used: + # + # * If `force` is set to false, an error will be returned with message + # indicating the referenced resources. + # * If `force` is set to true, Dialogflow will remove the tool, as well + # as any references to the tool. + class DeleteToolVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Tools::Client#restore_tool_version Tools.RestoreToolVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the tool version. + # Format: + # `projects//locations//agents//tools//versions/`. + class RestoreToolVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Tools::Client#restore_tool_version Tools.RestoreToolVersion}. + # @!attribute [rw] tool + # @return [::Google::Cloud::Dialogflow::CX::V3::Tool] + # The updated tool. + class RestoreToolVersionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Tool version is a snapshot of the tool at certain timestamp. + # @!attribute [rw] name + # @return [::String] + # Identifier. The unique identifier of the tool version. + # Format: + # `projects//locations//agents//tools//versions/`. + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the tool version. + # @!attribute [rw] tool + # @return [::Google::Cloud::Dialogflow::CX::V3::Tool] + # Required. Snapshot of the tool to be associated with this version. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Last time the tool version was created or modified. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Last time the tool version was created or modified. + class ToolVersion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/tool_call.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/tool_call.rb new file mode 100644 index 000000000000..51f5b690609c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/tool_call.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dialogflow + module CX + module V3 + # Represents a call of a specific tool's action with the specified inputs. + # @!attribute [rw] tool + # @return [::String] + # Required. The {::Google::Cloud::Dialogflow::CX::V3::Tool tool} associated with + # this call. Format: + # `projects//locations//agents//tools/`. + # @!attribute [rw] action + # @return [::String] + # Required. 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. + class ToolCall + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The result of calling a tool's action that has been executed by the client. + # @!attribute [rw] tool + # @return [::String] + # Required. The {::Google::Cloud::Dialogflow::CX::V3::Tool tool} associated with + # this call. Format: + # `projects//locations//agents//tools/`. + # @!attribute [rw] action + # @return [::String] + # Required. The name of the tool's action associated with this call. + # @!attribute [rw] error + # @return [::Google::Cloud::Dialogflow::CX::V3::ToolCallResult::Error] + # The tool call's error. + # + # Note: The following fields are mutually exclusive: `error`, `output_parameters`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] output_parameters + # @return [::Google::Protobuf::Struct] + # The tool call's output parameters. + # + # Note: The following fields are mutually exclusive: `output_parameters`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + 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 +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/trace.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/trace.rb new file mode 100644 index 000000000000..29b4f224d4ab --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/trace.rb @@ -0,0 +1,224 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # Input of the playbook. + # @!attribute [rw] preceding_conversation_summary + # @return [::String] + # Optional. Summary string of the preceding conversation for the child + # playbook invocation. + class PlaybookInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Output of the playbook. + # @!attribute [rw] execution_summary + # @return [::String] + # Optional. Summary string of the execution result of the child playbook. + class PlaybookOutput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Action performed by end user or Dialogflow agent in the conversation. + # @!attribute [rw] user_utterance + # @return [::Google::Cloud::Dialogflow::CX::V3::UserUtterance] + # Optional. Agent obtained a message from the customer. + # + # Note: The following fields are mutually exclusive: `user_utterance`, `agent_utterance`, `tool_use`, `playbook_invocation`, `flow_invocation`, `playbook_transition`, `flow_transition`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] agent_utterance + # @return [::Google::Cloud::Dialogflow::CX::V3::AgentUtterance] + # Optional. Action performed by the agent as a message. + # + # Note: The following fields are mutually exclusive: `agent_utterance`, `user_utterance`, `tool_use`, `playbook_invocation`, `flow_invocation`, `playbook_transition`, `flow_transition`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] tool_use + # @return [::Google::Cloud::Dialogflow::CX::V3::ToolUse] + # Optional. Action performed on behalf of the agent by calling a plugin + # tool. + # + # Note: The following fields are mutually exclusive: `tool_use`, `user_utterance`, `agent_utterance`, `playbook_invocation`, `flow_invocation`, `playbook_transition`, `flow_transition`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] playbook_invocation + # @return [::Google::Cloud::Dialogflow::CX::V3::PlaybookInvocation] + # Optional. Action performed on behalf of the agent by invoking a child + # playbook. + # + # Note: The following fields are mutually exclusive: `playbook_invocation`, `user_utterance`, `agent_utterance`, `tool_use`, `flow_invocation`, `playbook_transition`, `flow_transition`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] flow_invocation + # @return [::Google::Cloud::Dialogflow::CX::V3::FlowInvocation] + # Optional. Action performed on behalf of the agent by invoking a CX flow. + # + # Note: The following fields are mutually exclusive: `flow_invocation`, `user_utterance`, `agent_utterance`, `tool_use`, `playbook_invocation`, `playbook_transition`, `flow_transition`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] playbook_transition + # @return [::Google::Cloud::Dialogflow::CX::V3::PlaybookTransition] + # Optional. Action performed on behalf of the agent by transitioning to a + # target playbook. + # + # Note: The following fields are mutually exclusive: `playbook_transition`, `user_utterance`, `agent_utterance`, `tool_use`, `playbook_invocation`, `flow_invocation`, `flow_transition`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] flow_transition + # @return [::Google::Cloud::Dialogflow::CX::V3::FlowTransition] + # Optional. Action performed on behalf of the agent by transitioning to a + # target CX flow. + # + # Note: The following fields are mutually exclusive: `flow_transition`, `user_utterance`, `agent_utterance`, `tool_use`, `playbook_invocation`, `flow_invocation`, `playbook_transition`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Action + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # UserUtterance represents one message sent by the customer. + # @!attribute [rw] text + # @return [::String] + # Required. Message content in text. + class UserUtterance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # AgentUtterance represents one message sent by the agent. + # @!attribute [rw] text + # @return [::String] + # Required. Message content in text. + class AgentUtterance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Stores metadata of the invocation of an action supported by a tool. + # @!attribute [rw] tool + # @return [::String] + # Required. The {::Google::Cloud::Dialogflow::CX::V3::Tool tool} that should be + # used. Format: + # `projects//locations//agents//tools/`. + # @!attribute [r] display_name + # @return [::String] + # Output only. The display name of the tool. + # @!attribute [rw] action + # @return [::String] + # Optional. Name of the action to be called during the tool use. + # @!attribute [rw] input_action_parameters + # @return [::Google::Protobuf::Struct] + # Optional. A list of input parameters for the action. + # @!attribute [rw] output_action_parameters + # @return [::Google::Protobuf::Struct] + # Optional. A list of output parameters generated by the action. + class ToolUse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Stores metadata of the invocation of a child playbook. + # @!attribute [rw] playbook + # @return [::String] + # Required. The unique identifier of the playbook. + # Format: + # `projects//locations//agents//playbooks/`. + # @!attribute [r] display_name + # @return [::String] + # Output only. The display name of the playbook. + # @!attribute [rw] playbook_input + # @return [::Google::Cloud::Dialogflow::CX::V3::PlaybookInput] + # Optional. Input of the child playbook invocation. + # @!attribute [rw] playbook_output + # @return [::Google::Cloud::Dialogflow::CX::V3::PlaybookOutput] + # Optional. Output of the child playbook invocation. + # @!attribute [rw] playbook_state + # @return [::Google::Cloud::Dialogflow::CX::V3::OutputState] + # Required. Playbook invocation's output state. + class PlaybookInvocation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Stores metadata of the invocation of a CX flow. + # @!attribute [rw] flow + # @return [::String] + # Required. The unique identifier of the flow. + # Format: + # `projects//locations//agents//flows/`. + # @!attribute [r] display_name + # @return [::String] + # Output only. The display name of the flow. + # @!attribute [rw] flow_state + # @return [::Google::Cloud::Dialogflow::CX::V3::OutputState] + # Required. Flow invocation's output state. + class FlowInvocation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Stores metadata of the transition to another target playbook. Playbook + # transition actions exit the caller playbook and enter the target playbook. + # @!attribute [rw] playbook + # @return [::String] + # Required. The unique identifier of the playbook. + # Format: + # `projects//locations//agents//playbooks/`. + # @!attribute [r] display_name + # @return [::String] + # Output only. The display name of the playbook. + class PlaybookTransition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Stores metadata of the transition to a target CX flow. Flow transition + # actions exit the caller playbook and enter the child flow. + # @!attribute [rw] flow + # @return [::String] + # Required. The unique identifier of the flow. + # Format: + # `projects//locations//agents/`. + # @!attribute [r] display_name + # @return [::String] + # Output only. The display name of the flow. + class FlowTransition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Output state. + module OutputState + # Unspecified output. + OUTPUT_STATE_UNSPECIFIED = 0 + + # Succeeded. + OUTPUT_STATE_OK = 1 + + # Cancelled. + OUTPUT_STATE_CANCELLED = 2 + + # Failed. + OUTPUT_STATE_FAILED = 3 + + # Escalated. + OUTPUT_STATE_ESCALATED = 4 + + # Pending. + OUTPUT_STATE_PENDING = 5 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/transition_route_group.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/transition_route_group.rb new file mode 100644 index 000000000000..97fa85525003 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/transition_route_group.rb @@ -0,0 +1,212 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dialogflow + module CX + module V3 + # A TransitionRouteGroup represents a group of + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRoute `TransitionRoutes`} to be + # used by a {::Google::Cloud::Dialogflow::CX::V3::Page Page}. + # @!attribute [rw] name + # @return [::String] + # The unique identifier of the transition route group. + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#create_transition_route_group TransitionRouteGroups.CreateTransitionRouteGroup} + # populates the name automatically. Format: + # `projects//locations//agents//flows//transitionRouteGroups/` + # . + # @!attribute [rw] display_name + # @return [::String] + # Required. The human-readable name of the transition route group, unique + # within the flow. The display name can be no longer than 30 characters. + # @!attribute [rw] transition_routes + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TransitionRoute>] + # Transition routes associated with the + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup}. + class TransitionRouteGroup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#list_transition_route_groups TransitionRouteGroups.ListTransitionRouteGroups}. + # @!attribute [rw] parent + # @return [::String] + # Required. The flow to list all transition route groups for. + # Format: + # `projects//locations//agents//flows/` + # or `projects//locations//agents/. + # @!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. + # @!attribute [rw] language_code + # @return [::String] + # The language to list transition route groups for. The following fields are + # language dependent: + # + # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + # * + # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + class ListTransitionRouteGroupsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#list_transition_route_groups TransitionRouteGroups.ListTransitionRouteGroups}. + # @!attribute [rw] transition_route_groups + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup>] + # The list of transition route groups. There will be a maximum number of + # items returned based on the page_size field in the request. The list may in + # some cases be empty or contain fewer entries than page_size even if this + # isn't the last page. + # @!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 ListTransitionRouteGroupsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#get_transition_route_group TransitionRouteGroups.GetTransitionRouteGroup}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup}. + # Format: + # `projects//locations//agents//flows//transitionRouteGroups/` + # or + # `projects//locations//agents//transitionRouteGroups/`. + # @!attribute [rw] language_code + # @return [::String] + # The language to retrieve the transition route group for. The following + # fields are language dependent: + # + # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + # * + # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + class GetTransitionRouteGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#create_transition_route_group TransitionRouteGroups.CreateTransitionRouteGroup}. + # @!attribute [rw] parent + # @return [::String] + # Required. The flow to create an + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup} + # for. Format: + # `projects//locations//agents//flows/` + # or `projects//locations//agents/` + # for agent-level groups. + # @!attribute [rw] transition_route_group + # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] + # Required. The transition route group to create. + # @!attribute [rw] language_code + # @return [::String] + # The language of the following fields in `TransitionRouteGroup`: + # + # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + # * + # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + class CreateTransitionRouteGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#update_transition_route_group TransitionRouteGroups.UpdateTransitionRouteGroup}. + # @!attribute [rw] transition_route_group + # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] + # Required. The transition route group to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The mask to control which fields get updated. + # @!attribute [rw] language_code + # @return [::String] + # The language of the following fields in `TransitionRouteGroup`: + # + # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + # * + # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + # + # If not specified, the agent's default language is used. + # [Many + # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + # are supported. + # Note: languages must be enabled in the agent before they can be used. + class UpdateTransitionRouteGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#delete_transition_route_group TransitionRouteGroups.DeleteTransitionRouteGroup}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the + # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup} + # to delete. Format: + # `projects//locations//agents//flows//transitionRouteGroups/` + # or + # `projects//locations//agents//transitionRouteGroups/`. + # @!attribute [rw] force + # @return [::Boolean] + # This field has no effect for transition route group that no page is using. + # If the transition route group is referenced by any page: + # + # * If `force` is set to false, an error will be returned with message + # indicating pages that reference the transition route group. + # * If `force` is set to true, Dialogflow will remove the transition route + # group, as well as any reference to it. + class DeleteTransitionRouteGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/validation_message.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/validation_message.rb new file mode 100644 index 000000000000..b6ff511ea4b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/validation_message.rb @@ -0,0 +1,125 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # Agent/flow validation message. + # @!attribute [rw] resource_type + # @return [::Google::Cloud::Dialogflow::CX::V3::ValidationMessage::ResourceType] + # The type of the resources where the message is found. + # @!attribute [rw] resources + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::String>] + # The names of the resources where the message is found. + # @!attribute [rw] resource_names + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ResourceName>] + # The resource names of the resources where the message is found. + # @!attribute [rw] severity + # @return [::Google::Cloud::Dialogflow::CX::V3::ValidationMessage::Severity] + # Indicates the severity of the message. + # @!attribute [rw] detail + # @return [::String] + # The message detail. + class ValidationMessage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Resource types. + module ResourceType + # Unspecified. + RESOURCE_TYPE_UNSPECIFIED = 0 + + # Agent. + AGENT = 1 + + # Intent. + INTENT = 2 + + # Intent training phrase. + INTENT_TRAINING_PHRASE = 8 + + # Intent parameter. + INTENT_PARAMETER = 9 + + # Multiple intents. + INTENTS = 10 + + # Multiple training phrases. + INTENT_TRAINING_PHRASES = 11 + + # Entity type. + ENTITY_TYPE = 3 + + # Multiple entity types. + ENTITY_TYPES = 12 + + # Webhook. + WEBHOOK = 4 + + # Flow. + FLOW = 5 + + # Page. + PAGE = 6 + + # Multiple pages. + PAGES = 13 + + # Transition route group. + TRANSITION_ROUTE_GROUP = 7 + + # Agent transition route group. + AGENT_TRANSITION_ROUTE_GROUP = 14 + end + + # Severity level. + module Severity + # Unspecified. + 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 failures. + ERROR = 3 + end + end + + # Resource name and display name. + # @!attribute [rw] name + # @return [::String] + # Name. + # @!attribute [rw] display_name + # @return [::String] + # Display name. + class ResourceName + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/version.rb new file mode 100644 index 000000000000..d850ccd9bda7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/version.rb @@ -0,0 +1,235 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # Metadata associated with the long running operation for + # {::Google::Cloud::Dialogflow::CX::V3::Versions::Client#create_version Versions.CreateVersion}. + # @!attribute [rw] version + # @return [::String] + # Name of the created version. + # Format: + # `projects//locations//agents//flows//versions/`. + class CreateVersionOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a version of a flow. + # @!attribute [rw] name + # @return [::String] + # Format: + # projects//locations//agents//flows//versions/. + # Version ID is a self-increasing number generated by Dialogflow upon version + # creation. + # @!attribute [rw] display_name + # @return [::String] + # Required. The human-readable name of the version. Limit of 64 characters. + # @!attribute [rw] description + # @return [::String] + # The description of the version. The maximum length is 500 characters. If + # exceeded, the request is rejected. + # @!attribute [r] nlu_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::NluSettings] + # Output only. The NLU settings of the flow at version creation. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Create time of the version. + # @!attribute [r] state + # @return [::Google::Cloud::Dialogflow::CX::V3::Version::State] + # Output only. The state 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 state of the version. + module State + # Not specified. This value is not used. + STATE_UNSPECIFIED = 0 + + # Version is not ready to serve (e.g. training is running). + RUNNING = 1 + + # Training has succeeded and this version is ready to serve. + SUCCEEDED = 2 + + # Version training failed. + FAILED = 3 + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Versions::Client#list_versions Versions.ListVersions}. + # @!attribute [rw] parent + # @return [::String] + # Required. The {::Google::Cloud::Dialogflow::CX::V3::Flow Flow} to list all + # versions for. Format: + # `projects//locations//agents//flows/`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return in a single page. By default 20 and + # at most 100. + # @!attribute [rw] page_token + # @return [::String] + # 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::CX::V3::Versions::Client#list_versions Versions.ListVersions}. + # @!attribute [rw] versions + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Version>] + # A list of versions. There will be a maximum number of items returned based + # on the page_size field in the request. The list may in some cases be empty + # or contain fewer entries than page_size even if this isn't the last page. + # @!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::CX::V3::Versions::Client#get_version Versions.GetVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the {::Google::Cloud::Dialogflow::CX::V3::Version Version}. + # Format: + # `projects//locations//agents//flows//versions/`. + class GetVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Versions::Client#create_version Versions.CreateVersion}. + # @!attribute [rw] parent + # @return [::String] + # Required. The {::Google::Cloud::Dialogflow::CX::V3::Flow Flow} to create an + # {::Google::Cloud::Dialogflow::CX::V3::Version Version} for. Format: + # `projects//locations//agents//flows/`. + # @!attribute [rw] version + # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Versions::Client#update_version Versions.UpdateVersion}. + # @!attribute [rw] version + # @return [::Google::Cloud::Dialogflow::CX::V3::Version] + # Required. The version to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The mask to control which fields get updated. Currently only + # `description` and `display_name` can be updated. + class UpdateVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Versions::Client#delete_version Versions.DeleteVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the {::Google::Cloud::Dialogflow::CX::V3::Version Version} + # to delete. Format: + # `projects//locations//agents//flows//versions/`. + class DeleteVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Versions::Client#load_version Versions.LoadVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The {::Google::Cloud::Dialogflow::CX::V3::Version Version} to be loaded + # to draft flow. Format: + # `projects//locations//agents//flows//versions/`. + # @!attribute [rw] allow_override_agent_resources + # @return [::Boolean] + # This field is used to prevent accidental overwrite of other agent + # resources, which can potentially impact other flow's behavior. If + # `allow_override_agent_resources` is false, conflicted agent-level resources + # will not be overridden (i.e. intents, entities, webhooks). + class LoadVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Versions::Client#compare_versions Versions.CompareVersions}. + # @!attribute [rw] base_version + # @return [::String] + # Required. Name of the base flow version to compare with the target version. + # Use version ID `0` to indicate the draft version of the specified flow. + # + # Format: + # `projects//locations//agents//flows//versions/`. + # @!attribute [rw] target_version + # @return [::String] + # Required. Name of the target flow version to compare with the + # base version. Use version ID `0` to indicate the draft version of the + # specified flow. Format: + # `projects//locations//agents//flows//versions/`. + # @!attribute [rw] language_code + # @return [::String] + # The language to compare the flow versions for. + # + # 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 CompareVersionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Versions::Client#compare_versions Versions.CompareVersions}. + # @!attribute [rw] base_version_content_json + # @return [::String] + # JSON representation of the base version content. + # @!attribute [rw] target_version_content_json + # @return [::String] + # JSON representation of the target version content. + # @!attribute [rw] compare_time + # @return [::Google::Protobuf::Timestamp] + # The timestamp when the two version compares. + class CompareVersionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb new file mode 100644 index 000000000000..54bae9f3b8a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb @@ -0,0 +1,782 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 CX + module V3 + # Webhooks host the developer's business logic. During a session, webhooks + # allow the developer to use the data extracted by Dialogflow's natural + # language processing to generate dynamic responses, validate collected data, + # or trigger actions on the backend. + # @!attribute [rw] name + # @return [::String] + # The unique identifier of the webhook. + # Required for the + # {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#update_webhook Webhooks.UpdateWebhook} + # method. + # {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#create_webhook Webhooks.CreateWebhook} + # populates the name automatically. Format: + # `projects//locations//agents//webhooks/`. + # @!attribute [rw] display_name + # @return [::String] + # Required. The human-readable name of the webhook, unique within the agent. + # @!attribute [rw] generic_web_service + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService] + # Configuration for a generic web service. + # + # Note: The following fields are mutually exclusive: `generic_web_service`, `service_directory`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] service_directory + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook::ServiceDirectoryConfig] + # Configuration for a [Service + # Directory](https://cloud.google.com/service-directory) service. + # + # Note: The following fields are mutually exclusive: `service_directory`, `generic_web_service`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # Webhook execution timeout. Execution is considered failed if Dialogflow + # doesn't receive a response from webhook at the end of the timeout period. + # Defaults to 5 seconds, maximum allowed timeout is 30 seconds. + # @!attribute [rw] disabled + # @return [::Boolean] + # Indicates whether the webhook is disabled. + class Webhook + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents configuration for a generic web service. + # @!attribute [rw] uri + # @return [::String] + # Required. The webhook URI for receiving POST requests. It must use https + # protocol. + # @!attribute [rw] username + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # The user name for HTTP Basic authentication. + # @!attribute [rw] password + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # The password for HTTP Basic authentication. + # @!attribute [rw] secret_version_for_username_password + # @return [::String] + # Optional. The SecretManager secret version resource storing the + # username:password pair for HTTP Basic authentication. Format: + # `projects/{project}/secrets/{secret}/versions/{version}` + # @!attribute [rw] request_headers + # @return [::Google::Protobuf::Map{::String => ::String}] + # The HTTP request headers to send together with webhook requests. + # @!attribute [rw] secret_versions_for_request_headers + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService::SecretVersionHeaderValue}] + # Optional. The HTTP request headers to send together with webhook + # requests. Header values are stored in SecretManager secret versions. + # + # When the same header name is specified in both `request_headers` and + # `secret_versions_for_request_headers`, the value in + # `secret_versions_for_request_headers` will be used. + # @!attribute [rw] allowed_ca_certs + # @return [::Array<::String>] + # Optional. Specifies a list of 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'") + # ``` + # @!attribute [rw] oauth_config + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService::OAuthConfig] + # Optional. The OAuth configuration of the webhook. If specified, + # Dialogflow will initiate the OAuth client credential flow to exchange an + # access token from the 3rd party platform and put it in the auth header. + # @!attribute [rw] service_agent_auth + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService::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. + # @!attribute [rw] service_account_auth_config + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService::ServiceAccountAuthConfig] + # Optional. Configuration for service account authentication. + # @!attribute [rw] webhook_type + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService::WebhookType] + # Optional. Type of the webhook. + # @!attribute [rw] http_method + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService::HttpMethod] + # Optional. HTTP method for the flexible webhook calls. Standard webhook + # always uses POST. + # @!attribute [rw] request_body + # @return [::String] + # Optional. Defines a custom JSON object as request body to send to + # flexible webhook. + # @!attribute [rw] parameter_mapping + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Maps the values extracted from specific fields of the flexible + # webhook response into session parameters. + # - Key: session parameter name + # - Value: field path in the webhook response + class GenericWebService + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents the value of an HTTP header stored in a SecretManager secret + # version. + # @!attribute [rw] secret_version + # @return [::String] + # Required. The SecretManager secret version resource storing the header + # value. Format: `projects/{project}/secrets/{secret}/versions/{version}` + class SecretVersionHeaderValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents configuration of OAuth client credential flow for 3rd party + # API authentication. + # @!attribute [rw] client_id + # @return [::String] + # Required. The client ID provided by the 3rd party platform. + # @!attribute [rw] client_secret + # @return [::String] + # Optional. The client secret provided by the 3rd party platform. + # @!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 provided by the 3rd party platform to + # exchange 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 + end + + # Configuration for authentication using a service account. + # @!attribute [rw] service_account + # @return [::String] + # Required. The email address of the service account used to authenticate + # the webhook call. Dialogflow uses this service account to exchange an + # access token and the access token is then sent in the `Authorization` + # header of the webhook request. + # + # The service account must have the + # `roles/iam.serviceAccountTokenCreator` role granted to the + # [Dialogflow service + # agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + class ServiceAccountAuthConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RequestHeadersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService::SecretVersionHeaderValue] + class SecretVersionsForRequestHeadersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ParameterMappingEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Indicate the auth token type generated from the [Diglogflow 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 + + # No token used. + NONE = 1 + + # 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 = 2 + + # 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 = 3 + end + + # Represents the type of webhook configuration. + module WebhookType + # Default value. This value is unused. + WEBHOOK_TYPE_UNSPECIFIED = 0 + + # Represents a standard webhook. + STANDARD = 1 + + # Represents a flexible webhook. + FLEXIBLE = 2 + end + + # HTTP method to use when calling webhooks. + module HttpMethod + # HTTP method not specified. + HTTP_METHOD_UNSPECIFIED = 0 + + # HTTP POST Method. + POST = 1 + + # HTTP GET Method. + GET = 2 + + # HTTP HEAD Method. + HEAD = 3 + + # HTTP PUT Method. + PUT = 4 + + # HTTP DELETE Method. + DELETE = 5 + + # HTTP PATCH Method. + PATCH = 6 + + # HTTP OPTIONS Method. + OPTIONS = 7 + end + end + + # Represents configuration for a [Service + # Directory](https://cloud.google.com/service-directory) service. + # @!attribute [rw] service + # @return [::String] + # Required. The name of [Service + # Directory](https://cloud.google.com/service-directory) service. + # Format: + # `projects//locations//namespaces//services/`. + # `Location ID` of the service directory must be the same as the location + # of the agent. + # @!attribute [rw] generic_web_service + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService] + # Generic Service configuration of this webhook. + class ServiceDirectoryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#list_webhooks Webhooks.ListWebhooks}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to list all webhooks for. + # Format: `projects//locations//agents/`. + # @!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 ListWebhooksRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#list_webhooks Webhooks.ListWebhooks}. + # @!attribute [rw] webhooks + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Webhook>] + # The list of webhooks. 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 ListWebhooksResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#get_webhook Webhooks.GetWebhook}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the webhook. + # Format: + # `projects//locations//agents//webhooks/`. + class GetWebhookRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#create_webhook Webhooks.CreateWebhook}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to create a webhook for. + # Format: `projects//locations//agents/`. + # @!attribute [rw] webhook + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] + # Required. The webhook to create. + class CreateWebhookRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#update_webhook Webhooks.UpdateWebhook}. + # @!attribute [rw] webhook + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] + # Required. The webhook to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The mask to control which fields get updated. If the mask is not present, + # all fields will be updated. + class UpdateWebhookRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#delete_webhook Webhooks.DeleteWebhook}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the webhook to delete. + # Format: + # `projects//locations//agents//webhooks/`. + # @!attribute [rw] force + # @return [::Boolean] + # This field has no effect for webhook not being used. + # For webhooks that are used by pages/flows/transition route groups: + # + # * If `force` is set to false, an error will be returned with message + # indicating the referenced resources. + # * If `force` is set to true, Dialogflow will remove the webhook, as well + # as any references to the webhook (i.e. + # {::Google::Cloud::Dialogflow::CX::V3::Fulfillment#webhook Webhook} and + # {::Google::Cloud::Dialogflow::CX::V3::Fulfillment#tag tag}in fulfillments that + # point to this webhook will be removed). + class DeleteWebhookRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for a webhook call. The request is sent as a JSON object + # and the field names will be presented in camel cases. + # + # You may see undocumented fields in an actual request. These fields are used + # internally by Dialogflow and should be ignored. + # @!attribute [rw] detect_intent_response_id + # @return [::String] + # Always present. The unique identifier of the + # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse DetectIntentResponse} + # that will be returned to the API caller. + # @!attribute [rw] text + # @return [::String] + # If {::Google::Cloud::Dialogflow::CX::V3::TextInput natural language text} was + # provided as input, this field will contain a copy of the text. + # + # Note: The following fields are mutually exclusive: `text`, `trigger_intent`, `transcript`, `trigger_event`, `dtmf_digits`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] trigger_intent + # @return [::String] + # If an {::Google::Cloud::Dialogflow::CX::V3::IntentInput intent} was provided as + # input, this field will contain a copy of the intent identifier. Format: + # `projects//locations//agents//intents/`. + # + # Note: The following fields are mutually exclusive: `trigger_intent`, `text`, `transcript`, `trigger_event`, `dtmf_digits`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] transcript + # @return [::String] + # If [natural language speech + # audio][google.cloud.dialogflow.cx.v3.AudioInput] was provided as input, + # this field will contain the transcript for the audio. + # + # Note: The following fields are mutually exclusive: `transcript`, `text`, `trigger_intent`, `trigger_event`, `dtmf_digits`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] trigger_event + # @return [::String] + # If an {::Google::Cloud::Dialogflow::CX::V3::EventInput event} was provided as + # input, this field will contain the name of the event. + # + # Note: The following fields are mutually exclusive: `trigger_event`, `text`, `trigger_intent`, `transcript`, `dtmf_digits`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] dtmf_digits + # @return [::String] + # If {::Google::Cloud::Dialogflow::CX::V3::DtmfInput DTMF} was provided as input, + # this field will contain the DTMF digits. + # + # Note: The following fields are mutually exclusive: `dtmf_digits`, `text`, `trigger_intent`, `transcript`, `trigger_event`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] language_code + # @return [::String] + # The language code specified in the [original + # request][QueryInput.language_code]. + # @!attribute [rw] fulfillment_info + # @return [::Google::Cloud::Dialogflow::CX::V3::WebhookRequest::FulfillmentInfo] + # Always present. Information about the fulfillment that triggered this + # webhook call. + # @!attribute [rw] intent_info + # @return [::Google::Cloud::Dialogflow::CX::V3::WebhookRequest::IntentInfo] + # Information about the last matched intent. + # @!attribute [rw] page_info + # @return [::Google::Cloud::Dialogflow::CX::V3::PageInfo] + # Information about page status. + # @!attribute [rw] session_info + # @return [::Google::Cloud::Dialogflow::CX::V3::SessionInfo] + # Information about session status. + # @!attribute [rw] messages + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ResponseMessage>] + # The list of rich message responses to present to the user. Webhook can + # choose to append or replace this list in + # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse#fulfillment_response WebhookResponse.fulfillment_response}; + # @!attribute [rw] payload + # @return [::Google::Protobuf::Struct] + # Custom data set in + # {::Google::Cloud::Dialogflow::CX::V3::QueryParameters#payload QueryParameters.payload}. + # @!attribute [rw] sentiment_analysis_result + # @return [::Google::Cloud::Dialogflow::CX::V3::WebhookRequest::SentimentAnalysisResult] + # The sentiment analysis result of the current user request. The field is + # filled when sentiment analysis is configured to be enabled for the request. + # @!attribute [rw] language_info + # @return [::Google::Cloud::Dialogflow::CX::V3::LanguageInfo] + # Information about the language of the request. + class WebhookRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents fulfillment information communicated to the webhook. + # @!attribute [rw] tag + # @return [::String] + # Always present. + # The value of the + # {::Google::Cloud::Dialogflow::CX::V3::Fulfillment#tag Fulfillment.tag} field + # will be populated in this field by Dialogflow when the associated webhook + # is called. The tag is typically used by the webhook service to identify + # which fulfillment is being called, but it could be used for other + # purposes. + class FulfillmentInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents intent information communicated to the webhook. + # @!attribute [rw] last_matched_intent + # @return [::String] + # Always present. The unique identifier of the last matched + # {::Google::Cloud::Dialogflow::CX::V3::Intent intent}. + # Format: + # `projects//locations//agents//intents/`. + # @!attribute [rw] display_name + # @return [::String] + # Always present. The display name of the last matched + # {::Google::Cloud::Dialogflow::CX::V3::Intent intent}. + # @!attribute [rw] parameters + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dialogflow::CX::V3::WebhookRequest::IntentInfo::IntentParameterValue}] + # Parameters identified as a result of intent matching. This is a map of + # the name of the identified parameter to the value of the parameter + # identified from the user's utterance. All parameters defined in the + # matched intent that are identified will be surfaced here. + # @!attribute [rw] confidence + # @return [::Float] + # The confidence of the matched intent. Values range from 0.0 (completely + # uncertain) to 1.0 (completely certain). + class IntentInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a value for an intent parameter. + # @!attribute [rw] original_value + # @return [::String] + # Always present. Original text value extracted from user utterance. + # @!attribute [rw] resolved_value + # @return [::Google::Protobuf::Value] + # Always present. Structured value for the parameter extracted from user + # utterance. + class IntentParameterValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Dialogflow::CX::V3::WebhookRequest::IntentInfo::IntentParameterValue] + class ParametersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Represents the result of sentiment analysis. + # @!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 SentimentAnalysisResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The response message for a webhook call. + # @!attribute [rw] fulfillment_response + # @return [::Google::Cloud::Dialogflow::CX::V3::WebhookResponse::FulfillmentResponse] + # The fulfillment response to send to the user. This field can be omitted by + # the webhook if it does not intend to send any response to the user. + # @!attribute [rw] page_info + # @return [::Google::Cloud::Dialogflow::CX::V3::PageInfo] + # Information about page status. This field can be omitted by the webhook if + # it does not intend to modify page status. + # @!attribute [rw] session_info + # @return [::Google::Cloud::Dialogflow::CX::V3::SessionInfo] + # Information about session status. This field can be omitted by the webhook + # if it does not intend to modify session status. + # @!attribute [rw] payload + # @return [::Google::Protobuf::Struct] + # Value to append directly to + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult#webhook_payloads QueryResult.webhook_payloads}. + # @!attribute [rw] target_page + # @return [::String] + # The target page to transition to. + # Format: + # `projects//locations//agents//flows//pages/`. + # + # Note: The following fields are mutually exclusive: `target_page`, `target_flow`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] target_flow + # @return [::String] + # The target flow to transition to. + # Format: + # `projects//locations//agents//flows/`. + # + # Note: The following fields are mutually exclusive: `target_flow`, `target_page`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class WebhookResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a fulfillment response to the user. + # @!attribute [rw] messages + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ResponseMessage>] + # The list of rich message responses to present to the user. + # @!attribute [rw] merge_behavior + # @return [::Google::Cloud::Dialogflow::CX::V3::WebhookResponse::FulfillmentResponse::MergeBehavior] + # Merge behavior for `messages`. + class FulfillmentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines merge behavior for `messages`. + module MergeBehavior + # Not specified. `APPEND` will be used. + MERGE_BEHAVIOR_UNSPECIFIED = 0 + + # `messages` will be appended to the list of messages waiting to be sent + # to the user. + APPEND = 1 + + # `messages` will replace the list of messages waiting to be sent to the + # user. + REPLACE = 2 + end + end + end + + # Represents page information communicated to and from the webhook. + # @!attribute [rw] current_page + # @return [::String] + # Always present for + # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest}. Ignored for + # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. The + # unique identifier of the current page. Format: + # `projects//locations//agents//flows//pages/`. + # @!attribute [rw] display_name + # @return [::String] + # Always present for + # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest}. Ignored for + # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. The + # display name of the current page. + # @!attribute [rw] form_info + # @return [::Google::Cloud::Dialogflow::CX::V3::PageInfo::FormInfo] + # Optional for both + # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest} and + # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. + # Information about the form. + class PageInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents form information. + # @!attribute [rw] parameter_info + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::PageInfo::FormInfo::ParameterInfo>] + # Optional for both + # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest} and + # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. The + # parameters contained in the form. Note that the webhook cannot add or + # remove any form parameter. + class FormInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents parameter information. + # @!attribute [rw] display_name + # @return [::String] + # Always present for + # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest}. + # Required for + # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. + # The human-readable name of the parameter, unique within the form. This + # field cannot be modified by the webhook. + # @!attribute [rw] required + # @return [::Boolean] + # Optional for both + # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest} and + # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. + # Indicates whether the parameter is required. Optional parameters will + # not trigger prompts; however, they are filled if the user specifies + # them. Required parameters must be filled before form filling concludes. + # @!attribute [rw] state + # @return [::Google::Cloud::Dialogflow::CX::V3::PageInfo::FormInfo::ParameterInfo::ParameterState] + # Always present for + # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest}. + # Required for + # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. The + # state of the parameter. This field can be set to + # {::Google::Cloud::Dialogflow::CX::V3::PageInfo::FormInfo::ParameterInfo::ParameterState::INVALID INVALID} + # by the webhook to invalidate the parameter; other values set by the + # webhook will be ignored. + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + # Optional for both + # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest} and + # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. The + # value of the parameter. This field can be set by the webhook to change + # the parameter value. + # @!attribute [rw] just_collected + # @return [::Boolean] + # Optional for + # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest}. Ignored + # for {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. + # Indicates if the parameter value was just collected on the last + # conversation turn. + class ParameterInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents the state of a parameter. + module ParameterState + # Not specified. This value should be never used. + PARAMETER_STATE_UNSPECIFIED = 0 + + # Indicates that the parameter does not have a value. + EMPTY = 1 + + # Indicates that the parameter value is invalid. This field can be used + # by the webhook to invalidate the parameter and ask the server to + # collect it from the user again. + INVALID = 2 + + # Indicates that the parameter has a value. + FILLED = 3 + end + end + end + end + + # Represents session information communicated to and from the webhook. + # @!attribute [rw] session + # @return [::String] + # Always present for + # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest}. Ignored for + # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. The + # unique identifier of the + # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest#session session}. This + # field can be used by the webhook to identify a session. + # Format: + # `projects//locations//agents//sessions/` + # or + # `projects//locations//agents//environments//sessions/` + # if environment is specified. + # @!attribute [rw] parameters + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Optional for + # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest}. Optional + # for {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. All + # parameters collected from forms and intents during the session. Parameters + # can be created, updated, or removed by the webhook. To remove a parameter + # from the session, the webhook should explicitly set the parameter value to + # null in {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. + # The map is keyed by parameters' display names. + class SessionInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class ParametersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Represents the language information of the request. + # @!attribute [rw] input_language_code + # @return [::String] + # The language code specified in the original + # {::Google::Cloud::Dialogflow::CX::V3::QueryInput#language_code request}. + # @!attribute [rw] resolved_language_code + # @return [::String] + # The language code detected for this request based on the user + # conversation. + # @!attribute [rw] confidence_score + # @return [::Float] + # The confidence score of the detected language between 0 and 1. + class LanguageInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/struct.rb new file mode 100644 index 000000000000..39e1aca868d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/type/latlng.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/type/latlng.rb new file mode 100644 index 000000000000..c15e78a39a56 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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 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-cx-v3/snippets/Gemfile b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/Gemfile new file mode 100644 index 000000000000..58cc499704d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3", path: "../" +else + gem "google-cloud-dialogflow-cx-v3" +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-cx-v3/snippets/agents/create_agent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/create_agent.rb new file mode 100644 index 000000000000..cb7bf8736192 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/create_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_v3_generated_Agents_CreateAgent_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the create_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::CX::V3::Agents::Client#create_agent. +# +def create_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest.new + + # Call the create_agent method. + result = client.create_agent request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. + p result +end +# [END dialogflow_v3_generated_Agents_CreateAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/delete_agent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/delete_agent.rb new file mode 100644 index 000000000000..b81fd3714e04 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Agents_DeleteAgent_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Agents::Client#delete_agent. +# +def delete_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::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_v3_generated_Agents_DeleteAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/export_agent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/export_agent.rb new file mode 100644 index 000000000000..4dd3f088ca15 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Agents_ExportAgent_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Agents::Client#export_agent. +# +def export_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::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_v3_generated_Agents_ExportAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent.rb new file mode 100644 index 000000000000..40bfc561bd30 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Agents_GetAgent_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Agents::Client#get_agent. +# +def get_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetAgentRequest.new + + # Call the get_agent method. + result = client.get_agent request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. + p result +end +# [END dialogflow_v3_generated_Agents_GetAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent_validation_result.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent_validation_result.rb new file mode 100644 index 000000000000..b01f9e618881 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent_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_v3_generated_Agents_GetAgentValidationResult_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the get_agent_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::CX::V3::Agents::Client#get_agent_validation_result. +# +def get_agent_validation_result + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest.new + + # Call the get_agent_validation_result method. + result = client.get_agent_validation_result request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AgentValidationResult. + p result +end +# [END dialogflow_v3_generated_Agents_GetAgentValidationResult_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_generative_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_generative_settings.rb new file mode 100644 index 000000000000..f53032bd862b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_generative_settings.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_v3_generated_Agents_GetGenerativeSettings_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the get_generative_settings 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::CX::V3::Agents::Client#get_generative_settings. +# +def get_generative_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest.new + + # Call the get_generative_settings method. + result = client.get_generative_settings request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::GenerativeSettings. + p result +end +# [END dialogflow_v3_generated_Agents_GetGenerativeSettings_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/list_agents.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/list_agents.rb new file mode 100644 index 000000000000..3a5752210e20 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/list_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_v3_generated_Agents_ListAgents_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the list_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::CX::V3::Agents::Client#list_agents. +# +def list_agents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest.new + + # Call the list_agents method. + result = client.list_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::CX::V3::Agent. + p item + end +end +# [END dialogflow_v3_generated_Agents_ListAgents_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/restore_agent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/restore_agent.rb new file mode 100644 index 000000000000..2433849ac6d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Agents_RestoreAgent_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Agents::Client#restore_agent. +# +def restore_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::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_v3_generated_Agents_RestoreAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/update_agent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/update_agent.rb new file mode 100644 index 000000000000..3db81cfbc612 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/update_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_v3_generated_Agents_UpdateAgent_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the update_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::CX::V3::Agents::Client#update_agent. +# +def update_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest.new + + # Call the update_agent method. + result = client.update_agent request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. + p result +end +# [END dialogflow_v3_generated_Agents_UpdateAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/update_generative_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/update_generative_settings.rb new file mode 100644 index 000000000000..bfc3b6c140b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/update_generative_settings.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_v3_generated_Agents_UpdateGenerativeSettings_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the update_generative_settings 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::CX::V3::Agents::Client#update_generative_settings. +# +def update_generative_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest.new + + # Call the update_generative_settings method. + result = client.update_generative_settings request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::GenerativeSettings. + p result +end +# [END dialogflow_v3_generated_Agents_UpdateGenerativeSettings_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/validate_agent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/validate_agent.rb new file mode 100644 index 000000000000..de9ab4a03c03 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/validate_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_v3_generated_Agents_ValidateAgent_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the validate_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::CX::V3::Agents::Client#validate_agent. +# +def validate_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest.new + + # Call the validate_agent method. + result = client.validate_agent request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AgentValidationResult. + p result +end +# [END dialogflow_v3_generated_Agents_ValidateAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/changelogs/get_changelog.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/changelogs/get_changelog.rb new file mode 100644 index 000000000000..17b987ed836c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/changelogs/get_changelog.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_v3_generated_Changelogs_GetChangelog_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the get_changelog call in the Changelogs service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Changelogs::Client#get_changelog. +# +def get_changelog + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest.new + + # Call the get_changelog method. + result = client.get_changelog request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Changelog. + p result +end +# [END dialogflow_v3_generated_Changelogs_GetChangelog_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/changelogs/list_changelogs.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/changelogs/list_changelogs.rb new file mode 100644 index 000000000000..20038de9a824 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/changelogs/list_changelogs.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_v3_generated_Changelogs_ListChangelogs_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the list_changelogs call in the Changelogs service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Changelogs::Client#list_changelogs. +# +def list_changelogs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest.new + + # Call the list_changelogs method. + result = client.list_changelogs request + + # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Changelog. + p item + end +end +# [END dialogflow_v3_generated_Changelogs_ListChangelogs_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/deployments/get_deployment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/deployments/get_deployment.rb new file mode 100644 index 000000000000..959bca1e48bc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/deployments/get_deployment.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_v3_generated_Deployments_GetDeployment_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the get_deployment call in the Deployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Deployments::Client#get_deployment. +# +def get_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest.new + + # Call the get_deployment method. + result = client.get_deployment request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Deployment. + p result +end +# [END dialogflow_v3_generated_Deployments_GetDeployment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/deployments/list_deployments.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/deployments/list_deployments.rb new file mode 100644 index 000000000000..30a16458ef94 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/deployments/list_deployments.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_v3_generated_Deployments_ListDeployments_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the list_deployments call in the Deployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Deployments::Client#list_deployments. +# +def list_deployments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest.new + + # Call the list_deployments method. + result = client.list_deployments request + + # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Deployment. + p item + end +end +# [END dialogflow_v3_generated_Deployments_ListDeployments_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/create_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/create_entity_type.rb new file mode 100644 index 000000000000..e9b4bd9a8383 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_EntityTypes_CreateEntityType_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::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::CX::V3::EntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest.new + + # Call the create_entity_type method. + result = client.create_entity_type request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::EntityType. + p result +end +# [END dialogflow_v3_generated_EntityTypes_CreateEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/delete_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/delete_entity_type.rb new file mode 100644 index 000000000000..728393aa4135 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_EntityTypes_DeleteEntityType_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::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::CX::V3::EntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::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_v3_generated_EntityTypes_DeleteEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/export_entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/export_entity_types.rb new file mode 100644 index 000000000000..b3eb7329f093 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/export_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_v3_generated_EntityTypes_ExportEntityTypes_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the export_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::CX::V3::EntityTypes::Client#export_entity_types. +# +def export_entity_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest.new + + # Call the export_entity_types method. + result = client.export_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_v3_generated_EntityTypes_ExportEntityTypes_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/get_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/get_entity_type.rb new file mode 100644 index 000000000000..7c19fbbb315f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_EntityTypes_GetEntityType_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::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::CX::V3::EntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetEntityTypeRequest.new + + # Call the get_entity_type method. + result = client.get_entity_type request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::EntityType. + p result +end +# [END dialogflow_v3_generated_EntityTypes_GetEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/import_entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/import_entity_types.rb new file mode 100644 index 000000000000..019b221c76cb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/import_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_v3_generated_EntityTypes_ImportEntityTypes_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the import_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::CX::V3::EntityTypes::Client#import_entity_types. +# +def import_entity_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest.new + + # Call the import_entity_types method. + result = client.import_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_v3_generated_EntityTypes_ImportEntityTypes_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/list_entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/list_entity_types.rb new file mode 100644 index 000000000000..134251909f14 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_EntityTypes_ListEntityTypes_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::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::CX::V3::EntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityType. + p item + end +end +# [END dialogflow_v3_generated_EntityTypes_ListEntityTypes_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/update_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/update_entity_type.rb new file mode 100644 index 000000000000..0bb801564f2e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_EntityTypes_UpdateEntityType_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::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::CX::V3::EntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest.new + + # Call the update_entity_type method. + result = client.update_entity_type request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::EntityType. + p result +end +# [END dialogflow_v3_generated_EntityTypes_UpdateEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/create_environment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/create_environment.rb new file mode 100644 index 000000000000..b836547f33d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/create_environment.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_v3_generated_Environments_CreateEnvironment_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Environments::Client#create_environment. +# +def create_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest.new + + # Call the create_environment method. + result = client.create_environment request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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_v3_generated_Environments_CreateEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/delete_environment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/delete_environment.rb new file mode 100644 index 000000000000..ac3ba1737b8e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Environments_DeleteEnvironment_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Environments::Client#delete_environment. +# +def delete_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::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_v3_generated_Environments_DeleteEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/deploy_flow.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/deploy_flow.rb new file mode 100644 index 000000000000..5a8f0eeae5fc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/deploy_flow.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_v3_generated_Environments_DeployFlow_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the deploy_flow 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::CX::V3::Environments::Client#deploy_flow. +# +def deploy_flow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest.new + + # Call the deploy_flow method. + result = client.deploy_flow request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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_v3_generated_Environments_DeployFlow_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/get_environment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/get_environment.rb new file mode 100644 index 000000000000..8ff377a13294 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Environments_GetEnvironment_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Environments::Client#get_environment. +# +def get_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest.new + + # Call the get_environment method. + result = client.get_environment request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Environment. + p result +end +# [END dialogflow_v3_generated_Environments_GetEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/list_continuous_test_results.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/list_continuous_test_results.rb new file mode 100644 index 000000000000..80c09617365c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/list_continuous_test_results.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_v3_generated_Environments_ListContinuousTestResults_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the list_continuous_test_results 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::CX::V3::Environments::Client#list_continuous_test_results. +# +def list_continuous_test_results + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest.new + + # Call the list_continuous_test_results method. + result = client.list_continuous_test_results request + + # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::ContinuousTestResult. + p item + end +end +# [END dialogflow_v3_generated_Environments_ListContinuousTestResults_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/list_environments.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/list_environments.rb new file mode 100644 index 000000000000..96701976be27 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Environments_ListEnvironments_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Environments::Client#list_environments. +# +def list_environments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Environment. + p item + end +end +# [END dialogflow_v3_generated_Environments_ListEnvironments_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/lookup_environment_history.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/lookup_environment_history.rb new file mode 100644 index 000000000000..25a30078458b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/lookup_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_v3_generated_Environments_LookupEnvironmentHistory_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the lookup_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::CX::V3::Environments::Client#lookup_environment_history. +# +def lookup_environment_history + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest.new + + # Call the lookup_environment_history method. + result = client.lookup_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::CX::V3::Environment. + p item + end +end +# [END dialogflow_v3_generated_Environments_LookupEnvironmentHistory_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/run_continuous_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/run_continuous_test.rb new file mode 100644 index 000000000000..a13e9221f982 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/run_continuous_test.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_v3_generated_Environments_RunContinuousTest_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the run_continuous_test 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::CX::V3::Environments::Client#run_continuous_test. +# +def run_continuous_test + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest.new + + # Call the run_continuous_test method. + result = client.run_continuous_test request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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_v3_generated_Environments_RunContinuousTest_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/update_environment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/update_environment.rb new file mode 100644 index 000000000000..c01169c65456 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/update_environment.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_v3_generated_Environments_UpdateEnvironment_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Environments::Client#update_environment. +# +def update_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest.new + + # Call the update_environment method. + result = client.update_environment request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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_v3_generated_Environments_UpdateEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/create_example.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/create_example.rb new file mode 100644 index 000000000000..42fa81f9d984 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/create_example.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_v3_generated_Examples_CreateExample_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the create_example call in the Examples service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Examples::Client#create_example. +# +def create_example + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Examples::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateExampleRequest.new + + # Call the create_example method. + result = client.create_example request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Example. + p result +end +# [END dialogflow_v3_generated_Examples_CreateExample_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/delete_example.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/delete_example.rb new file mode 100644 index 000000000000..f6f65ed8991c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/delete_example.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_v3_generated_Examples_DeleteExample_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the delete_example call in the Examples service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Examples::Client#delete_example. +# +def delete_example + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Examples::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeleteExampleRequest.new + + # Call the delete_example method. + result = client.delete_example request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v3_generated_Examples_DeleteExample_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/get_example.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/get_example.rb new file mode 100644 index 000000000000..a37afe022cbf --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/get_example.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_v3_generated_Examples_GetExample_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the get_example call in the Examples service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Examples::Client#get_example. +# +def get_example + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Examples::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetExampleRequest.new + + # Call the get_example method. + result = client.get_example request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Example. + p result +end +# [END dialogflow_v3_generated_Examples_GetExample_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/list_examples.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/list_examples.rb new file mode 100644 index 000000000000..1fe0ac039673 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/list_examples.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_v3_generated_Examples_ListExamples_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the list_examples call in the Examples service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Examples::Client#list_examples. +# +def list_examples + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Examples::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest.new + + # Call the list_examples method. + result = client.list_examples request + + # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Example. + p item + end +end +# [END dialogflow_v3_generated_Examples_ListExamples_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/update_example.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/update_example.rb new file mode 100644 index 000000000000..50319a0f39f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/update_example.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_v3_generated_Examples_UpdateExample_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the update_example call in the Examples service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Examples::Client#update_example. +# +def update_example + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Examples::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateExampleRequest.new + + # Call the update_example method. + result = client.update_example request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Example. + p result +end +# [END dialogflow_v3_generated_Examples_UpdateExample_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/create_experiment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/create_experiment.rb new file mode 100644 index 000000000000..2926ab20768e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/create_experiment.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_v3_generated_Experiments_CreateExperiment_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the create_experiment call in the Experiments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Experiments::Client#create_experiment. +# +def create_experiment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest.new + + # Call the create_experiment method. + result = client.create_experiment request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + p result +end +# [END dialogflow_v3_generated_Experiments_CreateExperiment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/delete_experiment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/delete_experiment.rb new file mode 100644 index 000000000000..36e1e6d5c785 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/delete_experiment.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_v3_generated_Experiments_DeleteExperiment_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the delete_experiment call in the Experiments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Experiments::Client#delete_experiment. +# +def delete_experiment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest.new + + # Call the delete_experiment method. + result = client.delete_experiment request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v3_generated_Experiments_DeleteExperiment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/get_experiment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/get_experiment.rb new file mode 100644 index 000000000000..33a286b517de --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/get_experiment.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_v3_generated_Experiments_GetExperiment_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the get_experiment call in the Experiments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Experiments::Client#get_experiment. +# +def get_experiment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest.new + + # Call the get_experiment method. + result = client.get_experiment request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + p result +end +# [END dialogflow_v3_generated_Experiments_GetExperiment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/list_experiments.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/list_experiments.rb new file mode 100644 index 000000000000..dd1b255ae666 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/list_experiments.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_v3_generated_Experiments_ListExperiments_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the list_experiments call in the Experiments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Experiments::Client#list_experiments. +# +def list_experiments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest.new + + # Call the list_experiments method. + result = client.list_experiments request + + # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Experiment. + p item + end +end +# [END dialogflow_v3_generated_Experiments_ListExperiments_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/start_experiment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/start_experiment.rb new file mode 100644 index 000000000000..1279deafbbd7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/start_experiment.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_v3_generated_Experiments_StartExperiment_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the start_experiment call in the Experiments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Experiments::Client#start_experiment. +# +def start_experiment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest.new + + # Call the start_experiment method. + result = client.start_experiment request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + p result +end +# [END dialogflow_v3_generated_Experiments_StartExperiment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/stop_experiment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/stop_experiment.rb new file mode 100644 index 000000000000..3d53a5719294 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/stop_experiment.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_v3_generated_Experiments_StopExperiment_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the stop_experiment call in the Experiments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Experiments::Client#stop_experiment. +# +def stop_experiment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest.new + + # Call the stop_experiment method. + result = client.stop_experiment request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + p result +end +# [END dialogflow_v3_generated_Experiments_StopExperiment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/update_experiment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/update_experiment.rb new file mode 100644 index 000000000000..d82b6c0fa751 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/update_experiment.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_v3_generated_Experiments_UpdateExperiment_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the update_experiment call in the Experiments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Experiments::Client#update_experiment. +# +def update_experiment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest.new + + # Call the update_experiment method. + result = client.update_experiment request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + p result +end +# [END dialogflow_v3_generated_Experiments_UpdateExperiment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/create_flow.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/create_flow.rb new file mode 100644 index 000000000000..a66d58ed9409 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/create_flow.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_v3_generated_Flows_CreateFlow_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the create_flow call in the Flows service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Flows::Client#create_flow. +# +def create_flow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest.new + + # Call the create_flow method. + result = client.create_flow request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. + p result +end +# [END dialogflow_v3_generated_Flows_CreateFlow_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/delete_flow.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/delete_flow.rb new file mode 100644 index 000000000000..d5b7f9487717 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/delete_flow.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_v3_generated_Flows_DeleteFlow_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the delete_flow call in the Flows service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Flows::Client#delete_flow. +# +def delete_flow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest.new + + # Call the delete_flow method. + result = client.delete_flow request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v3_generated_Flows_DeleteFlow_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/export_flow.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/export_flow.rb new file mode 100644 index 000000000000..12f4341e5d0c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/export_flow.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_v3_generated_Flows_ExportFlow_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the export_flow call in the Flows service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Flows::Client#export_flow. +# +def export_flow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest.new + + # Call the export_flow method. + result = client.export_flow request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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_v3_generated_Flows_ExportFlow_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow.rb new file mode 100644 index 000000000000..1e3c7a71bb60 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow.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_v3_generated_Flows_GetFlow_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the get_flow call in the Flows service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Flows::Client#get_flow. +# +def get_flow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetFlowRequest.new + + # Call the get_flow method. + result = client.get_flow request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. + p result +end +# [END dialogflow_v3_generated_Flows_GetFlow_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow_validation_result.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow_validation_result.rb new file mode 100644 index 000000000000..b4d34f485932 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow_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_v3_generated_Flows_GetFlowValidationResult_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the get_flow_validation_result call in the Flows service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Flows::Client#get_flow_validation_result. +# +def get_flow_validation_result + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest.new + + # Call the get_flow_validation_result method. + result = client.get_flow_validation_result request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FlowValidationResult. + p result +end +# [END dialogflow_v3_generated_Flows_GetFlowValidationResult_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/import_flow.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/import_flow.rb new file mode 100644 index 000000000000..1aed6e9924de --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/import_flow.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_v3_generated_Flows_ImportFlow_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the import_flow call in the Flows service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Flows::Client#import_flow. +# +def import_flow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest.new + + # Call the import_flow method. + result = client.import_flow request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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_v3_generated_Flows_ImportFlow_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/list_flows.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/list_flows.rb new file mode 100644 index 000000000000..375ca2789ab0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/list_flows.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_v3_generated_Flows_ListFlows_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the list_flows call in the Flows service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Flows::Client#list_flows. +# +def list_flows + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest.new + + # Call the list_flows method. + result = client.list_flows request + + # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Flow. + p item + end +end +# [END dialogflow_v3_generated_Flows_ListFlows_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/train_flow.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/train_flow.rb new file mode 100644 index 000000000000..865191b559c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/train_flow.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_v3_generated_Flows_TrainFlow_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the train_flow call in the Flows service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Flows::Client#train_flow. +# +def train_flow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest.new + + # Call the train_flow method. + result = client.train_flow request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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_v3_generated_Flows_TrainFlow_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/update_flow.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/update_flow.rb new file mode 100644 index 000000000000..86f322385938 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/update_flow.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_v3_generated_Flows_UpdateFlow_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the update_flow call in the Flows service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Flows::Client#update_flow. +# +def update_flow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest.new + + # Call the update_flow method. + result = client.update_flow request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. + p result +end +# [END dialogflow_v3_generated_Flows_UpdateFlow_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/validate_flow.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/validate_flow.rb new file mode 100644 index 000000000000..d4b01430be56 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/validate_flow.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_v3_generated_Flows_ValidateFlow_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the validate_flow call in the Flows service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Flows::Client#validate_flow. +# +def validate_flow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest.new + + # Call the validate_flow method. + result = client.validate_flow request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FlowValidationResult. + p result +end +# [END dialogflow_v3_generated_Flows_ValidateFlow_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/create_generator.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/create_generator.rb new file mode 100644 index 000000000000..4fda4c0102a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Generators_CreateGenerator_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Generators::Client#create_generator. +# +def create_generator + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Generators::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest.new + + # Call the create_generator method. + result = client.create_generator request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Generator. + p result +end +# [END dialogflow_v3_generated_Generators_CreateGenerator_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/delete_generator.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/delete_generator.rb new file mode 100644 index 000000000000..815d939d4230 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Generators_DeleteGenerator_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Generators::Client#delete_generator. +# +def delete_generator + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Generators::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::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_v3_generated_Generators_DeleteGenerator_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/get_generator.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/get_generator.rb new file mode 100644 index 000000000000..96344e19d99c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Generators_GetGenerator_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Generators::Client#get_generator. +# +def get_generator + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Generators::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest.new + + # Call the get_generator method. + result = client.get_generator request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Generator. + p result +end +# [END dialogflow_v3_generated_Generators_GetGenerator_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/list_generators.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/list_generators.rb new file mode 100644 index 000000000000..cf87578466f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Generators_ListGenerators_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Generators::Client#list_generators. +# +def list_generators + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Generators::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Generator. + p item + end +end +# [END dialogflow_v3_generated_Generators_ListGenerators_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/update_generator.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/update_generator.rb new file mode 100644 index 000000000000..24ac684e840b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Generators_UpdateGenerator_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Generators::Client#update_generator. +# +def update_generator + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Generators::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest.new + + # Call the update_generator method. + result = client.update_generator request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Generator. + p result +end +# [END dialogflow_v3_generated_Generators_UpdateGenerator_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/create_intent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/create_intent.rb new file mode 100644 index 000000000000..aa6d4100c53b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Intents_CreateIntent_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Intents::Client#create_intent. +# +def create_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest.new + + # Call the create_intent method. + result = client.create_intent request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Intent. + p result +end +# [END dialogflow_v3_generated_Intents_CreateIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/delete_intent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/delete_intent.rb new file mode 100644 index 000000000000..dafa20750bdf --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Intents_DeleteIntent_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Intents::Client#delete_intent. +# +def delete_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::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_v3_generated_Intents_DeleteIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/export_intents.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/export_intents.rb new file mode 100644 index 000000000000..893da025b132 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/export_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_v3_generated_Intents_ExportIntents_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the export_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::CX::V3::Intents::Client#export_intents. +# +def export_intents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest.new + + # Call the export_intents method. + result = client.export_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_v3_generated_Intents_ExportIntents_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/get_intent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/get_intent.rb new file mode 100644 index 000000000000..73a3d873df2c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Intents_GetIntent_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Intents::Client#get_intent. +# +def get_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetIntentRequest.new + + # Call the get_intent method. + result = client.get_intent request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Intent. + p result +end +# [END dialogflow_v3_generated_Intents_GetIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/import_intents.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/import_intents.rb new file mode 100644 index 000000000000..c842dc082d4f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/import_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_v3_generated_Intents_ImportIntents_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the import_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::CX::V3::Intents::Client#import_intents. +# +def import_intents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest.new + + # Call the import_intents method. + result = client.import_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_v3_generated_Intents_ImportIntents_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/list_intents.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/list_intents.rb new file mode 100644 index 000000000000..6c354c11a23c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Intents_ListIntents_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Intents::Client#list_intents. +# +def list_intents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Intent. + p item + end +end +# [END dialogflow_v3_generated_Intents_ListIntents_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/update_intent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/update_intent.rb new file mode 100644 index 000000000000..c47ee7bac094 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Intents_UpdateIntent_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Intents::Client#update_intent. +# +def update_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest.new + + # Call the update_intent method. + result = client.update_intent request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Intent. + p result +end +# [END dialogflow_v3_generated_Intents_UpdateIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/create_page.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/create_page.rb new file mode 100644 index 000000000000..1f8bf8b0526f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/create_page.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_v3_generated_Pages_CreatePage_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the create_page call in the Pages service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Pages::Client#create_page. +# +def create_page + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreatePageRequest.new + + # Call the create_page method. + result = client.create_page request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. + p result +end +# [END dialogflow_v3_generated_Pages_CreatePage_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/delete_page.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/delete_page.rb new file mode 100644 index 000000000000..045a38e147bf --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/delete_page.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_v3_generated_Pages_DeletePage_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the delete_page call in the Pages service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Pages::Client#delete_page. +# +def delete_page + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeletePageRequest.new + + # Call the delete_page method. + result = client.delete_page request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v3_generated_Pages_DeletePage_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/get_page.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/get_page.rb new file mode 100644 index 000000000000..899bea46dca0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/get_page.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_v3_generated_Pages_GetPage_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the get_page call in the Pages service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Pages::Client#get_page. +# +def get_page + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetPageRequest.new + + # Call the get_page method. + result = client.get_page request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. + p result +end +# [END dialogflow_v3_generated_Pages_GetPage_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/list_pages.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/list_pages.rb new file mode 100644 index 000000000000..761863e65cce --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/list_pages.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_v3_generated_Pages_ListPages_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the list_pages call in the Pages service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Pages::Client#list_pages. +# +def list_pages + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListPagesRequest.new + + # Call the list_pages method. + result = client.list_pages request + + # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Page. + p item + end +end +# [END dialogflow_v3_generated_Pages_ListPages_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/update_page.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/update_page.rb new file mode 100644 index 000000000000..bea306fd20ce --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/update_page.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_v3_generated_Pages_UpdatePage_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the update_page call in the Pages service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Pages::Client#update_page. +# +def update_page + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest.new + + # Call the update_page method. + result = client.update_page request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. + p result +end +# [END dialogflow_v3_generated_Pages_UpdatePage_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/create_playbook.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/create_playbook.rb new file mode 100644 index 000000000000..aadb5184a0f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/create_playbook.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_v3_generated_Playbooks_CreatePlaybook_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the create_playbook call in the Playbooks service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#create_playbook. +# +def create_playbook + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreatePlaybookRequest.new + + # Call the create_playbook method. + result = client.create_playbook request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Playbook. + p result +end +# [END dialogflow_v3_generated_Playbooks_CreatePlaybook_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/create_playbook_version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/create_playbook_version.rb new file mode 100644 index 000000000000..6430bdf07c88 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/create_playbook_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_v3_generated_Playbooks_CreatePlaybookVersion_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the create_playbook_version call in the Playbooks service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#create_playbook_version. +# +def create_playbook_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreatePlaybookVersionRequest.new + + # Call the create_playbook_version method. + result = client.create_playbook_version request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::PlaybookVersion. + p result +end +# [END dialogflow_v3_generated_Playbooks_CreatePlaybookVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/delete_playbook.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/delete_playbook.rb new file mode 100644 index 000000000000..5ec83e6ae296 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/delete_playbook.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_v3_generated_Playbooks_DeletePlaybook_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the delete_playbook call in the Playbooks service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#delete_playbook. +# +def delete_playbook + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeletePlaybookRequest.new + + # Call the delete_playbook method. + result = client.delete_playbook request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v3_generated_Playbooks_DeletePlaybook_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/delete_playbook_version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/delete_playbook_version.rb new file mode 100644 index 000000000000..228e4c05eeea --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/delete_playbook_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_v3_generated_Playbooks_DeletePlaybookVersion_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the delete_playbook_version call in the Playbooks service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#delete_playbook_version. +# +def delete_playbook_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeletePlaybookVersionRequest.new + + # Call the delete_playbook_version method. + result = client.delete_playbook_version request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v3_generated_Playbooks_DeletePlaybookVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/export_playbook.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/export_playbook.rb new file mode 100644 index 000000000000..665867a36b5c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/export_playbook.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_v3_generated_Playbooks_ExportPlaybook_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the export_playbook call in the Playbooks service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#export_playbook. +# +def export_playbook + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest.new + + # Call the export_playbook method. + result = client.export_playbook request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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_v3_generated_Playbooks_ExportPlaybook_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/get_playbook.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/get_playbook.rb new file mode 100644 index 000000000000..12eeb274741a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/get_playbook.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_v3_generated_Playbooks_GetPlaybook_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the get_playbook call in the Playbooks service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#get_playbook. +# +def get_playbook + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetPlaybookRequest.new + + # Call the get_playbook method. + result = client.get_playbook request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Playbook. + p result +end +# [END dialogflow_v3_generated_Playbooks_GetPlaybook_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/get_playbook_version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/get_playbook_version.rb new file mode 100644 index 000000000000..3da23f039921 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/get_playbook_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_v3_generated_Playbooks_GetPlaybookVersion_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the get_playbook_version call in the Playbooks service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#get_playbook_version. +# +def get_playbook_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetPlaybookVersionRequest.new + + # Call the get_playbook_version method. + result = client.get_playbook_version request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::PlaybookVersion. + p result +end +# [END dialogflow_v3_generated_Playbooks_GetPlaybookVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/import_playbook.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/import_playbook.rb new file mode 100644 index 000000000000..97ae1400bd4d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/import_playbook.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_v3_generated_Playbooks_ImportPlaybook_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the import_playbook call in the Playbooks service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#import_playbook. +# +def import_playbook + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ImportPlaybookRequest.new + + # Call the import_playbook method. + result = client.import_playbook request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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_v3_generated_Playbooks_ImportPlaybook_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/list_playbook_versions.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/list_playbook_versions.rb new file mode 100644 index 000000000000..711c1e65469c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/list_playbook_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_v3_generated_Playbooks_ListPlaybookVersions_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the list_playbook_versions call in the Playbooks service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#list_playbook_versions. +# +def list_playbook_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsRequest.new + + # Call the list_playbook_versions method. + result = client.list_playbook_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::CX::V3::PlaybookVersion. + p item + end +end +# [END dialogflow_v3_generated_Playbooks_ListPlaybookVersions_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/list_playbooks.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/list_playbooks.rb new file mode 100644 index 000000000000..c8c366bcfe13 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/list_playbooks.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_v3_generated_Playbooks_ListPlaybooks_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the list_playbooks call in the Playbooks service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#list_playbooks. +# +def list_playbooks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListPlaybooksRequest.new + + # Call the list_playbooks method. + result = client.list_playbooks request + + # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Playbook. + p item + end +end +# [END dialogflow_v3_generated_Playbooks_ListPlaybooks_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/restore_playbook_version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/restore_playbook_version.rb new file mode 100644 index 000000000000..6d9c5e087447 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/restore_playbook_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_v3_generated_Playbooks_RestorePlaybookVersion_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the restore_playbook_version call in the Playbooks service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#restore_playbook_version. +# +def restore_playbook_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionRequest.new + + # Call the restore_playbook_version method. + result = client.restore_playbook_version request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionResponse. + p result +end +# [END dialogflow_v3_generated_Playbooks_RestorePlaybookVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/update_playbook.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/update_playbook.rb new file mode 100644 index 000000000000..1f93a5005b3f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/update_playbook.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_v3_generated_Playbooks_UpdatePlaybook_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the update_playbook call in the Playbooks service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#update_playbook. +# +def update_playbook + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdatePlaybookRequest.new + + # Call the update_playbook method. + result = client.update_playbook request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Playbook. + p result +end +# [END dialogflow_v3_generated_Playbooks_UpdatePlaybook_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/create_security_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/create_security_settings.rb new file mode 100644 index 000000000000..9d2e33ac0d6d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/create_security_settings.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_v3_generated_SecuritySettingsService_CreateSecuritySettings_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the create_security_settings call in the SecuritySettingsService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#create_security_settings. +# +def create_security_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest.new + + # Call the create_security_settings method. + result = client.create_security_settings request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. + p result +end +# [END dialogflow_v3_generated_SecuritySettingsService_CreateSecuritySettings_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/delete_security_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/delete_security_settings.rb new file mode 100644 index 000000000000..4654492300a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/delete_security_settings.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_v3_generated_SecuritySettingsService_DeleteSecuritySettings_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the delete_security_settings call in the SecuritySettingsService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#delete_security_settings. +# +def delete_security_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest.new + + # Call the delete_security_settings method. + result = client.delete_security_settings request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v3_generated_SecuritySettingsService_DeleteSecuritySettings_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/get_security_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/get_security_settings.rb new file mode 100644 index 000000000000..ea47f2995a50 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/get_security_settings.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_v3_generated_SecuritySettingsService_GetSecuritySettings_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the get_security_settings call in the SecuritySettingsService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#get_security_settings. +# +def get_security_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest.new + + # Call the get_security_settings method. + result = client.get_security_settings request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. + p result +end +# [END dialogflow_v3_generated_SecuritySettingsService_GetSecuritySettings_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/list_security_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/list_security_settings.rb new file mode 100644 index 000000000000..3b9b5610189d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/list_security_settings.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_v3_generated_SecuritySettingsService_ListSecuritySettings_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the list_security_settings call in the SecuritySettingsService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#list_security_settings. +# +def list_security_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest.new + + # Call the list_security_settings method. + result = client.list_security_settings request + + # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::SecuritySettings. + p item + end +end +# [END dialogflow_v3_generated_SecuritySettingsService_ListSecuritySettings_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/update_security_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/update_security_settings.rb new file mode 100644 index 000000000000..7d8c8b807796 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/update_security_settings.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_v3_generated_SecuritySettingsService_UpdateSecuritySettings_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the update_security_settings call in the SecuritySettingsService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#update_security_settings. +# +def update_security_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest.new + + # Call the update_security_settings method. + result = client.update_security_settings request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. + p result +end +# [END dialogflow_v3_generated_SecuritySettingsService_UpdateSecuritySettings_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/create_session_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/create_session_entity_type.rb new file mode 100644 index 000000000000..acf52fa33a09 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_SessionEntityTypes_CreateSessionEntityType_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::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::CX::V3::SessionEntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityType. + p result +end +# [END dialogflow_v3_generated_SessionEntityTypes_CreateSessionEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/delete_session_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/delete_session_entity_type.rb new file mode 100644 index 000000000000..749d8ced56da --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_SessionEntityTypes_DeleteSessionEntityType_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::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::CX::V3::SessionEntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::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_v3_generated_SessionEntityTypes_DeleteSessionEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/get_session_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/get_session_entity_type.rb new file mode 100644 index 000000000000..a739844a53e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_SessionEntityTypes_GetSessionEntityType_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::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::CX::V3::SessionEntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityType. + p result +end +# [END dialogflow_v3_generated_SessionEntityTypes_GetSessionEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/list_session_entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/list_session_entity_types.rb new file mode 100644 index 000000000000..98978b59f6fd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_SessionEntityTypes_ListSessionEntityTypes_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::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::CX::V3::SessionEntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityType. + p item + end +end +# [END dialogflow_v3_generated_SessionEntityTypes_ListSessionEntityTypes_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/update_session_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/update_session_entity_type.rb new file mode 100644 index 000000000000..0f62fdda9f61 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_SessionEntityTypes_UpdateSessionEntityType_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::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::CX::V3::SessionEntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityType. + p result +end +# [END dialogflow_v3_generated_SessionEntityTypes_UpdateSessionEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/detect_intent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/detect_intent.rb new file mode 100644 index 000000000000..4a3479b8e346 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Sessions_DetectIntent_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Sessions::Client#detect_intent. +# +def detect_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new + + # Call the detect_intent method. + result = client.detect_intent request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse. + p result +end +# [END dialogflow_v3_generated_Sessions_DetectIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/fulfill_intent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/fulfill_intent.rb new file mode 100644 index 000000000000..993db87c1414 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/fulfill_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_v3_generated_Sessions_FulfillIntent_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the fulfill_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::CX::V3::Sessions::Client#fulfill_intent. +# +def fulfill_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest.new + + # Call the fulfill_intent method. + result = client.fulfill_intent request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse. + p result +end +# [END dialogflow_v3_generated_Sessions_FulfillIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/match_intent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/match_intent.rb new file mode 100644 index 000000000000..d84752c23442 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/match_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_v3_generated_Sessions_MatchIntent_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the match_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::CX::V3::Sessions::Client#match_intent. +# +def match_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest.new + + # Call the match_intent method. + result = client.match_intent request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse. + p result +end +# [END dialogflow_v3_generated_Sessions_MatchIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/server_streaming_detect_intent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/server_streaming_detect_intent.rb new file mode 100644 index 000000000000..82bfeb6585e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/server_streaming_detect_intent.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dialogflow_v3_generated_Sessions_ServerStreamingDetectIntent_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the server_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::CX::V3::Sessions::Client#server_streaming_detect_intent. +# +def server_streaming_detect_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new + + # Call the server_streaming_detect_intent method to start streaming. + output = client.server_streaming_detect_intent request + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse + output.each do |current_response| + p current_response + end +end +# [END dialogflow_v3_generated_Sessions_ServerStreamingDetectIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/streaming_detect_intent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/streaming_detect_intent.rb new file mode 100644 index 000000000000..7269925f68cd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Sessions_StreamingDetectIntent_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::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::CX::V3::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::CX::V3::StreamingDetectIntentRequest.new + input << Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new + input.close + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentResponse + output.each do |current_response| + p current_response + end +end +# [END dialogflow_v3_generated_Sessions_StreamingDetectIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/submit_answer_feedback.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/submit_answer_feedback.rb new file mode 100644 index 000000000000..4b663f60ecb4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/submit_answer_feedback.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_v3_generated_Sessions_SubmitAnswerFeedback_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the submit_answer_feedback 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::CX::V3::Sessions::Client#submit_answer_feedback. +# +def submit_answer_feedback + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest.new + + # Call the submit_answer_feedback method. + result = client.submit_answer_feedback request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AnswerFeedback. + p result +end +# [END dialogflow_v3_generated_Sessions_SubmitAnswerFeedback_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/snippet_metadata_google.cloud.dialogflow.cx.v3.json b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/snippet_metadata_google.cloud.dialogflow.cx.v3.json new file mode 100644 index 000000000000..4e9f0e73ab9e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/snippet_metadata_google.cloud.dialogflow.cx.v3.json @@ -0,0 +1,5495 @@ +{ + "client_library": { + "name": "google-cloud-dialogflow-cx-v3", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.dialogflow.cx.v3", + "version": "v3" + } + ] + }, + "snippets": [ + { + "region_tag": "dialogflow_v3_generated_Pages_ListPages_sync", + "title": "Snippet for the list_pages call in the Pages service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Pages::Client#list_pages.", + "file": "pages/list_pages.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_pages", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client#list_pages", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListPagesResponse", + "client": { + "short_name": "Pages::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client" + }, + "method": { + "short_name": "ListPages", + "full_name": "google.cloud.dialogflow.cx.v3.Pages.ListPages", + "service": { + "short_name": "Pages", + "full_name": "google.cloud.dialogflow.cx.v3.Pages" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Pages_GetPage_sync", + "title": "Snippet for the get_page call in the Pages service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Pages::Client#get_page.", + "file": "pages/get_page.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_page", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client#get_page", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetPageRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Page", + "client": { + "short_name": "Pages::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client" + }, + "method": { + "short_name": "GetPage", + "full_name": "google.cloud.dialogflow.cx.v3.Pages.GetPage", + "service": { + "short_name": "Pages", + "full_name": "google.cloud.dialogflow.cx.v3.Pages" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Pages_CreatePage_sync", + "title": "Snippet for the create_page call in the Pages service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Pages::Client#create_page.", + "file": "pages/create_page.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_page", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client#create_page", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Page", + "client": { + "short_name": "Pages::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client" + }, + "method": { + "short_name": "CreatePage", + "full_name": "google.cloud.dialogflow.cx.v3.Pages.CreatePage", + "service": { + "short_name": "Pages", + "full_name": "google.cloud.dialogflow.cx.v3.Pages" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Pages_UpdatePage_sync", + "title": "Snippet for the update_page call in the Pages service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Pages::Client#update_page.", + "file": "pages/update_page.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_page", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client#update_page", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Page", + "client": { + "short_name": "Pages::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client" + }, + "method": { + "short_name": "UpdatePage", + "full_name": "google.cloud.dialogflow.cx.v3.Pages.UpdatePage", + "service": { + "short_name": "Pages", + "full_name": "google.cloud.dialogflow.cx.v3.Pages" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Pages_DeletePage_sync", + "title": "Snippet for the delete_page call in the Pages service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Pages::Client#delete_page.", + "file": "pages/delete_page.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_page", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client#delete_page", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Pages::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client" + }, + "method": { + "short_name": "DeletePage", + "full_name": "google.cloud.dialogflow.cx.v3.Pages.DeletePage", + "service": { + "short_name": "Pages", + "full_name": "google.cloud.dialogflow.cx.v3.Pages" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Flows_CreateFlow_sync", + "title": "Snippet for the create_flow call in the Flows service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Flows::Client#create_flow.", + "file": "flows/create_flow.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_flow", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client#create_flow", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Flow", + "client": { + "short_name": "Flows::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client" + }, + "method": { + "short_name": "CreateFlow", + "full_name": "google.cloud.dialogflow.cx.v3.Flows.CreateFlow", + "service": { + "short_name": "Flows", + "full_name": "google.cloud.dialogflow.cx.v3.Flows" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Flows_DeleteFlow_sync", + "title": "Snippet for the delete_flow call in the Flows service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Flows::Client#delete_flow.", + "file": "flows/delete_flow.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_flow", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client#delete_flow", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Flows::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client" + }, + "method": { + "short_name": "DeleteFlow", + "full_name": "google.cloud.dialogflow.cx.v3.Flows.DeleteFlow", + "service": { + "short_name": "Flows", + "full_name": "google.cloud.dialogflow.cx.v3.Flows" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Flows_ListFlows_sync", + "title": "Snippet for the list_flows call in the Flows service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Flows::Client#list_flows.", + "file": "flows/list_flows.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_flows", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client#list_flows", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListFlowsResponse", + "client": { + "short_name": "Flows::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client" + }, + "method": { + "short_name": "ListFlows", + "full_name": "google.cloud.dialogflow.cx.v3.Flows.ListFlows", + "service": { + "short_name": "Flows", + "full_name": "google.cloud.dialogflow.cx.v3.Flows" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Flows_GetFlow_sync", + "title": "Snippet for the get_flow call in the Flows service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Flows::Client#get_flow.", + "file": "flows/get_flow.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_flow", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client#get_flow", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Flow", + "client": { + "short_name": "Flows::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client" + }, + "method": { + "short_name": "GetFlow", + "full_name": "google.cloud.dialogflow.cx.v3.Flows.GetFlow", + "service": { + "short_name": "Flows", + "full_name": "google.cloud.dialogflow.cx.v3.Flows" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Flows_UpdateFlow_sync", + "title": "Snippet for the update_flow call in the Flows service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Flows::Client#update_flow.", + "file": "flows/update_flow.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_flow", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client#update_flow", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Flow", + "client": { + "short_name": "Flows::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client" + }, + "method": { + "short_name": "UpdateFlow", + "full_name": "google.cloud.dialogflow.cx.v3.Flows.UpdateFlow", + "service": { + "short_name": "Flows", + "full_name": "google.cloud.dialogflow.cx.v3.Flows" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Flows_TrainFlow_sync", + "title": "Snippet for the train_flow call in the Flows service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Flows::Client#train_flow.", + "file": "flows/train_flow.rb", + "language": "RUBY", + "client_method": { + "short_name": "train_flow", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client#train_flow", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Flows::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client" + }, + "method": { + "short_name": "TrainFlow", + "full_name": "google.cloud.dialogflow.cx.v3.Flows.TrainFlow", + "service": { + "short_name": "Flows", + "full_name": "google.cloud.dialogflow.cx.v3.Flows" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Flows_ValidateFlow_sync", + "title": "Snippet for the validate_flow call in the Flows service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Flows::Client#validate_flow.", + "file": "flows/validate_flow.rb", + "language": "RUBY", + "client_method": { + "short_name": "validate_flow", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client#validate_flow", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult", + "client": { + "short_name": "Flows::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client" + }, + "method": { + "short_name": "ValidateFlow", + "full_name": "google.cloud.dialogflow.cx.v3.Flows.ValidateFlow", + "service": { + "short_name": "Flows", + "full_name": "google.cloud.dialogflow.cx.v3.Flows" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Flows_GetFlowValidationResult_sync", + "title": "Snippet for the get_flow_validation_result call in the Flows service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Flows::Client#get_flow_validation_result.", + "file": "flows/get_flow_validation_result.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_flow_validation_result", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client#get_flow_validation_result", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult", + "client": { + "short_name": "Flows::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client" + }, + "method": { + "short_name": "GetFlowValidationResult", + "full_name": "google.cloud.dialogflow.cx.v3.Flows.GetFlowValidationResult", + "service": { + "short_name": "Flows", + "full_name": "google.cloud.dialogflow.cx.v3.Flows" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Flows_ImportFlow_sync", + "title": "Snippet for the import_flow call in the Flows service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Flows::Client#import_flow.", + "file": "flows/import_flow.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_flow", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client#import_flow", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Flows::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client" + }, + "method": { + "short_name": "ImportFlow", + "full_name": "google.cloud.dialogflow.cx.v3.Flows.ImportFlow", + "service": { + "short_name": "Flows", + "full_name": "google.cloud.dialogflow.cx.v3.Flows" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Flows_ExportFlow_sync", + "title": "Snippet for the export_flow call in the Flows service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Flows::Client#export_flow.", + "file": "flows/export_flow.rb", + "language": "RUBY", + "client_method": { + "short_name": "export_flow", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client#export_flow", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Flows::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client" + }, + "method": { + "short_name": "ExportFlow", + "full_name": "google.cloud.dialogflow.cx.v3.Flows.ExportFlow", + "service": { + "short_name": "Flows", + "full_name": "google.cloud.dialogflow.cx.v3.Flows" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Agents_ListAgents_sync", + "title": "Snippet for the list_agents call in the Agents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Agents::Client#list_agents.", + "file": "agents/list_agents.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_agents", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#list_agents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListAgentsResponse", + "client": { + "short_name": "Agents::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" + }, + "method": { + "short_name": "ListAgents", + "full_name": "google.cloud.dialogflow.cx.v3.Agents.ListAgents", + "service": { + "short_name": "Agents", + "full_name": "google.cloud.dialogflow.cx.v3.Agents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Agents::Client#get_agent.", + "file": "agents/get_agent.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_agent", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#get_agent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetAgentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Agent", + "client": { + "short_name": "Agents::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" + }, + "method": { + "short_name": "GetAgent", + "full_name": "google.cloud.dialogflow.cx.v3.Agents.GetAgent", + "service": { + "short_name": "Agents", + "full_name": "google.cloud.dialogflow.cx.v3.Agents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Agents_CreateAgent_sync", + "title": "Snippet for the create_agent call in the Agents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Agents::Client#create_agent.", + "file": "agents/create_agent.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_agent", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#create_agent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Agent", + "client": { + "short_name": "Agents::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" + }, + "method": { + "short_name": "CreateAgent", + "full_name": "google.cloud.dialogflow.cx.v3.Agents.CreateAgent", + "service": { + "short_name": "Agents", + "full_name": "google.cloud.dialogflow.cx.v3.Agents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Agents_UpdateAgent_sync", + "title": "Snippet for the update_agent call in the Agents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Agents::Client#update_agent.", + "file": "agents/update_agent.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_agent", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#update_agent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Agent", + "client": { + "short_name": "Agents::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" + }, + "method": { + "short_name": "UpdateAgent", + "full_name": "google.cloud.dialogflow.cx.v3.Agents.UpdateAgent", + "service": { + "short_name": "Agents", + "full_name": "google.cloud.dialogflow.cx.v3.Agents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Agents::Client#delete_agent.", + "file": "agents/delete_agent.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_agent", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#delete_agent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteAgentRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Agents::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" + }, + "method": { + "short_name": "DeleteAgent", + "full_name": "google.cloud.dialogflow.cx.v3.Agents.DeleteAgent", + "service": { + "short_name": "Agents", + "full_name": "google.cloud.dialogflow.cx.v3.Agents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Agents::Client#export_agent.", + "file": "agents/export_agent.rb", + "language": "RUBY", + "client_method": { + "short_name": "export_agent", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#export_agent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Agents::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" + }, + "method": { + "short_name": "ExportAgent", + "full_name": "google.cloud.dialogflow.cx.v3.Agents.ExportAgent", + "service": { + "short_name": "Agents", + "full_name": "google.cloud.dialogflow.cx.v3.Agents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Agents::Client#restore_agent.", + "file": "agents/restore_agent.rb", + "language": "RUBY", + "client_method": { + "short_name": "restore_agent", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#restore_agent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Agents::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" + }, + "method": { + "short_name": "RestoreAgent", + "full_name": "google.cloud.dialogflow.cx.v3.Agents.RestoreAgent", + "service": { + "short_name": "Agents", + "full_name": "google.cloud.dialogflow.cx.v3.Agents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Agents_ValidateAgent_sync", + "title": "Snippet for the validate_agent call in the Agents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Agents::Client#validate_agent.", + "file": "agents/validate_agent.rb", + "language": "RUBY", + "client_method": { + "short_name": "validate_agent", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#validate_agent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult", + "client": { + "short_name": "Agents::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" + }, + "method": { + "short_name": "ValidateAgent", + "full_name": "google.cloud.dialogflow.cx.v3.Agents.ValidateAgent", + "service": { + "short_name": "Agents", + "full_name": "google.cloud.dialogflow.cx.v3.Agents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Agents_GetAgentValidationResult_sync", + "title": "Snippet for the get_agent_validation_result call in the Agents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Agents::Client#get_agent_validation_result.", + "file": "agents/get_agent_validation_result.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_agent_validation_result", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#get_agent_validation_result", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult", + "client": { + "short_name": "Agents::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" + }, + "method": { + "short_name": "GetAgentValidationResult", + "full_name": "google.cloud.dialogflow.cx.v3.Agents.GetAgentValidationResult", + "service": { + "short_name": "Agents", + "full_name": "google.cloud.dialogflow.cx.v3.Agents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Agents_GetGenerativeSettings_sync", + "title": "Snippet for the get_generative_settings call in the Agents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Agents::Client#get_generative_settings.", + "file": "agents/get_generative_settings.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_generative_settings", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#get_generative_settings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings", + "client": { + "short_name": "Agents::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" + }, + "method": { + "short_name": "GetGenerativeSettings", + "full_name": "google.cloud.dialogflow.cx.v3.Agents.GetGenerativeSettings", + "service": { + "short_name": "Agents", + "full_name": "google.cloud.dialogflow.cx.v3.Agents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Agents_UpdateGenerativeSettings_sync", + "title": "Snippet for the update_generative_settings call in the Agents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Agents::Client#update_generative_settings.", + "file": "agents/update_generative_settings.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_generative_settings", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#update_generative_settings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings", + "client": { + "short_name": "Agents::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" + }, + "method": { + "short_name": "UpdateGenerativeSettings", + "full_name": "google.cloud.dialogflow.cx.v3.Agents.UpdateGenerativeSettings", + "service": { + "short_name": "Agents", + "full_name": "google.cloud.dialogflow.cx.v3.Agents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Changelogs_ListChangelogs_sync", + "title": "Snippet for the list_changelogs call in the Changelogs service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Changelogs::Client#list_changelogs.", + "file": "changelogs/list_changelogs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_changelogs", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client#list_changelogs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListChangelogsResponse", + "client": { + "short_name": "Changelogs::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client" + }, + "method": { + "short_name": "ListChangelogs", + "full_name": "google.cloud.dialogflow.cx.v3.Changelogs.ListChangelogs", + "service": { + "short_name": "Changelogs", + "full_name": "google.cloud.dialogflow.cx.v3.Changelogs" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Changelogs_GetChangelog_sync", + "title": "Snippet for the get_changelog call in the Changelogs service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Changelogs::Client#get_changelog.", + "file": "changelogs/get_changelog.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_changelog", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client#get_changelog", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Changelog", + "client": { + "short_name": "Changelogs::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client" + }, + "method": { + "short_name": "GetChangelog", + "full_name": "google.cloud.dialogflow.cx.v3.Changelogs.GetChangelog", + "service": { + "short_name": "Changelogs", + "full_name": "google.cloud.dialogflow.cx.v3.Changelogs" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Deployments_ListDeployments_sync", + "title": "Snippet for the list_deployments call in the Deployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Deployments::Client#list_deployments.", + "file": "deployments/list_deployments.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_deployments", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Deployments::Client#list_deployments", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsResponse", + "client": { + "short_name": "Deployments::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Deployments::Client" + }, + "method": { + "short_name": "ListDeployments", + "full_name": "google.cloud.dialogflow.cx.v3.Deployments.ListDeployments", + "service": { + "short_name": "Deployments", + "full_name": "google.cloud.dialogflow.cx.v3.Deployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Deployments_GetDeployment_sync", + "title": "Snippet for the get_deployment call in the Deployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Deployments::Client#get_deployment.", + "file": "deployments/get_deployment.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_deployment", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Deployments::Client#get_deployment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Deployment", + "client": { + "short_name": "Deployments::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Deployments::Client" + }, + "method": { + "short_name": "GetDeployment", + "full_name": "google.cloud.dialogflow.cx.v3.Deployments.GetDeployment", + "service": { + "short_name": "Deployments", + "full_name": "google.cloud.dialogflow.cx.v3.Deployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::EntityTypes::Client#get_entity_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetEntityTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::EntityType", + "client": { + "short_name": "EntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client" + }, + "method": { + "short_name": "GetEntityType", + "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes.GetEntityType", + "service": { + "short_name": "EntityTypes", + "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::EntityTypes::Client#create_entity_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::EntityType", + "client": { + "short_name": "EntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client" + }, + "method": { + "short_name": "CreateEntityType", + "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes.CreateEntityType", + "service": { + "short_name": "EntityTypes", + "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::EntityTypes::Client#update_entity_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::EntityType", + "client": { + "short_name": "EntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client" + }, + "method": { + "short_name": "UpdateEntityType", + "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes.UpdateEntityType", + "service": { + "short_name": "EntityTypes", + "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::EntityTypes::Client#delete_entity_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "EntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client" + }, + "method": { + "short_name": "DeleteEntityType", + "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes.DeleteEntityType", + "service": { + "short_name": "EntityTypes", + "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::EntityTypes::Client#list_entity_types", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesResponse", + "client": { + "short_name": "EntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client" + }, + "method": { + "short_name": "ListEntityTypes", + "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes.ListEntityTypes", + "service": { + "short_name": "EntityTypes", + "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_EntityTypes_ExportEntityTypes_sync", + "title": "Snippet for the export_entity_types call in the EntityTypes service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#export_entity_types.", + "file": "entity_types/export_entity_types.rb", + "language": "RUBY", + "client_method": { + "short_name": "export_entity_types", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#export_entity_types", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "EntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client" + }, + "method": { + "short_name": "ExportEntityTypes", + "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes.ExportEntityTypes", + "service": { + "short_name": "EntityTypes", + "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_EntityTypes_ImportEntityTypes_sync", + "title": "Snippet for the import_entity_types call in the EntityTypes service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#import_entity_types.", + "file": "entity_types/import_entity_types.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_entity_types", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#import_entity_types", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "EntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client" + }, + "method": { + "short_name": "ImportEntityTypes", + "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes.ImportEntityTypes", + "service": { + "short_name": "EntityTypes", + "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Intents::Client#list_intents.", + "file": "intents/list_intents.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_intents", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client#list_intents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListIntentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListIntentsResponse", + "client": { + "short_name": "Intents::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client" + }, + "method": { + "short_name": "ListIntents", + "full_name": "google.cloud.dialogflow.cx.v3.Intents.ListIntents", + "service": { + "short_name": "Intents", + "full_name": "google.cloud.dialogflow.cx.v3.Intents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Intents::Client#get_intent.", + "file": "intents/get_intent.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_intent", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client#get_intent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetIntentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Intent", + "client": { + "short_name": "Intents::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client" + }, + "method": { + "short_name": "GetIntent", + "full_name": "google.cloud.dialogflow.cx.v3.Intents.GetIntent", + "service": { + "short_name": "Intents", + "full_name": "google.cloud.dialogflow.cx.v3.Intents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Intents::Client#create_intent.", + "file": "intents/create_intent.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_intent", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client#create_intent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Intent", + "client": { + "short_name": "Intents::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client" + }, + "method": { + "short_name": "CreateIntent", + "full_name": "google.cloud.dialogflow.cx.v3.Intents.CreateIntent", + "service": { + "short_name": "Intents", + "full_name": "google.cloud.dialogflow.cx.v3.Intents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Intents::Client#update_intent.", + "file": "intents/update_intent.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_intent", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client#update_intent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Intent", + "client": { + "short_name": "Intents::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client" + }, + "method": { + "short_name": "UpdateIntent", + "full_name": "google.cloud.dialogflow.cx.v3.Intents.UpdateIntent", + "service": { + "short_name": "Intents", + "full_name": "google.cloud.dialogflow.cx.v3.Intents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Intents::Client#delete_intent.", + "file": "intents/delete_intent.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_intent", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client#delete_intent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteIntentRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Intents::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client" + }, + "method": { + "short_name": "DeleteIntent", + "full_name": "google.cloud.dialogflow.cx.v3.Intents.DeleteIntent", + "service": { + "short_name": "Intents", + "full_name": "google.cloud.dialogflow.cx.v3.Intents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Intents_ImportIntents_sync", + "title": "Snippet for the import_intents call in the Intents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Intents::Client#import_intents.", + "file": "intents/import_intents.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_intents", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client#import_intents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Intents::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client" + }, + "method": { + "short_name": "ImportIntents", + "full_name": "google.cloud.dialogflow.cx.v3.Intents.ImportIntents", + "service": { + "short_name": "Intents", + "full_name": "google.cloud.dialogflow.cx.v3.Intents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Intents_ExportIntents_sync", + "title": "Snippet for the export_intents call in the Intents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Intents::Client#export_intents.", + "file": "intents/export_intents.rb", + "language": "RUBY", + "client_method": { + "short_name": "export_intents", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client#export_intents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Intents::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client" + }, + "method": { + "short_name": "ExportIntents", + "full_name": "google.cloud.dialogflow.cx.v3.Intents.ExportIntents", + "service": { + "short_name": "Intents", + "full_name": "google.cloud.dialogflow.cx.v3.Intents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::SessionEntityTypes::Client#list_session_entity_types", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListSessionEntityTypesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListSessionEntityTypesResponse", + "client": { + "short_name": "SessionEntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client" + }, + "method": { + "short_name": "ListSessionEntityTypes", + "full_name": "google.cloud.dialogflow.cx.v3.SessionEntityTypes.ListSessionEntityTypes", + "service": { + "short_name": "SessionEntityTypes", + "full_name": "google.cloud.dialogflow.cx.v3.SessionEntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::SessionEntityTypes::Client#get_session_entity_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetSessionEntityTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::SessionEntityType", + "client": { + "short_name": "SessionEntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client" + }, + "method": { + "short_name": "GetSessionEntityType", + "full_name": "google.cloud.dialogflow.cx.v3.SessionEntityTypes.GetSessionEntityType", + "service": { + "short_name": "SessionEntityTypes", + "full_name": "google.cloud.dialogflow.cx.v3.SessionEntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::SessionEntityTypes::Client#create_session_entity_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreateSessionEntityTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::SessionEntityType", + "client": { + "short_name": "SessionEntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client" + }, + "method": { + "short_name": "CreateSessionEntityType", + "full_name": "google.cloud.dialogflow.cx.v3.SessionEntityTypes.CreateSessionEntityType", + "service": { + "short_name": "SessionEntityTypes", + "full_name": "google.cloud.dialogflow.cx.v3.SessionEntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::SessionEntityTypes::Client#update_session_entity_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateSessionEntityTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::SessionEntityType", + "client": { + "short_name": "SessionEntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client" + }, + "method": { + "short_name": "UpdateSessionEntityType", + "full_name": "google.cloud.dialogflow.cx.v3.SessionEntityTypes.UpdateSessionEntityType", + "service": { + "short_name": "SessionEntityTypes", + "full_name": "google.cloud.dialogflow.cx.v3.SessionEntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::SessionEntityTypes::Client#delete_session_entity_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteSessionEntityTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SessionEntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client" + }, + "method": { + "short_name": "DeleteSessionEntityType", + "full_name": "google.cloud.dialogflow.cx.v3.SessionEntityTypes.DeleteSessionEntityType", + "service": { + "short_name": "SessionEntityTypes", + "full_name": "google.cloud.dialogflow.cx.v3.SessionEntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Sessions::Client#detect_intent.", + "file": "sessions/detect_intent.rb", + "language": "RUBY", + "client_method": { + "short_name": "detect_intent", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#detect_intent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse", + "client": { + "short_name": "Sessions::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client" + }, + "method": { + "short_name": "DetectIntent", + "full_name": "google.cloud.dialogflow.cx.v3.Sessions.DetectIntent", + "service": { + "short_name": "Sessions", + "full_name": "google.cloud.dialogflow.cx.v3.Sessions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Sessions_ServerStreamingDetectIntent_sync", + "title": "Snippet for the server_streaming_detect_intent call in the Sessions service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Sessions::Client#server_streaming_detect_intent.", + "file": "sessions/server_streaming_detect_intent.rb", + "language": "RUBY", + "client_method": { + "short_name": "server_streaming_detect_intent", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#server_streaming_detect_intent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse", + "client": { + "short_name": "Sessions::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client" + }, + "method": { + "short_name": "ServerStreamingDetectIntent", + "full_name": "google.cloud.dialogflow.cx.v3.Sessions.ServerStreamingDetectIntent", + "service": { + "short_name": "Sessions", + "full_name": "google.cloud.dialogflow.cx.v3.Sessions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 49, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::Sessions::Client#streaming_detect_intent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentResponse", + "client": { + "short_name": "Sessions::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client" + }, + "method": { + "short_name": "StreamingDetectIntent", + "full_name": "google.cloud.dialogflow.cx.v3.Sessions.StreamingDetectIntent", + "service": { + "short_name": "Sessions", + "full_name": "google.cloud.dialogflow.cx.v3.Sessions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 55, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Sessions_MatchIntent_sync", + "title": "Snippet for the match_intent call in the Sessions service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Sessions::Client#match_intent.", + "file": "sessions/match_intent.rb", + "language": "RUBY", + "client_method": { + "short_name": "match_intent", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#match_intent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse", + "client": { + "short_name": "Sessions::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client" + }, + "method": { + "short_name": "MatchIntent", + "full_name": "google.cloud.dialogflow.cx.v3.Sessions.MatchIntent", + "service": { + "short_name": "Sessions", + "full_name": "google.cloud.dialogflow.cx.v3.Sessions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Sessions_FulfillIntent_sync", + "title": "Snippet for the fulfill_intent call in the Sessions service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Sessions::Client#fulfill_intent.", + "file": "sessions/fulfill_intent.rb", + "language": "RUBY", + "client_method": { + "short_name": "fulfill_intent", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#fulfill_intent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse", + "client": { + "short_name": "Sessions::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client" + }, + "method": { + "short_name": "FulfillIntent", + "full_name": "google.cloud.dialogflow.cx.v3.Sessions.FulfillIntent", + "service": { + "short_name": "Sessions", + "full_name": "google.cloud.dialogflow.cx.v3.Sessions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Sessions_SubmitAnswerFeedback_sync", + "title": "Snippet for the submit_answer_feedback call in the Sessions service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Sessions::Client#submit_answer_feedback.", + "file": "sessions/submit_answer_feedback.rb", + "language": "RUBY", + "client_method": { + "short_name": "submit_answer_feedback", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#submit_answer_feedback", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback", + "client": { + "short_name": "Sessions::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client" + }, + "method": { + "short_name": "SubmitAnswerFeedback", + "full_name": "google.cloud.dialogflow.cx.v3.Sessions.SubmitAnswerFeedback", + "service": { + "short_name": "Sessions", + "full_name": "google.cloud.dialogflow.cx.v3.Sessions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_TransitionRouteGroups_ListTransitionRouteGroups_sync", + "title": "Snippet for the list_transition_route_groups call in the TransitionRouteGroups service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#list_transition_route_groups.", + "file": "transition_route_groups/list_transition_route_groups.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_transition_route_groups", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#list_transition_route_groups", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsResponse", + "client": { + "short_name": "TransitionRouteGroups::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client" + }, + "method": { + "short_name": "ListTransitionRouteGroups", + "full_name": "google.cloud.dialogflow.cx.v3.TransitionRouteGroups.ListTransitionRouteGroups", + "service": { + "short_name": "TransitionRouteGroups", + "full_name": "google.cloud.dialogflow.cx.v3.TransitionRouteGroups" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_TransitionRouteGroups_GetTransitionRouteGroup_sync", + "title": "Snippet for the get_transition_route_group call in the TransitionRouteGroups service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#get_transition_route_group.", + "file": "transition_route_groups/get_transition_route_group.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_transition_route_group", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#get_transition_route_group", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup", + "client": { + "short_name": "TransitionRouteGroups::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client" + }, + "method": { + "short_name": "GetTransitionRouteGroup", + "full_name": "google.cloud.dialogflow.cx.v3.TransitionRouteGroups.GetTransitionRouteGroup", + "service": { + "short_name": "TransitionRouteGroups", + "full_name": "google.cloud.dialogflow.cx.v3.TransitionRouteGroups" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_TransitionRouteGroups_CreateTransitionRouteGroup_sync", + "title": "Snippet for the create_transition_route_group call in the TransitionRouteGroups service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#create_transition_route_group.", + "file": "transition_route_groups/create_transition_route_group.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_transition_route_group", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#create_transition_route_group", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup", + "client": { + "short_name": "TransitionRouteGroups::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client" + }, + "method": { + "short_name": "CreateTransitionRouteGroup", + "full_name": "google.cloud.dialogflow.cx.v3.TransitionRouteGroups.CreateTransitionRouteGroup", + "service": { + "short_name": "TransitionRouteGroups", + "full_name": "google.cloud.dialogflow.cx.v3.TransitionRouteGroups" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_sync", + "title": "Snippet for the update_transition_route_group call in the TransitionRouteGroups service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#update_transition_route_group.", + "file": "transition_route_groups/update_transition_route_group.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_transition_route_group", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#update_transition_route_group", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup", + "client": { + "short_name": "TransitionRouteGroups::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client" + }, + "method": { + "short_name": "UpdateTransitionRouteGroup", + "full_name": "google.cloud.dialogflow.cx.v3.TransitionRouteGroups.UpdateTransitionRouteGroup", + "service": { + "short_name": "TransitionRouteGroups", + "full_name": "google.cloud.dialogflow.cx.v3.TransitionRouteGroups" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_sync", + "title": "Snippet for the delete_transition_route_group call in the TransitionRouteGroups service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#delete_transition_route_group.", + "file": "transition_route_groups/delete_transition_route_group.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_transition_route_group", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#delete_transition_route_group", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "TransitionRouteGroups::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client" + }, + "method": { + "short_name": "DeleteTransitionRouteGroup", + "full_name": "google.cloud.dialogflow.cx.v3.TransitionRouteGroups.DeleteTransitionRouteGroup", + "service": { + "short_name": "TransitionRouteGroups", + "full_name": "google.cloud.dialogflow.cx.v3.TransitionRouteGroups" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_TestCases_ListTestCases_sync", + "title": "Snippet for the list_test_cases call in the TestCases service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_cases.", + "file": "test_cases/list_test_cases.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_test_cases", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_cases", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListTestCasesResponse", + "client": { + "short_name": "TestCases::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" + }, + "method": { + "short_name": "ListTestCases", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases.ListTestCases", + "service": { + "short_name": "TestCases", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_TestCases_BatchDeleteTestCases_sync", + "title": "Snippet for the batch_delete_test_cases call in the TestCases service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_delete_test_cases.", + "file": "test_cases/batch_delete_test_cases.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_delete_test_cases", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_delete_test_cases", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "TestCases::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" + }, + "method": { + "short_name": "BatchDeleteTestCases", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases.BatchDeleteTestCases", + "service": { + "short_name": "TestCases", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_TestCases_GetTestCase_sync", + "title": "Snippet for the get_test_case call in the TestCases service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#get_test_case.", + "file": "test_cases/get_test_case.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_test_case", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#get_test_case", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::TestCase", + "client": { + "short_name": "TestCases::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" + }, + "method": { + "short_name": "GetTestCase", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases.GetTestCase", + "service": { + "short_name": "TestCases", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_TestCases_CreateTestCase_sync", + "title": "Snippet for the create_test_case call in the TestCases service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#create_test_case.", + "file": "test_cases/create_test_case.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_test_case", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#create_test_case", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::TestCase", + "client": { + "short_name": "TestCases::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" + }, + "method": { + "short_name": "CreateTestCase", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases.CreateTestCase", + "service": { + "short_name": "TestCases", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_TestCases_UpdateTestCase_sync", + "title": "Snippet for the update_test_case call in the TestCases service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#update_test_case.", + "file": "test_cases/update_test_case.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_test_case", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#update_test_case", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::TestCase", + "client": { + "short_name": "TestCases::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" + }, + "method": { + "short_name": "UpdateTestCase", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases.UpdateTestCase", + "service": { + "short_name": "TestCases", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_TestCases_RunTestCase_sync", + "title": "Snippet for the run_test_case call in the TestCases service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#run_test_case.", + "file": "test_cases/run_test_case.rb", + "language": "RUBY", + "client_method": { + "short_name": "run_test_case", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#run_test_case", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TestCases::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" + }, + "method": { + "short_name": "RunTestCase", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases.RunTestCase", + "service": { + "short_name": "TestCases", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_TestCases_BatchRunTestCases_sync", + "title": "Snippet for the batch_run_test_cases call in the TestCases service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_run_test_cases.", + "file": "test_cases/batch_run_test_cases.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_run_test_cases", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_run_test_cases", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TestCases::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" + }, + "method": { + "short_name": "BatchRunTestCases", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases.BatchRunTestCases", + "service": { + "short_name": "TestCases", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_TestCases_CalculateCoverage_sync", + "title": "Snippet for the calculate_coverage call in the TestCases service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#calculate_coverage.", + "file": "test_cases/calculate_coverage.rb", + "language": "RUBY", + "client_method": { + "short_name": "calculate_coverage", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#calculate_coverage", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse", + "client": { + "short_name": "TestCases::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" + }, + "method": { + "short_name": "CalculateCoverage", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases.CalculateCoverage", + "service": { + "short_name": "TestCases", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_TestCases_ImportTestCases_sync", + "title": "Snippet for the import_test_cases call in the TestCases service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#import_test_cases.", + "file": "test_cases/import_test_cases.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_test_cases", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#import_test_cases", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TestCases::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" + }, + "method": { + "short_name": "ImportTestCases", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases.ImportTestCases", + "service": { + "short_name": "TestCases", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_TestCases_ExportTestCases_sync", + "title": "Snippet for the export_test_cases call in the TestCases service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#export_test_cases.", + "file": "test_cases/export_test_cases.rb", + "language": "RUBY", + "client_method": { + "short_name": "export_test_cases", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#export_test_cases", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TestCases::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" + }, + "method": { + "short_name": "ExportTestCases", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases.ExportTestCases", + "service": { + "short_name": "TestCases", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_TestCases_ListTestCaseResults_sync", + "title": "Snippet for the list_test_case_results call in the TestCases service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_case_results.", + "file": "test_cases/list_test_case_results.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_test_case_results", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_case_results", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsResponse", + "client": { + "short_name": "TestCases::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" + }, + "method": { + "short_name": "ListTestCaseResults", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases.ListTestCaseResults", + "service": { + "short_name": "TestCases", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_TestCases_GetTestCaseResult_sync", + "title": "Snippet for the get_test_case_result call in the TestCases service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#get_test_case_result.", + "file": "test_cases/get_test_case_result.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_test_case_result", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#get_test_case_result", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::TestCaseResult", + "client": { + "short_name": "TestCases::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" + }, + "method": { + "short_name": "GetTestCaseResult", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases.GetTestCaseResult", + "service": { + "short_name": "TestCases", + "full_name": "google.cloud.dialogflow.cx.v3.TestCases" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Webhooks_ListWebhooks_sync", + "title": "Snippet for the list_webhooks call in the Webhooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#list_webhooks.", + "file": "webhooks/list_webhooks.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_webhooks", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#list_webhooks", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListWebhooksResponse", + "client": { + "short_name": "Webhooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client" + }, + "method": { + "short_name": "ListWebhooks", + "full_name": "google.cloud.dialogflow.cx.v3.Webhooks.ListWebhooks", + "service": { + "short_name": "Webhooks", + "full_name": "google.cloud.dialogflow.cx.v3.Webhooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Webhooks_GetWebhook_sync", + "title": "Snippet for the get_webhook call in the Webhooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#get_webhook.", + "file": "webhooks/get_webhook.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_webhook", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#get_webhook", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Webhook", + "client": { + "short_name": "Webhooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client" + }, + "method": { + "short_name": "GetWebhook", + "full_name": "google.cloud.dialogflow.cx.v3.Webhooks.GetWebhook", + "service": { + "short_name": "Webhooks", + "full_name": "google.cloud.dialogflow.cx.v3.Webhooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Webhooks_CreateWebhook_sync", + "title": "Snippet for the create_webhook call in the Webhooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#create_webhook.", + "file": "webhooks/create_webhook.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_webhook", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#create_webhook", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Webhook", + "client": { + "short_name": "Webhooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client" + }, + "method": { + "short_name": "CreateWebhook", + "full_name": "google.cloud.dialogflow.cx.v3.Webhooks.CreateWebhook", + "service": { + "short_name": "Webhooks", + "full_name": "google.cloud.dialogflow.cx.v3.Webhooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Webhooks_UpdateWebhook_sync", + "title": "Snippet for the update_webhook call in the Webhooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#update_webhook.", + "file": "webhooks/update_webhook.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_webhook", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#update_webhook", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Webhook", + "client": { + "short_name": "Webhooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client" + }, + "method": { + "short_name": "UpdateWebhook", + "full_name": "google.cloud.dialogflow.cx.v3.Webhooks.UpdateWebhook", + "service": { + "short_name": "Webhooks", + "full_name": "google.cloud.dialogflow.cx.v3.Webhooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Webhooks_DeleteWebhook_sync", + "title": "Snippet for the delete_webhook call in the Webhooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#delete_webhook.", + "file": "webhooks/delete_webhook.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_webhook", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#delete_webhook", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Webhooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client" + }, + "method": { + "short_name": "DeleteWebhook", + "full_name": "google.cloud.dialogflow.cx.v3.Webhooks.DeleteWebhook", + "service": { + "short_name": "Webhooks", + "full_name": "google.cloud.dialogflow.cx.v3.Webhooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Environments::Client#list_environments.", + "file": "environments/list_environments.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_environments", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client#list_environments", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListEnvironmentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListEnvironmentsResponse", + "client": { + "short_name": "Environments::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client" + }, + "method": { + "short_name": "ListEnvironments", + "full_name": "google.cloud.dialogflow.cx.v3.Environments.ListEnvironments", + "service": { + "short_name": "Environments", + "full_name": "google.cloud.dialogflow.cx.v3.Environments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Environments::Client#get_environment.", + "file": "environments/get_environment.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_environment", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client#get_environment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Environment", + "client": { + "short_name": "Environments::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client" + }, + "method": { + "short_name": "GetEnvironment", + "full_name": "google.cloud.dialogflow.cx.v3.Environments.GetEnvironment", + "service": { + "short_name": "Environments", + "full_name": "google.cloud.dialogflow.cx.v3.Environments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Environments::Client#create_environment.", + "file": "environments/create_environment.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_environment", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client#create_environment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Environments::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client" + }, + "method": { + "short_name": "CreateEnvironment", + "full_name": "google.cloud.dialogflow.cx.v3.Environments.CreateEnvironment", + "service": { + "short_name": "Environments", + "full_name": "google.cloud.dialogflow.cx.v3.Environments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Environments::Client#update_environment.", + "file": "environments/update_environment.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_environment", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client#update_environment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Environments::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client" + }, + "method": { + "short_name": "UpdateEnvironment", + "full_name": "google.cloud.dialogflow.cx.v3.Environments.UpdateEnvironment", + "service": { + "short_name": "Environments", + "full_name": "google.cloud.dialogflow.cx.v3.Environments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Environments::Client#delete_environment.", + "file": "environments/delete_environment.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_environment", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client#delete_environment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteEnvironmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Environments::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client" + }, + "method": { + "short_name": "DeleteEnvironment", + "full_name": "google.cloud.dialogflow.cx.v3.Environments.DeleteEnvironment", + "service": { + "short_name": "Environments", + "full_name": "google.cloud.dialogflow.cx.v3.Environments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Environments_LookupEnvironmentHistory_sync", + "title": "Snippet for the lookup_environment_history call in the Environments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Environments::Client#lookup_environment_history.", + "file": "environments/lookup_environment_history.rb", + "language": "RUBY", + "client_method": { + "short_name": "lookup_environment_history", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client#lookup_environment_history", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryResponse", + "client": { + "short_name": "Environments::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client" + }, + "method": { + "short_name": "LookupEnvironmentHistory", + "full_name": "google.cloud.dialogflow.cx.v3.Environments.LookupEnvironmentHistory", + "service": { + "short_name": "Environments", + "full_name": "google.cloud.dialogflow.cx.v3.Environments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Environments_RunContinuousTest_sync", + "title": "Snippet for the run_continuous_test call in the Environments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Environments::Client#run_continuous_test.", + "file": "environments/run_continuous_test.rb", + "language": "RUBY", + "client_method": { + "short_name": "run_continuous_test", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client#run_continuous_test", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Environments::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client" + }, + "method": { + "short_name": "RunContinuousTest", + "full_name": "google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest", + "service": { + "short_name": "Environments", + "full_name": "google.cloud.dialogflow.cx.v3.Environments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Environments_ListContinuousTestResults_sync", + "title": "Snippet for the list_continuous_test_results call in the Environments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Environments::Client#list_continuous_test_results.", + "file": "environments/list_continuous_test_results.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_continuous_test_results", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client#list_continuous_test_results", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsResponse", + "client": { + "short_name": "Environments::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client" + }, + "method": { + "short_name": "ListContinuousTestResults", + "full_name": "google.cloud.dialogflow.cx.v3.Environments.ListContinuousTestResults", + "service": { + "short_name": "Environments", + "full_name": "google.cloud.dialogflow.cx.v3.Environments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Environments_DeployFlow_sync", + "title": "Snippet for the deploy_flow call in the Environments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Environments::Client#deploy_flow.", + "file": "environments/deploy_flow.rb", + "language": "RUBY", + "client_method": { + "short_name": "deploy_flow", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client#deploy_flow", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Environments::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client" + }, + "method": { + "short_name": "DeployFlow", + "full_name": "google.cloud.dialogflow.cx.v3.Environments.DeployFlow", + "service": { + "short_name": "Environments", + "full_name": "google.cloud.dialogflow.cx.v3.Environments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Examples_CreateExample_sync", + "title": "Snippet for the create_example call in the Examples service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Examples::Client#create_example.", + "file": "examples/create_example.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_example", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client#create_example", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreateExampleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Example", + "client": { + "short_name": "Examples::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client" + }, + "method": { + "short_name": "CreateExample", + "full_name": "google.cloud.dialogflow.cx.v3.Examples.CreateExample", + "service": { + "short_name": "Examples", + "full_name": "google.cloud.dialogflow.cx.v3.Examples" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Examples_DeleteExample_sync", + "title": "Snippet for the delete_example call in the Examples service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Examples::Client#delete_example.", + "file": "examples/delete_example.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_example", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client#delete_example", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteExampleRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Examples::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client" + }, + "method": { + "short_name": "DeleteExample", + "full_name": "google.cloud.dialogflow.cx.v3.Examples.DeleteExample", + "service": { + "short_name": "Examples", + "full_name": "google.cloud.dialogflow.cx.v3.Examples" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Examples_ListExamples_sync", + "title": "Snippet for the list_examples call in the Examples service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Examples::Client#list_examples.", + "file": "examples/list_examples.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_examples", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client#list_examples", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListExamplesResponse", + "client": { + "short_name": "Examples::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client" + }, + "method": { + "short_name": "ListExamples", + "full_name": "google.cloud.dialogflow.cx.v3.Examples.ListExamples", + "service": { + "short_name": "Examples", + "full_name": "google.cloud.dialogflow.cx.v3.Examples" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Examples_GetExample_sync", + "title": "Snippet for the get_example call in the Examples service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Examples::Client#get_example.", + "file": "examples/get_example.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_example", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client#get_example", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetExampleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Example", + "client": { + "short_name": "Examples::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client" + }, + "method": { + "short_name": "GetExample", + "full_name": "google.cloud.dialogflow.cx.v3.Examples.GetExample", + "service": { + "short_name": "Examples", + "full_name": "google.cloud.dialogflow.cx.v3.Examples" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Examples_UpdateExample_sync", + "title": "Snippet for the update_example call in the Examples service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Examples::Client#update_example.", + "file": "examples/update_example.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_example", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client#update_example", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateExampleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Example", + "client": { + "short_name": "Examples::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client" + }, + "method": { + "short_name": "UpdateExample", + "full_name": "google.cloud.dialogflow.cx.v3.Examples.UpdateExample", + "service": { + "short_name": "Examples", + "full_name": "google.cloud.dialogflow.cx.v3.Examples" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Experiments_ListExperiments_sync", + "title": "Snippet for the list_experiments call in the Experiments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Experiments::Client#list_experiments.", + "file": "experiments/list_experiments.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_experiments", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#list_experiments", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListExperimentsResponse", + "client": { + "short_name": "Experiments::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client" + }, + "method": { + "short_name": "ListExperiments", + "full_name": "google.cloud.dialogflow.cx.v3.Experiments.ListExperiments", + "service": { + "short_name": "Experiments", + "full_name": "google.cloud.dialogflow.cx.v3.Experiments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Experiments_GetExperiment_sync", + "title": "Snippet for the get_experiment call in the Experiments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Experiments::Client#get_experiment.", + "file": "experiments/get_experiment.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_experiment", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#get_experiment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Experiment", + "client": { + "short_name": "Experiments::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client" + }, + "method": { + "short_name": "GetExperiment", + "full_name": "google.cloud.dialogflow.cx.v3.Experiments.GetExperiment", + "service": { + "short_name": "Experiments", + "full_name": "google.cloud.dialogflow.cx.v3.Experiments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Experiments_CreateExperiment_sync", + "title": "Snippet for the create_experiment call in the Experiments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Experiments::Client#create_experiment.", + "file": "experiments/create_experiment.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_experiment", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#create_experiment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Experiment", + "client": { + "short_name": "Experiments::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client" + }, + "method": { + "short_name": "CreateExperiment", + "full_name": "google.cloud.dialogflow.cx.v3.Experiments.CreateExperiment", + "service": { + "short_name": "Experiments", + "full_name": "google.cloud.dialogflow.cx.v3.Experiments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Experiments_UpdateExperiment_sync", + "title": "Snippet for the update_experiment call in the Experiments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Experiments::Client#update_experiment.", + "file": "experiments/update_experiment.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_experiment", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#update_experiment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Experiment", + "client": { + "short_name": "Experiments::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client" + }, + "method": { + "short_name": "UpdateExperiment", + "full_name": "google.cloud.dialogflow.cx.v3.Experiments.UpdateExperiment", + "service": { + "short_name": "Experiments", + "full_name": "google.cloud.dialogflow.cx.v3.Experiments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Experiments_DeleteExperiment_sync", + "title": "Snippet for the delete_experiment call in the Experiments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Experiments::Client#delete_experiment.", + "file": "experiments/delete_experiment.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_experiment", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#delete_experiment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Experiments::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client" + }, + "method": { + "short_name": "DeleteExperiment", + "full_name": "google.cloud.dialogflow.cx.v3.Experiments.DeleteExperiment", + "service": { + "short_name": "Experiments", + "full_name": "google.cloud.dialogflow.cx.v3.Experiments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Experiments_StartExperiment_sync", + "title": "Snippet for the start_experiment call in the Experiments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Experiments::Client#start_experiment.", + "file": "experiments/start_experiment.rb", + "language": "RUBY", + "client_method": { + "short_name": "start_experiment", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#start_experiment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Experiment", + "client": { + "short_name": "Experiments::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client" + }, + "method": { + "short_name": "StartExperiment", + "full_name": "google.cloud.dialogflow.cx.v3.Experiments.StartExperiment", + "service": { + "short_name": "Experiments", + "full_name": "google.cloud.dialogflow.cx.v3.Experiments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Experiments_StopExperiment_sync", + "title": "Snippet for the stop_experiment call in the Experiments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Experiments::Client#stop_experiment.", + "file": "experiments/stop_experiment.rb", + "language": "RUBY", + "client_method": { + "short_name": "stop_experiment", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#stop_experiment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Experiment", + "client": { + "short_name": "Experiments::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client" + }, + "method": { + "short_name": "StopExperiment", + "full_name": "google.cloud.dialogflow.cx.v3.Experiments.StopExperiment", + "service": { + "short_name": "Experiments", + "full_name": "google.cloud.dialogflow.cx.v3.Experiments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Generators::Client#list_generators.", + "file": "generators/list_generators.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_generators", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client#list_generators", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsResponse", + "client": { + "short_name": "Generators::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client" + }, + "method": { + "short_name": "ListGenerators", + "full_name": "google.cloud.dialogflow.cx.v3.Generators.ListGenerators", + "service": { + "short_name": "Generators", + "full_name": "google.cloud.dialogflow.cx.v3.Generators" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Generators::Client#get_generator.", + "file": "generators/get_generator.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_generator", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client#get_generator", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Generator", + "client": { + "short_name": "Generators::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client" + }, + "method": { + "short_name": "GetGenerator", + "full_name": "google.cloud.dialogflow.cx.v3.Generators.GetGenerator", + "service": { + "short_name": "Generators", + "full_name": "google.cloud.dialogflow.cx.v3.Generators" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Generators::Client#create_generator.", + "file": "generators/create_generator.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_generator", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client#create_generator", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Generator", + "client": { + "short_name": "Generators::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client" + }, + "method": { + "short_name": "CreateGenerator", + "full_name": "google.cloud.dialogflow.cx.v3.Generators.CreateGenerator", + "service": { + "short_name": "Generators", + "full_name": "google.cloud.dialogflow.cx.v3.Generators" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Generators::Client#update_generator.", + "file": "generators/update_generator.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_generator", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client#update_generator", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Generator", + "client": { + "short_name": "Generators::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client" + }, + "method": { + "short_name": "UpdateGenerator", + "full_name": "google.cloud.dialogflow.cx.v3.Generators.UpdateGenerator", + "service": { + "short_name": "Generators", + "full_name": "google.cloud.dialogflow.cx.v3.Generators" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Generators::Client#delete_generator.", + "file": "generators/delete_generator.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_generator", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client#delete_generator", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteGeneratorRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Generators::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client" + }, + "method": { + "short_name": "DeleteGenerator", + "full_name": "google.cloud.dialogflow.cx.v3.Generators.DeleteGenerator", + "service": { + "short_name": "Generators", + "full_name": "google.cloud.dialogflow.cx.v3.Generators" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Playbooks_CreatePlaybook_sync", + "title": "Snippet for the create_playbook call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#create_playbook.", + "file": "playbooks/create_playbook.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_playbook", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#create_playbook", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Playbook", + "client": { + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" + }, + "method": { + "short_name": "CreatePlaybook", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.CreatePlaybook", + "service": { + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Playbooks_DeletePlaybook_sync", + "title": "Snippet for the delete_playbook call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#delete_playbook.", + "file": "playbooks/delete_playbook.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_playbook", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#delete_playbook", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" + }, + "method": { + "short_name": "DeletePlaybook", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.DeletePlaybook", + "service": { + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Playbooks_ListPlaybooks_sync", + "title": "Snippet for the list_playbooks call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#list_playbooks.", + "file": "playbooks/list_playbooks.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_playbooks", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#list_playbooks", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksResponse", + "client": { + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" + }, + "method": { + "short_name": "ListPlaybooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.ListPlaybooks", + "service": { + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Playbooks_GetPlaybook_sync", + "title": "Snippet for the get_playbook call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#get_playbook.", + "file": "playbooks/get_playbook.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_playbook", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#get_playbook", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetPlaybookRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Playbook", + "client": { + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" + }, + "method": { + "short_name": "GetPlaybook", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.GetPlaybook", + "service": { + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Playbooks_ExportPlaybook_sync", + "title": "Snippet for the export_playbook call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#export_playbook.", + "file": "playbooks/export_playbook.rb", + "language": "RUBY", + "client_method": { + "short_name": "export_playbook", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#export_playbook", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" + }, + "method": { + "short_name": "ExportPlaybook", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.ExportPlaybook", + "service": { + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Playbooks_ImportPlaybook_sync", + "title": "Snippet for the import_playbook call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#import_playbook.", + "file": "playbooks/import_playbook.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_playbook", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#import_playbook", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ImportPlaybookRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" + }, + "method": { + "short_name": "ImportPlaybook", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.ImportPlaybook", + "service": { + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Playbooks_UpdatePlaybook_sync", + "title": "Snippet for the update_playbook call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#update_playbook.", + "file": "playbooks/update_playbook.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_playbook", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#update_playbook", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdatePlaybookRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Playbook", + "client": { + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" + }, + "method": { + "short_name": "UpdatePlaybook", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.UpdatePlaybook", + "service": { + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Playbooks_CreatePlaybookVersion_sync", + "title": "Snippet for the create_playbook_version call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#create_playbook_version.", + "file": "playbooks/create_playbook_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_playbook_version", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#create_playbook_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion", + "client": { + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" + }, + "method": { + "short_name": "CreatePlaybookVersion", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.CreatePlaybookVersion", + "service": { + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Playbooks_GetPlaybookVersion_sync", + "title": "Snippet for the get_playbook_version call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#get_playbook_version.", + "file": "playbooks/get_playbook_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_playbook_version", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#get_playbook_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetPlaybookVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion", + "client": { + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" + }, + "method": { + "short_name": "GetPlaybookVersion", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.GetPlaybookVersion", + "service": { + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Playbooks_RestorePlaybookVersion_sync", + "title": "Snippet for the restore_playbook_version call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#restore_playbook_version.", + "file": "playbooks/restore_playbook_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "restore_playbook_version", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#restore_playbook_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionResponse", + "client": { + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" + }, + "method": { + "short_name": "RestorePlaybookVersion", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.RestorePlaybookVersion", + "service": { + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Playbooks_ListPlaybookVersions_sync", + "title": "Snippet for the list_playbook_versions call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#list_playbook_versions.", + "file": "playbooks/list_playbook_versions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_playbook_versions", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#list_playbook_versions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsResponse", + "client": { + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" + }, + "method": { + "short_name": "ListPlaybookVersions", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.ListPlaybookVersions", + "service": { + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Playbooks_DeletePlaybookVersion_sync", + "title": "Snippet for the delete_playbook_version call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#delete_playbook_version.", + "file": "playbooks/delete_playbook_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_playbook_version", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#delete_playbook_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" + }, + "method": { + "short_name": "DeletePlaybookVersion", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.DeletePlaybookVersion", + "service": { + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_SecuritySettingsService_CreateSecuritySettings_sync", + "title": "Snippet for the create_security_settings call in the SecuritySettingsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#create_security_settings.", + "file": "security_settings_service/create_security_settings.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_security_settings", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#create_security_settings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettings", + "client": { + "short_name": "SecuritySettingsService::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client" + }, + "method": { + "short_name": "CreateSecuritySettings", + "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService.CreateSecuritySettings", + "service": { + "short_name": "SecuritySettingsService", + "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_SecuritySettingsService_GetSecuritySettings_sync", + "title": "Snippet for the get_security_settings call in the SecuritySettingsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#get_security_settings.", + "file": "security_settings_service/get_security_settings.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_security_settings", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#get_security_settings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettings", + "client": { + "short_name": "SecuritySettingsService::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client" + }, + "method": { + "short_name": "GetSecuritySettings", + "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService.GetSecuritySettings", + "service": { + "short_name": "SecuritySettingsService", + "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_SecuritySettingsService_UpdateSecuritySettings_sync", + "title": "Snippet for the update_security_settings call in the SecuritySettingsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#update_security_settings.", + "file": "security_settings_service/update_security_settings.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_security_settings", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#update_security_settings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettings", + "client": { + "short_name": "SecuritySettingsService::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client" + }, + "method": { + "short_name": "UpdateSecuritySettings", + "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService.UpdateSecuritySettings", + "service": { + "short_name": "SecuritySettingsService", + "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_SecuritySettingsService_ListSecuritySettings_sync", + "title": "Snippet for the list_security_settings call in the SecuritySettingsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#list_security_settings.", + "file": "security_settings_service/list_security_settings.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_security_settings", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#list_security_settings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsResponse", + "client": { + "short_name": "SecuritySettingsService::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client" + }, + "method": { + "short_name": "ListSecuritySettings", + "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService.ListSecuritySettings", + "service": { + "short_name": "SecuritySettingsService", + "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_SecuritySettingsService_DeleteSecuritySettings_sync", + "title": "Snippet for the delete_security_settings call in the SecuritySettingsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#delete_security_settings.", + "file": "security_settings_service/delete_security_settings.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_security_settings", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#delete_security_settings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SecuritySettingsService::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client" + }, + "method": { + "short_name": "DeleteSecuritySettings", + "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService.DeleteSecuritySettings", + "service": { + "short_name": "SecuritySettingsService", + "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Tools::Client#create_tool.", + "file": "tools/create_tool.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_tool", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#create_tool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreateToolRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Tool", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" + }, + "method": { + "short_name": "CreateTool", + "full_name": "google.cloud.dialogflow.cx.v3.Tools.CreateTool", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Tools::Client#list_tools.", + "file": "tools/list_tools.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_tools", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#list_tools", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListToolsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListToolsResponse", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" + }, + "method": { + "short_name": "ListTools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools.ListTools", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Tools::Client#get_tool.", + "file": "tools/get_tool.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_tool", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#get_tool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetToolRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Tool", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" + }, + "method": { + "short_name": "GetTool", + "full_name": "google.cloud.dialogflow.cx.v3.Tools.GetTool", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Tools::Client#update_tool.", + "file": "tools/update_tool.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_tool", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#update_tool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateToolRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Tool", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" + }, + "method": { + "short_name": "UpdateTool", + "full_name": "google.cloud.dialogflow.cx.v3.Tools.UpdateTool", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Tools::Client#delete_tool.", + "file": "tools/delete_tool.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_tool", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#delete_tool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteToolRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" + }, + "method": { + "short_name": "DeleteTool", + "full_name": "google.cloud.dialogflow.cx.v3.Tools.DeleteTool", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Tools_ListToolVersions_sync", + "title": "Snippet for the list_tool_versions call in the Tools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Tools::Client#list_tool_versions.", + "file": "tools/list_tool_versions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_tool_versions", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#list_tool_versions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsResponse", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" + }, + "method": { + "short_name": "ListToolVersions", + "full_name": "google.cloud.dialogflow.cx.v3.Tools.ListToolVersions", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Tools_CreateToolVersion_sync", + "title": "Snippet for the create_tool_version call in the Tools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Tools::Client#create_tool_version.", + "file": "tools/create_tool_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_tool_version", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#create_tool_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreateToolVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ToolVersion", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" + }, + "method": { + "short_name": "CreateToolVersion", + "full_name": "google.cloud.dialogflow.cx.v3.Tools.CreateToolVersion", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Tools_GetToolVersion_sync", + "title": "Snippet for the get_tool_version call in the Tools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Tools::Client#get_tool_version.", + "file": "tools/get_tool_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_tool_version", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#get_tool_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetToolVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ToolVersion", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" + }, + "method": { + "short_name": "GetToolVersion", + "full_name": "google.cloud.dialogflow.cx.v3.Tools.GetToolVersion", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Tools_DeleteToolVersion_sync", + "title": "Snippet for the delete_tool_version call in the Tools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Tools::Client#delete_tool_version.", + "file": "tools/delete_tool_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_tool_version", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#delete_tool_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteToolVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" + }, + "method": { + "short_name": "DeleteToolVersion", + "full_name": "google.cloud.dialogflow.cx.v3.Tools.DeleteToolVersion", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Tools_RestoreToolVersion_sync", + "title": "Snippet for the restore_tool_version call in the Tools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Tools::Client#restore_tool_version.", + "file": "tools/restore_tool_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "restore_tool_version", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#restore_tool_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionResponse", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" + }, + "method": { + "short_name": "RestoreToolVersion", + "full_name": "google.cloud.dialogflow.cx.v3.Tools.RestoreToolVersion", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Versions::Client#list_versions.", + "file": "versions/list_versions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_versions", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client#list_versions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListVersionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListVersionsResponse", + "client": { + "short_name": "Versions::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client" + }, + "method": { + "short_name": "ListVersions", + "full_name": "google.cloud.dialogflow.cx.v3.Versions.ListVersions", + "service": { + "short_name": "Versions", + "full_name": "google.cloud.dialogflow.cx.v3.Versions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Versions::Client#get_version.", + "file": "versions/get_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_version", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client#get_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Version", + "client": { + "short_name": "Versions::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client" + }, + "method": { + "short_name": "GetVersion", + "full_name": "google.cloud.dialogflow.cx.v3.Versions.GetVersion", + "service": { + "short_name": "Versions", + "full_name": "google.cloud.dialogflow.cx.v3.Versions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Versions::Client#create_version.", + "file": "versions/create_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_version", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client#create_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Versions::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client" + }, + "method": { + "short_name": "CreateVersion", + "full_name": "google.cloud.dialogflow.cx.v3.Versions.CreateVersion", + "service": { + "short_name": "Versions", + "full_name": "google.cloud.dialogflow.cx.v3.Versions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Versions::Client#update_version.", + "file": "versions/update_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_version", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client#update_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Version", + "client": { + "short_name": "Versions::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client" + }, + "method": { + "short_name": "UpdateVersion", + "full_name": "google.cloud.dialogflow.cx.v3.Versions.UpdateVersion", + "service": { + "short_name": "Versions", + "full_name": "google.cloud.dialogflow.cx.v3.Versions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Versions::Client#delete_version.", + "file": "versions/delete_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_version", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client#delete_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Versions::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client" + }, + "method": { + "short_name": "DeleteVersion", + "full_name": "google.cloud.dialogflow.cx.v3.Versions.DeleteVersion", + "service": { + "short_name": "Versions", + "full_name": "google.cloud.dialogflow.cx.v3.Versions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Versions_LoadVersion_sync", + "title": "Snippet for the load_version call in the Versions service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Versions::Client#load_version.", + "file": "versions/load_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "load_version", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client#load_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Versions::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client" + }, + "method": { + "short_name": "LoadVersion", + "full_name": "google.cloud.dialogflow.cx.v3.Versions.LoadVersion", + "service": { + "short_name": "Versions", + "full_name": "google.cloud.dialogflow.cx.v3.Versions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Versions_CompareVersions_sync", + "title": "Snippet for the compare_versions call in the Versions service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Versions::Client#compare_versions.", + "file": "versions/compare_versions.rb", + "language": "RUBY", + "client_method": { + "short_name": "compare_versions", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client#compare_versions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse", + "client": { + "short_name": "Versions::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client" + }, + "method": { + "short_name": "CompareVersions", + "full_name": "google.cloud.dialogflow.cx.v3.Versions.CompareVersions", + "service": { + "short_name": "Versions", + "full_name": "google.cloud.dialogflow.cx.v3.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-cx-v3/snippets/test_cases/batch_delete_test_cases.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_delete_test_cases.rb new file mode 100644 index 000000000000..c9ecbecb6517 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_delete_test_cases.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_v3_generated_TestCases_BatchDeleteTestCases_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the batch_delete_test_cases call in the TestCases service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_delete_test_cases. +# +def batch_delete_test_cases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest.new + + # Call the batch_delete_test_cases method. + result = client.batch_delete_test_cases request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v3_generated_TestCases_BatchDeleteTestCases_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_run_test_cases.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_run_test_cases.rb new file mode 100644 index 000000000000..6f0c23da7670 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_run_test_cases.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_v3_generated_TestCases_BatchRunTestCases_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the batch_run_test_cases call in the TestCases service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_run_test_cases. +# +def batch_run_test_cases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest.new + + # Call the batch_run_test_cases method. + result = client.batch_run_test_cases request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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_v3_generated_TestCases_BatchRunTestCases_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/calculate_coverage.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/calculate_coverage.rb new file mode 100644 index 000000000000..e7b9e9bd6cc3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/calculate_coverage.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_v3_generated_TestCases_CalculateCoverage_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the calculate_coverage call in the TestCases service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#calculate_coverage. +# +def calculate_coverage + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest.new + + # Call the calculate_coverage method. + result = client.calculate_coverage request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse. + p result +end +# [END dialogflow_v3_generated_TestCases_CalculateCoverage_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/create_test_case.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/create_test_case.rb new file mode 100644 index 000000000000..0867d5d79b35 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/create_test_case.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_v3_generated_TestCases_CreateTestCase_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the create_test_case call in the TestCases service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#create_test_case. +# +def create_test_case + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest.new + + # Call the create_test_case method. + result = client.create_test_case request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. + p result +end +# [END dialogflow_v3_generated_TestCases_CreateTestCase_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/export_test_cases.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/export_test_cases.rb new file mode 100644 index 000000000000..fdf60afadaba --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/export_test_cases.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_v3_generated_TestCases_ExportTestCases_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the export_test_cases call in the TestCases service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#export_test_cases. +# +def export_test_cases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest.new + + # Call the export_test_cases method. + result = client.export_test_cases request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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_v3_generated_TestCases_ExportTestCases_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case.rb new file mode 100644 index 000000000000..1b7177eba996 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case.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_v3_generated_TestCases_GetTestCase_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the get_test_case call in the TestCases service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#get_test_case. +# +def get_test_case + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest.new + + # Call the get_test_case method. + result = client.get_test_case request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. + p result +end +# [END dialogflow_v3_generated_TestCases_GetTestCase_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case_result.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case_result.rb new file mode 100644 index 000000000000..aa7275baaffc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case_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_v3_generated_TestCases_GetTestCaseResult_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the get_test_case_result call in the TestCases service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#get_test_case_result. +# +def get_test_case_result + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest.new + + # Call the get_test_case_result method. + result = client.get_test_case_result request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCaseResult. + p result +end +# [END dialogflow_v3_generated_TestCases_GetTestCaseResult_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/import_test_cases.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/import_test_cases.rb new file mode 100644 index 000000000000..ec2e71212fe2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/import_test_cases.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_v3_generated_TestCases_ImportTestCases_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the import_test_cases call in the TestCases service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#import_test_cases. +# +def import_test_cases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest.new + + # Call the import_test_cases method. + result = client.import_test_cases request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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_v3_generated_TestCases_ImportTestCases_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_case_results.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_case_results.rb new file mode 100644 index 000000000000..a55831b4b1f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_case_results.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_v3_generated_TestCases_ListTestCaseResults_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the list_test_case_results call in the TestCases service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_case_results. +# +def list_test_case_results + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest.new + + # Call the list_test_case_results method. + result = client.list_test_case_results request + + # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::TestCaseResult. + p item + end +end +# [END dialogflow_v3_generated_TestCases_ListTestCaseResults_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_cases.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_cases.rb new file mode 100644 index 000000000000..16478c9513d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_cases.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_v3_generated_TestCases_ListTestCases_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the list_test_cases call in the TestCases service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_cases. +# +def list_test_cases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest.new + + # Call the list_test_cases method. + result = client.list_test_cases request + + # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::TestCase. + p item + end +end +# [END dialogflow_v3_generated_TestCases_ListTestCases_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/run_test_case.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/run_test_case.rb new file mode 100644 index 000000000000..22c36898f598 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/run_test_case.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_v3_generated_TestCases_RunTestCase_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the run_test_case call in the TestCases service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#run_test_case. +# +def run_test_case + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest.new + + # Call the run_test_case method. + result = client.run_test_case request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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_v3_generated_TestCases_RunTestCase_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/update_test_case.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/update_test_case.rb new file mode 100644 index 000000000000..1d157795bdfe --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/update_test_case.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_v3_generated_TestCases_UpdateTestCase_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the update_test_case call in the TestCases service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#update_test_case. +# +def update_test_case + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest.new + + # Call the update_test_case method. + result = client.update_test_case request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. + p result +end +# [END dialogflow_v3_generated_TestCases_UpdateTestCase_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/create_tool.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/create_tool.rb new file mode 100644 index 000000000000..fa7ccbadb63b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Tools_CreateTool_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Tools::Client#create_tool. +# +def create_tool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateToolRequest.new + + # Call the create_tool method. + result = client.create_tool request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Tool. + p result +end +# [END dialogflow_v3_generated_Tools_CreateTool_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/create_tool_version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/create_tool_version.rb new file mode 100644 index 000000000000..5fd583366bb6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/create_tool_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_v3_generated_Tools_CreateToolVersion_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the create_tool_version 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::CX::V3::Tools::Client#create_tool_version. +# +def create_tool_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateToolVersionRequest.new + + # Call the create_tool_version method. + result = client.create_tool_version request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::ToolVersion. + p result +end +# [END dialogflow_v3_generated_Tools_CreateToolVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/delete_tool.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/delete_tool.rb new file mode 100644 index 000000000000..8bcf68a7c433 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Tools_DeleteTool_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Tools::Client#delete_tool. +# +def delete_tool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::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_v3_generated_Tools_DeleteTool_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/delete_tool_version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/delete_tool_version.rb new file mode 100644 index 000000000000..958195ad4745 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/delete_tool_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_v3_generated_Tools_DeleteToolVersion_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the delete_tool_version 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::CX::V3::Tools::Client#delete_tool_version. +# +def delete_tool_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeleteToolVersionRequest.new + + # Call the delete_tool_version method. + result = client.delete_tool_version request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v3_generated_Tools_DeleteToolVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/get_tool.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/get_tool.rb new file mode 100644 index 000000000000..c038726d55c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Tools_GetTool_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Tools::Client#get_tool. +# +def get_tool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetToolRequest.new + + # Call the get_tool method. + result = client.get_tool request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Tool. + p result +end +# [END dialogflow_v3_generated_Tools_GetTool_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/get_tool_version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/get_tool_version.rb new file mode 100644 index 000000000000..11fcccadcaff --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/get_tool_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_v3_generated_Tools_GetToolVersion_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the get_tool_version 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::CX::V3::Tools::Client#get_tool_version. +# +def get_tool_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetToolVersionRequest.new + + # Call the get_tool_version method. + result = client.get_tool_version request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::ToolVersion. + p result +end +# [END dialogflow_v3_generated_Tools_GetToolVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/list_tool_versions.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/list_tool_versions.rb new file mode 100644 index 000000000000..a43065229215 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/list_tool_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_v3_generated_Tools_ListToolVersions_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the list_tool_versions 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::CX::V3::Tools::Client#list_tool_versions. +# +def list_tool_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListToolVersionsRequest.new + + # Call the list_tool_versions method. + result = client.list_tool_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::CX::V3::ToolVersion. + p item + end +end +# [END dialogflow_v3_generated_Tools_ListToolVersions_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/list_tools.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/list_tools.rb new file mode 100644 index 000000000000..192baf901165 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Tools_ListTools_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Tools::Client#list_tools. +# +def list_tools + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Tool. + p item + end +end +# [END dialogflow_v3_generated_Tools_ListTools_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/restore_tool_version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/restore_tool_version.rb new file mode 100644 index 000000000000..90fadc8f6b7a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/restore_tool_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_v3_generated_Tools_RestoreToolVersion_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the restore_tool_version 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::CX::V3::Tools::Client#restore_tool_version. +# +def restore_tool_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionRequest.new + + # Call the restore_tool_version method. + result = client.restore_tool_version request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionResponse. + p result +end +# [END dialogflow_v3_generated_Tools_RestoreToolVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/update_tool.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/update_tool.rb new file mode 100644 index 000000000000..251f3a875626 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Tools_UpdateTool_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Tools::Client#update_tool. +# +def update_tool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateToolRequest.new + + # Call the update_tool method. + result = client.update_tool request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Tool. + p result +end +# [END dialogflow_v3_generated_Tools_UpdateTool_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/create_transition_route_group.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/create_transition_route_group.rb new file mode 100644 index 000000000000..8803c04423c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/create_transition_route_group.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_v3_generated_TransitionRouteGroups_CreateTransitionRouteGroup_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the create_transition_route_group call in the TransitionRouteGroups service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#create_transition_route_group. +# +def create_transition_route_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest.new + + # Call the create_transition_route_group method. + result = client.create_transition_route_group request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. + p result +end +# [END dialogflow_v3_generated_TransitionRouteGroups_CreateTransitionRouteGroup_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/delete_transition_route_group.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/delete_transition_route_group.rb new file mode 100644 index 000000000000..0623c5d39044 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/delete_transition_route_group.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_v3_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the delete_transition_route_group call in the TransitionRouteGroups service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#delete_transition_route_group. +# +def delete_transition_route_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest.new + + # Call the delete_transition_route_group method. + result = client.delete_transition_route_group request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v3_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/get_transition_route_group.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/get_transition_route_group.rb new file mode 100644 index 000000000000..535a842acdff --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/get_transition_route_group.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_v3_generated_TransitionRouteGroups_GetTransitionRouteGroup_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the get_transition_route_group call in the TransitionRouteGroups service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#get_transition_route_group. +# +def get_transition_route_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest.new + + # Call the get_transition_route_group method. + result = client.get_transition_route_group request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. + p result +end +# [END dialogflow_v3_generated_TransitionRouteGroups_GetTransitionRouteGroup_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/list_transition_route_groups.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/list_transition_route_groups.rb new file mode 100644 index 000000000000..e92fc6dab4ff --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/list_transition_route_groups.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_v3_generated_TransitionRouteGroups_ListTransitionRouteGroups_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the list_transition_route_groups call in the TransitionRouteGroups service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#list_transition_route_groups. +# +def list_transition_route_groups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest.new + + # Call the list_transition_route_groups method. + result = client.list_transition_route_groups request + + # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::TransitionRouteGroup. + p item + end +end +# [END dialogflow_v3_generated_TransitionRouteGroups_ListTransitionRouteGroups_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/update_transition_route_group.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/update_transition_route_group.rb new file mode 100644 index 000000000000..84c365777432 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/update_transition_route_group.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_v3_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the update_transition_route_group call in the TransitionRouteGroups service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#update_transition_route_group. +# +def update_transition_route_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest.new + + # Call the update_transition_route_group method. + result = client.update_transition_route_group request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. + p result +end +# [END dialogflow_v3_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/compare_versions.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/compare_versions.rb new file mode 100644 index 000000000000..b4776aa4fb1c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/compare_versions.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_v3_generated_Versions_CompareVersions_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the compare_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::CX::V3::Versions::Client#compare_versions. +# +def compare_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest.new + + # Call the compare_versions method. + result = client.compare_versions request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse. + p result +end +# [END dialogflow_v3_generated_Versions_CompareVersions_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/create_version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/create_version.rb new file mode 100644 index 000000000000..3b879fec4fd2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/create_version.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_v3_generated_Versions_CreateVersion_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Versions::Client#create_version. +# +def create_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest.new + + # Call the create_version method. + result = client.create_version request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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_v3_generated_Versions_CreateVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/delete_version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/delete_version.rb new file mode 100644 index 000000000000..9ceb18ec01c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Versions_DeleteVersion_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Versions::Client#delete_version. +# +def delete_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::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_v3_generated_Versions_DeleteVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/get_version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/get_version.rb new file mode 100644 index 000000000000..7594bfefe782 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Versions_GetVersion_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Versions::Client#get_version. +# +def get_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetVersionRequest.new + + # Call the get_version method. + result = client.get_version request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Version. + p result +end +# [END dialogflow_v3_generated_Versions_GetVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/list_versions.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/list_versions.rb new file mode 100644 index 000000000000..7d69d147a6a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Versions_ListVersions_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Versions::Client#list_versions. +# +def list_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Version. + p item + end +end +# [END dialogflow_v3_generated_Versions_ListVersions_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/load_version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/load_version.rb new file mode 100644 index 000000000000..5dfc8e147940 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/load_version.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_v3_generated_Versions_LoadVersion_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the load_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::CX::V3::Versions::Client#load_version. +# +def load_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest.new + + # Call the load_version method. + result = client.load_version request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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_v3_generated_Versions_LoadVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/update_version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/update_version.rb new file mode 100644 index 000000000000..0ebc2eac6e1d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Versions_UpdateVersion_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# 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::CX::V3::Versions::Client#update_version. +# +def update_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest.new + + # Call the update_version method. + result = client.update_version request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Version. + p result +end +# [END dialogflow_v3_generated_Versions_UpdateVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/create_webhook.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/create_webhook.rb new file mode 100644 index 000000000000..916dd1ad0734 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/create_webhook.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_v3_generated_Webhooks_CreateWebhook_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the create_webhook call in the Webhooks service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#create_webhook. +# +def create_webhook + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest.new + + # Call the create_webhook method. + result = client.create_webhook request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. + p result +end +# [END dialogflow_v3_generated_Webhooks_CreateWebhook_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/delete_webhook.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/delete_webhook.rb new file mode 100644 index 000000000000..b3962ea0f04c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/delete_webhook.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_v3_generated_Webhooks_DeleteWebhook_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the delete_webhook call in the Webhooks service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#delete_webhook. +# +def delete_webhook + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest.new + + # Call the delete_webhook method. + result = client.delete_webhook request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v3_generated_Webhooks_DeleteWebhook_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/get_webhook.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/get_webhook.rb new file mode 100644 index 000000000000..5edd566a55b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/get_webhook.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_v3_generated_Webhooks_GetWebhook_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the get_webhook call in the Webhooks service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#get_webhook. +# +def get_webhook + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest.new + + # Call the get_webhook method. + result = client.get_webhook request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. + p result +end +# [END dialogflow_v3_generated_Webhooks_GetWebhook_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/list_webhooks.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/list_webhooks.rb new file mode 100644 index 000000000000..de6b6e996130 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/list_webhooks.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_v3_generated_Webhooks_ListWebhooks_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the list_webhooks call in the Webhooks service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#list_webhooks. +# +def list_webhooks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest.new + + # Call the list_webhooks method. + result = client.list_webhooks request + + # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Webhook. + p item + end +end +# [END dialogflow_v3_generated_Webhooks_ListWebhooks_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/update_webhook.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/update_webhook.rb new file mode 100644 index 000000000000..124a63b7ff86 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/update_webhook.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_v3_generated_Webhooks_UpdateWebhook_sync] +require "google/cloud/dialogflow/cx/v3" + +## +# Snippet for the update_webhook call in the Webhooks service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#update_webhook. +# +def update_webhook + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest.new + + # Call the update_webhook method. + result = client.update_webhook request + + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. + p result +end +# [END dialogflow_v3_generated_Webhooks_UpdateWebhook_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_operations_test.rb new file mode 100644 index 000000000000..bebb6af87dfc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/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/cx/v3/agent_pb" +require "google/cloud/dialogflow/cx/v3/agent_services_pb" +require "google/cloud/dialogflow/cx/v3/agents" + +class ::Google::Cloud::Dialogflow::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Agents::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_paths_test.rb new file mode 100644 index 000000000000..1df2b5edcb7f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_paths_test.rb @@ -0,0 +1,151 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dialogflow/cx/v3/agents" + +class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_path project: "value0", location: "value1", agent: "value2" + assert_equal "projects/value0/locations/value1/agents/value2", path + end + end + + def test_agent_generative_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::CX::V3::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_generative_settings_path project: "value0", location: "value1", agent: "value2" + assert_equal "projects/value0/locations/value1/agents/value2/generativeSettings", path + end + end + + def test_agent_validation_result_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::CX::V3::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_validation_result_path project: "value0", location: "value1", agent: "value2" + assert_equal "projects/value0/locations/value1/agents/value2/validationResult", 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::CX::V3::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.environment_path project: "value0", location: "value1", agent: "value2", environment: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/environments/value3", path + end + end + + def test_flow_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::CX::V3::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.flow_path project: "value0", location: "value1", agent: "value2", flow: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/flows/value3", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::CX::V3::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_playbook_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::CX::V3::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.playbook_path project: "value0", location: "value1", agent: "value2", playbook: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/playbooks/value3", 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::CX::V3::Agents::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_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::CX::V3::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.security_settings_path project: "value0", location: "value1", security_settings: "value2" + assert_equal "projects/value0/locations/value1/securitySettings/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_rest_test.rb new file mode 100644 index 000000000000..7c78df96064e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_rest_test.rb @@ -0,0 +1,708 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/agent_pb" +require "google/cloud/dialogflow/cx/v3/agents/rest" + + +class ::Google::Cloud::Dialogflow::CX::V3::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_list_agents + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::ListAgentsResponse.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_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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_list_agents_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_agents_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_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 + client.list_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 + client.list_agents ::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_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 + client.list_agents(::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest.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_agents_client_stub.call_count + end + end + end + + def test_get_agent + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Agent.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_get_agent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_agent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_agent({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_agent name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_agent ::Google::Cloud::Dialogflow::CX::V3::GetAgentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_agent({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_agent(::Google::Cloud::Dialogflow::CX::V3::GetAgentRequest.new(name: name), 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_create_agent + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Agent.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + agent = {} + + create_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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_create_agent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_agent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_agent({ parent: parent, agent: agent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_agent parent: parent, agent: agent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_agent ::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest.new(parent: parent, agent: agent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_agent({ parent: parent, agent: agent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_agent(::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest.new(parent: parent, agent: agent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_agent_client_stub.call_count + end + end + end + + def test_update_agent + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Agent.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + agent = {} + update_mask = {} + + update_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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_update_agent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_agent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_agent({ agent: agent, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_agent agent: agent, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_agent ::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest.new(agent: agent, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_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 + client.update_agent(::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest.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, update_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. + name = "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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_delete_agent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_agent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_agent({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_agent name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_agent ::Google::Cloud::Dialogflow::CX::V3::DeleteAgentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_agent({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_agent(::Google::Cloud::Dialogflow::CX::V3::DeleteAgentRequest.new(name: name), 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_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. + name = "hello world" + agent_uri = "hello world" + data_format = :DATA_FORMAT_UNSPECIFIED + environment = "hello world" + git_destination = {} + include_bigquery_export_settings = true + + 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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_export_agent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, export_agent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.export_agent({ name: name, agent_uri: agent_uri, data_format: data_format, environment: environment, git_destination: git_destination, include_bigquery_export_settings: include_bigquery_export_settings }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.export_agent name: name, agent_uri: agent_uri, data_format: data_format, environment: environment, git_destination: git_destination, include_bigquery_export_settings: include_bigquery_export_settings do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.export_agent ::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest.new(name: name, agent_uri: agent_uri, data_format: data_format, environment: environment, git_destination: git_destination, include_bigquery_export_settings: include_bigquery_export_settings) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.export_agent({ name: name, agent_uri: agent_uri, data_format: data_format, environment: environment, git_destination: git_destination, include_bigquery_export_settings: include_bigquery_export_settings }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.export_agent(::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest.new(name: name, agent_uri: agent_uri, data_format: data_format, environment: environment, git_destination: git_destination, include_bigquery_export_settings: include_bigquery_export_settings), 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_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. + name = "hello world" + agent_uri = "hello world" + restore_option = :RESTORE_OPTION_UNSPECIFIED + + 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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_restore_agent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, restore_agent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.restore_agent({ name: name, agent_uri: agent_uri, restore_option: restore_option }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.restore_agent name: name, agent_uri: agent_uri, restore_option: restore_option do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.restore_agent ::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest.new(name: name, agent_uri: agent_uri, restore_option: restore_option) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.restore_agent({ name: name, agent_uri: agent_uri, restore_option: restore_option }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.restore_agent(::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest.new(name: name, agent_uri: agent_uri, restore_option: restore_option), 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_validate_agent + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult.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" + + validate_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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_validate_agent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, validate_agent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.validate_agent({ name: name, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.validate_agent name: name, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.validate_agent ::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest.new(name: name, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.validate_agent({ name: name, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.validate_agent(::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest.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, validate_agent_client_stub.call_count + end + end + end + + def test_get_agent_validation_result + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult.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_agent_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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_get_agent_validation_result_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_agent_validation_result_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_agent_validation_result({ name: name, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_agent_validation_result name: name, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_agent_validation_result ::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest.new(name: name, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_agent_validation_result({ name: name, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_agent_validation_result(::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest.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_agent_validation_result_client_stub.call_count + end + end + end + + def test_get_generative_settings + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings.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_generative_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_get_generative_settings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_generative_settings_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_generative_settings({ name: name, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_generative_settings name: name, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_generative_settings ::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest.new(name: name, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_generative_settings({ name: name, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_generative_settings(::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest.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_generative_settings_client_stub.call_count + end + end + end + + def test_update_generative_settings + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + generative_settings = {} + update_mask = {} + + update_generative_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_update_generative_settings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_generative_settings_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_generative_settings({ generative_settings: generative_settings, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_generative_settings generative_settings: generative_settings, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_generative_settings ::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest.new(generative_settings: generative_settings, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_generative_settings({ generative_settings: generative_settings, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_generative_settings(::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest.new(generative_settings: generative_settings, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_generative_settings_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::CX::V3::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::CX::V3::Agents::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_test.rb new file mode 100644 index 000000000000..908380277d16 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_test.rb @@ -0,0 +1,802 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/agent_pb" +require "google/cloud/dialogflow/cx/v3/agents" + +class ::Google::Cloud::Dialogflow::CX::V3::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_list_agents + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListAgentsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_agents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_agents, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest, 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_agents_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_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 + client.list_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 + client.list_agents ::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_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 + client.list_agents(::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest.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_agents_client_stub.call_rpc_count + end + end + + def test_get_agent + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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. + name = "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::CX::V3::GetAgentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_agent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_agent({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_agent name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_agent ::Google::Cloud::Dialogflow::CX::V3::GetAgentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_agent({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_agent(::Google::Cloud::Dialogflow::CX::V3::GetAgentRequest.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_agent_client_stub.call_rpc_count + end + end + + def test_create_agent + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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" + agent = {} + + create_agent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_agent, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Agent), request["agent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_agent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_agent({ parent: parent, agent: agent }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_agent parent: parent, agent: agent do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_agent ::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest.new(parent: parent, agent: agent) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_agent({ parent: parent, agent: agent }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_agent(::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest.new(parent: parent, agent: agent), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_agent_client_stub.call_rpc_count + end + end + + def test_update_agent + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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 = {} + + update_agent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_agent, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Agent), request["agent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_agent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_agent({ agent: agent, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_agent agent: agent, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_agent ::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest.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 + client.update_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 + client.update_agent(::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest.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, update_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. + name = "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::CX::V3::DeleteAgentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_agent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_agent({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_agent name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_agent ::Google::Cloud::Dialogflow::CX::V3::DeleteAgentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_agent({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_agent(::Google::Cloud::Dialogflow::CX::V3::DeleteAgentRequest.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_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. + name = "hello world" + agent_uri = "hello world" + data_format = :DATA_FORMAT_UNSPECIFIED + environment = "hello world" + git_destination = {} + include_bigquery_export_settings = true + + 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::CX::V3::ExportAgentRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["agent_uri"] + assert_equal :DATA_FORMAT_UNSPECIFIED, request["data_format"] + assert_equal "hello world", request["environment"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest::GitDestination), request["git_destination"] + assert_equal true, request["include_bigquery_export_settings"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, export_agent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.export_agent({ name: name, agent_uri: agent_uri, data_format: data_format, environment: environment, git_destination: git_destination, include_bigquery_export_settings: include_bigquery_export_settings }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.export_agent name: name, agent_uri: agent_uri, data_format: data_format, environment: environment, git_destination: git_destination, include_bigquery_export_settings: include_bigquery_export_settings do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.export_agent ::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest.new(name: name, agent_uri: agent_uri, data_format: data_format, environment: environment, git_destination: git_destination, include_bigquery_export_settings: include_bigquery_export_settings) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.export_agent({ name: name, agent_uri: agent_uri, data_format: data_format, environment: environment, git_destination: git_destination, include_bigquery_export_settings: include_bigquery_export_settings }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.export_agent(::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest.new(name: name, agent_uri: agent_uri, data_format: data_format, environment: environment, git_destination: git_destination, include_bigquery_export_settings: include_bigquery_export_settings), 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_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. + name = "hello world" + agent_uri = "hello world" + restore_option = :RESTORE_OPTION_UNSPECIFIED + + 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::CX::V3::RestoreAgentRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["agent_uri"] + assert_equal :agent_uri, request.agent + assert_equal :RESTORE_OPTION_UNSPECIFIED, request["restore_option"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, restore_agent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.restore_agent({ name: name, agent_uri: agent_uri, restore_option: restore_option }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.restore_agent name: name, agent_uri: agent_uri, restore_option: restore_option do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.restore_agent ::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest.new(name: name, agent_uri: agent_uri, restore_option: restore_option) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.restore_agent({ name: name, agent_uri: agent_uri, restore_option: restore_option }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.restore_agent(::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest.new(name: name, agent_uri: agent_uri, restore_option: restore_option), 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_validate_agent + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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" + + validate_agent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :validate_agent, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, validate_agent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.validate_agent({ name: name, language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.validate_agent name: name, language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.validate_agent ::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest.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 + client.validate_agent({ 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 + client.validate_agent(::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest.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, validate_agent_client_stub.call_rpc_count + end + end + + def test_get_agent_validation_result + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_agent_validation_result_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_agent_validation_result, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_agent_validation_result_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_agent_validation_result({ name: name, language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_agent_validation_result name: name, language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_agent_validation_result ::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest.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 + client.get_agent_validation_result({ 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 + client.get_agent_validation_result(::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest.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_agent_validation_result_client_stub.call_rpc_count + end + end + + def test_get_generative_settings + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_generative_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_generative_settings, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_generative_settings_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_generative_settings({ name: name, language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_generative_settings name: name, language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_generative_settings ::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest.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 + client.get_generative_settings({ 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 + client.get_generative_settings(::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest.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_generative_settings_client_stub.call_rpc_count + end + end + + def test_update_generative_settings + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + generative_settings = {} + update_mask = {} + + update_generative_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_generative_settings, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings), request["generative_settings"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_generative_settings_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_generative_settings({ generative_settings: generative_settings, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_generative_settings generative_settings: generative_settings, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_generative_settings ::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest.new(generative_settings: generative_settings, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_generative_settings({ generative_settings: generative_settings, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_generative_settings(::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest.new(generative_settings: generative_settings, 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_generative_settings_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::CX::V3::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::CX::V3::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::CX::V3::Agents::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Agents::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Agents::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_paths_test.rb new file mode 100644 index 000000000000..afbd35c855fd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_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/cx/v3/changelogs" + +class ::Google::Cloud::Dialogflow::CX::V3::Changelogs::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::CX::V3::Changelogs::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_path project: "value0", location: "value1", agent: "value2" + assert_equal "projects/value0/locations/value1/agents/value2", path + end + end + + def test_changelog_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::CX::V3::Changelogs::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.changelog_path project: "value0", location: "value1", agent: "value2", changelog: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/changelogs/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_rest_test.rb new file mode 100644 index 000000000000..afd2a3614056 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_rest_test.rb @@ -0,0 +1,210 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/changelog_pb" +require "google/cloud/dialogflow/cx/v3/changelogs/rest" + + +class ::Google::Cloud::Dialogflow::CX::V3::Changelogs::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_changelogs + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::ListChangelogsResponse.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_changelogs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Changelogs::Rest::ServiceStub.stub :transcode_list_changelogs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_changelogs_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_changelogs({ 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 + client.list_changelogs 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 + client.list_changelogs ::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest.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 + client.list_changelogs({ 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 + client.list_changelogs(::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest.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_changelogs_client_stub.call_count + end + end + end + + def test_get_changelog + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Changelog.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_changelog_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Changelogs::Rest::ServiceStub.stub :transcode_get_changelog_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_changelog_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_changelog({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_changelog name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_changelog ::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_changelog({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_changelog(::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_changelog_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::CX::V3::Changelogs::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::CX::V3::Changelogs::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_test.rb new file mode 100644 index 000000000000..8243cf43d622 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_test.rb @@ -0,0 +1,231 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/changelog_pb" +require "google/cloud/dialogflow/cx/v3/changelogs" + +class ::Google::Cloud::Dialogflow::CX::V3::Changelogs::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_changelogs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListChangelogsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_changelogs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_changelogs, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest, 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_changelogs_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_changelogs({ 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 + client.list_changelogs 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 + client.list_changelogs ::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest.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 + client.list_changelogs({ 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 + client.list_changelogs(::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest.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_changelogs_client_stub.call_rpc_count + end + end + + def test_get_changelog + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Changelog.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_changelog_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_changelog, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_changelog_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_changelog({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_changelog name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_changelog ::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_changelog({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_changelog(::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest.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_changelog_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::CX::V3::Changelogs::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::CX::V3::Changelogs::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::CX::V3::Changelogs::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_paths_test.rb new file mode 100644 index 000000000000..dbd82986cc76 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_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/cx/v3/deployments" + +class ::Google::Cloud::Dialogflow::CX::V3::Deployments::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_deployment_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::CX::V3::Deployments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.deployment_path project: "value0", location: "value1", agent: "value2", environment: "value3", deployment: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/environments/value3/deployments/value4", 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::CX::V3::Deployments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.environment_path project: "value0", location: "value1", agent: "value2", environment: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/environments/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_rest_test.rb new file mode 100644 index 000000000000..2443ea06669a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_rest_test.rb @@ -0,0 +1,209 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/deployment_pb" +require "google/cloud/dialogflow/cx/v3/deployments/rest" + + +class ::Google::Cloud::Dialogflow::CX::V3::Deployments::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_deployments + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsResponse.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_deployments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Deployments::Rest::ServiceStub.stub :transcode_list_deployments_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_deployments_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_deployments({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_deployments parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_deployments ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_deployments({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_deployments(::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest.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_deployments_client_stub.call_count + end + end + end + + def test_get_deployment + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Deployment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_deployment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Deployments::Rest::ServiceStub.stub :transcode_get_deployment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_deployment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_deployment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_deployment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_deployment ::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_deployment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_deployment(::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_deployment_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::CX::V3::Deployments::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::CX::V3::Deployments::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_test.rb new file mode 100644 index 000000000000..8d05716cdf43 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_test.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! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dialogflow/cx/v3/deployment_pb" +require "google/cloud/dialogflow/cx/v3/deployments" + +class ::Google::Cloud::Dialogflow::CX::V3::Deployments::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_deployments + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_deployments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_deployments, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest, 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_deployments_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_deployments({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_deployments parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_deployments ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_deployments({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_deployments(::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest.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_deployments_client_stub.call_rpc_count + end + end + + def test_get_deployment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Deployment.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_deployment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_deployment, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_deployment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_deployment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_deployment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_deployment ::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_deployment({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_deployment(::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest.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_deployment_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::CX::V3::Deployments::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::CX::V3::Deployments::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::CX::V3::Deployments::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_operations_test.rb new file mode 100644 index 000000000000..6cc99005f842 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/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/cx/v3/entity_type_pb" +require "google/cloud/dialogflow/cx/v3/entity_type_services_pb" +require "google/cloud/dialogflow/cx/v3/entity_types" + +class ::Google::Cloud::Dialogflow::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityTypes::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_paths_test.rb new file mode 100644 index 000000000000..ed16cb2ce004 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_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/cx/v3/entity_types" + +class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_path project: "value0", location: "value1", agent: "value2" + assert_equal "projects/value0/locations/value1/agents/value2", 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::CX::V3::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.entity_type_path project: "value0", location: "value1", agent: "value2", entity_type: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/entityTypes/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_rest_test.rb new file mode 100644 index 000000000000..f68ce5edff2b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_rest_test.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 "helper" +require "gapic/rest" +require "google/cloud/dialogflow/cx/v3/entity_type_pb" +require "google/cloud/dialogflow/cx/v3/entity_types/rest" + + +class ::Google::Cloud::Dialogflow::CX::V3::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_get_entity_type + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityTypes::Rest::ServiceStub.stub :transcode_get_entity_type_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_entity_type_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_entity_type({ name: name, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_entity_type name: name, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_entity_type ::Google::Cloud::Dialogflow::CX::V3::GetEntityTypeRequest.new(name: name, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.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 + client.get_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::EntityTypes::Rest::ServiceStub.stub :transcode_create_entity_type_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_entity_type_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.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 + client.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 + client.create_entity_type ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.create_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::EntityTypes::Rest::ServiceStub.stub :transcode_update_entity_type_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_entity_type_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.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 + client.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 + client.update_entity_type ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.update_entity_type(::Google::Cloud::Dialogflow::CX::V3::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" + force = true + + 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::CX::V3::EntityTypes::Rest::ServiceStub.stub :transcode_delete_entity_type_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_entity_type_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_entity_type({ name: name, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_entity_type name: name, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_entity_type ::Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest.new(name: name, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_entity_type({ name: name, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_entity_type(::Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest.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_entity_type_client_stub.call_count + end + end + end + + def test_list_entity_types + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityTypes::Rest::ServiceStub.stub :transcode_list_entity_types_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_entity_types_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.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 + client.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 + client.list_entity_types ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.list_entity_types(::Google::Cloud::Dialogflow::CX::V3::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_export_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_types = ["hello world"] + entity_types_uri = "hello world" + data_format = :DATA_FORMAT_UNSPECIFIED + language_code = "hello world" + + export_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::CX::V3::EntityTypes::Rest::ServiceStub.stub :transcode_export_entity_types_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, export_entity_types_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.export_entity_types({ parent: parent, entity_types: entity_types, entity_types_uri: entity_types_uri, data_format: data_format, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.export_entity_types parent: parent, entity_types: entity_types, entity_types_uri: entity_types_uri, data_format: data_format, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.export_entity_types ::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest.new(parent: parent, entity_types: entity_types, entity_types_uri: entity_types_uri, data_format: data_format, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.export_entity_types({ parent: parent, entity_types: entity_types, entity_types_uri: entity_types_uri, data_format: data_format, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.export_entity_types(::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest.new(parent: parent, entity_types: entity_types, entity_types_uri: entity_types_uri, data_format: data_format, language_code: language_code), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, export_entity_types_client_stub.call_count + end + end + end + + def test_import_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_types_uri = "hello world" + merge_option = :MERGE_OPTION_UNSPECIFIED + target_entity_type = "hello world" + + import_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::CX::V3::EntityTypes::Rest::ServiceStub.stub :transcode_import_entity_types_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_entity_types_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_entity_types({ parent: parent, entity_types_uri: entity_types_uri, merge_option: merge_option, target_entity_type: target_entity_type }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_entity_types parent: parent, entity_types_uri: entity_types_uri, merge_option: merge_option, target_entity_type: target_entity_type do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_entity_types ::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest.new(parent: parent, entity_types_uri: entity_types_uri, merge_option: merge_option, target_entity_type: target_entity_type) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_entity_types({ parent: parent, entity_types_uri: entity_types_uri, merge_option: merge_option, target_entity_type: target_entity_type }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_entity_types(::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest.new(parent: parent, entity_types_uri: entity_types_uri, merge_option: merge_option, target_entity_type: target_entity_type), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_entity_types_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::CX::V3::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::CX::V3::EntityTypes::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_test.rb new file mode 100644 index 000000000000..4086676ce92e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_test.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! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dialogflow/cx/v3/entity_type_pb" +require "google/cloud/dialogflow/cx/v3/entity_types" + +class ::Google::Cloud::Dialogflow::CX::V3::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_get_entity_type + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.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 + client.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 + client.get_entity_type ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.get_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::CreateEntityTypeRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.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 + client.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 + client.create_entity_type ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.create_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::UpdateEntityTypeRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.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 + client.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 + client.update_entity_type ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.update_entity_type(::Google::Cloud::Dialogflow::CX::V3::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" + force = true + + 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::CX::V3::DeleteEntityTypeRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_entity_type_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_entity_type({ name: name, force: force }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_entity_type name: name, force: force do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_entity_type ::Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest.new(name: name, force: force) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_entity_type({ 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 + client.delete_entity_type(::Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest.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_entity_type_client_stub.call_rpc_count + end + end + + def test_list_entity_types + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.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 + client.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 + client.list_entity_types ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.list_entity_types(::Google::Cloud::Dialogflow::CX::V3::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_export_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_types = ["hello world"] + entity_types_uri = "hello world" + data_format = :DATA_FORMAT_UNSPECIFIED + language_code = "hello world" + + export_entity_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :export_entity_types, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest, request + assert_equal "hello world", request["parent"] + assert_equal ["hello world"], request["entity_types"] + assert_equal "hello world", request["entity_types_uri"] + assert_equal :entity_types_uri, request.destination + assert_equal :DATA_FORMAT_UNSPECIFIED, request["data_format"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, export_entity_types_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.export_entity_types({ parent: parent, entity_types: entity_types, entity_types_uri: entity_types_uri, data_format: data_format, 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 + client.export_entity_types parent: parent, entity_types: entity_types, entity_types_uri: entity_types_uri, data_format: data_format, 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 + client.export_entity_types ::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest.new(parent: parent, entity_types: entity_types, entity_types_uri: entity_types_uri, data_format: data_format, 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 + client.export_entity_types({ parent: parent, entity_types: entity_types, entity_types_uri: entity_types_uri, data_format: data_format, 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 + client.export_entity_types(::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest.new(parent: parent, entity_types: entity_types, entity_types_uri: entity_types_uri, data_format: data_format, 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, export_entity_types_client_stub.call_rpc_count + end + end + + def test_import_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_types_uri = "hello world" + merge_option = :MERGE_OPTION_UNSPECIFIED + target_entity_type = "hello world" + + import_entity_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_entity_types, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["entity_types_uri"] + assert_equal :entity_types_uri, request.entity_types + assert_equal :MERGE_OPTION_UNSPECIFIED, request["merge_option"] + assert_equal "hello world", request["target_entity_type"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_entity_types_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_entity_types({ parent: parent, entity_types_uri: entity_types_uri, merge_option: merge_option, target_entity_type: target_entity_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 + client.import_entity_types parent: parent, entity_types_uri: entity_types_uri, merge_option: merge_option, target_entity_type: target_entity_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 + client.import_entity_types ::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest.new(parent: parent, entity_types_uri: entity_types_uri, merge_option: merge_option, target_entity_type: target_entity_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 + client.import_entity_types({ parent: parent, entity_types_uri: entity_types_uri, merge_option: merge_option, target_entity_type: target_entity_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 + client.import_entity_types(::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest.new(parent: parent, entity_types_uri: entity_types_uri, merge_option: merge_option, target_entity_type: target_entity_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, import_entity_types_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::CX::V3::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::CX::V3::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::CX::V3::EntityTypes::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_operations_test.rb new file mode 100644 index 000000000000..bad755976c13 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_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/cx/v3/environment_pb" +require "google/cloud/dialogflow/cx/v3/environment_services_pb" +require "google/cloud/dialogflow/cx/v3/environments" + +class ::Google::Cloud::Dialogflow::CX::V3::Environments::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::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::CX::V3::Environments::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_paths_test.rb new file mode 100644 index 000000000000..584f57acdda4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_paths_test.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! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dialogflow/cx/v3/environments" + +class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_path project: "value0", location: "value1", agent: "value2" + assert_equal "projects/value0/locations/value1/agents/value2", 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::CX::V3::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.environment_path project: "value0", location: "value1", agent: "value2", environment: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/environments/value3", 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::CX::V3::Environments::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::CX::V3::Environments::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_test_case_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::CX::V3::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.test_case_path project: "value0", location: "value1", agent: "value2", test_case: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/testCases/value3", 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::CX::V3::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.version_path project: "value0", location: "value1", agent: "value2", flow: "value3", version: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/versions/value4", path + end + end + + def test_webhook_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::CX::V3::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.webhook_path project: "value0", location: "value1", agent: "value2", webhook: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/webhooks/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_rest_test.rb new file mode 100644 index 000000000000..558d9b8bd405 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_rest_test.rb @@ -0,0 +1,594 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/environment_pb" +require "google/cloud/dialogflow/cx/v3/environments/rest" + + +class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::Environments::Rest::ServiceStub.stub :transcode_list_environments_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_environments_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.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 + client.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 + client.list_environments ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.list_environments(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::Environments::Rest::ServiceStub.stub :transcode_get_environment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_environment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_environment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_environment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_environment ::Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_environment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_environment(::Google::Cloud::Dialogflow::CX::V3::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::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + environment = {} + + 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::CX::V3::Environments::Rest::ServiceStub.stub :transcode_create_environment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_environment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_environment({ parent: parent, environment: environment }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_environment parent: parent, environment: environment do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_environment ::Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest.new(parent: parent, environment: environment) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_environment({ parent: parent, environment: environment }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_environment(::Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest.new(parent: parent, environment: environment), 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::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + environment = {} + update_mask = {} + + 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::CX::V3::Environments::Rest::ServiceStub.stub :transcode_update_environment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_environment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_environment({ environment: environment, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_environment environment: environment, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_environment ::Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest.new(environment: environment, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_environment({ environment: environment, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_environment(::Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest.new(environment: environment, update_mask: update_mask), 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::CX::V3::Environments::Rest::ServiceStub.stub :transcode_delete_environment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_environment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_environment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_environment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_environment ::Google::Cloud::Dialogflow::CX::V3::DeleteEnvironmentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_environment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_environment(::Google::Cloud::Dialogflow::CX::V3::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_lookup_environment_history + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + page_size = 42 + page_token = "hello world" + + lookup_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::CX::V3::Environments::Rest::ServiceStub.stub :transcode_lookup_environment_history_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, lookup_environment_history_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.lookup_environment_history({ name: name, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.lookup_environment_history name: name, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.lookup_environment_history ::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest.new(name: name, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.lookup_environment_history({ name: name, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.lookup_environment_history(::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest.new(name: name, 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, lookup_environment_history_client_stub.call_count + end + end + end + + def test_run_continuous_test + # 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. + environment = "hello world" + + run_continuous_test_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Environments::Rest::ServiceStub.stub :transcode_run_continuous_test_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, run_continuous_test_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.run_continuous_test({ environment: environment }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.run_continuous_test environment: environment do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.run_continuous_test ::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest.new(environment: environment) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.run_continuous_test({ environment: environment }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.run_continuous_test(::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest.new(environment: environment), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, run_continuous_test_client_stub.call_count + end + end + end + + def test_list_continuous_test_results + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsResponse.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_continuous_test_results_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Environments::Rest::ServiceStub.stub :transcode_list_continuous_test_results_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_continuous_test_results_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_continuous_test_results({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_continuous_test_results parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_continuous_test_results ::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_continuous_test_results({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_continuous_test_results(::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest.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_continuous_test_results_client_stub.call_count + end + end + end + + def test_deploy_flow + # 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. + environment = "hello world" + flow_version = "hello world" + + deploy_flow_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Environments::Rest::ServiceStub.stub :transcode_deploy_flow_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, deploy_flow_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.deploy_flow({ environment: environment, flow_version: flow_version }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.deploy_flow environment: environment, flow_version: flow_version do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.deploy_flow ::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest.new(environment: environment, flow_version: flow_version) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.deploy_flow({ environment: environment, flow_version: flow_version }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.deploy_flow(::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest.new(environment: environment, flow_version: flow_version), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, deploy_flow_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::CX::V3::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::CX::V3::Environments::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_test.rb new file mode 100644 index 000000000000..279fe032e558 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dialogflow/cx/v3/environment_pb" +require "google/cloud/dialogflow/cx/v3/environments" + +class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.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 + client.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 + client.list_environments ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.list_environments(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::GetEnvironmentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_environment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_environment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_environment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_environment ::Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.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 + client.get_environment(::Google::Cloud::Dialogflow::CX::V3::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::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" + environment = {} + + 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::CX::V3::CreateEnvironmentRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Environment), request["environment"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_environment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_environment({ parent: parent, environment: environment }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_environment parent: parent, environment: environment do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_environment ::Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest.new(parent: parent, environment: environment) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_environment({ parent: parent, environment: environment }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_environment(::Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest.new(parent: parent, environment: environment), 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_environment_client_stub.call_rpc_count + end + end + + def test_update_environment + # 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. + environment = {} + update_mask = {} + + 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::CX::V3::UpdateEnvironmentRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Environment), request["environment"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_environment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_environment({ environment: environment, 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 + client.update_environment environment: environment, 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 + client.update_environment ::Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest.new(environment: environment, 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 + client.update_environment({ environment: environment, 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 + client.update_environment(::Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest.new(environment: environment, 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_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::CX::V3::DeleteEnvironmentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_environment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_environment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_environment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_environment ::Google::Cloud::Dialogflow::CX::V3::DeleteEnvironmentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.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 + client.delete_environment(::Google::Cloud::Dialogflow::CX::V3::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_lookup_environment_history + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + page_size = 42 + page_token = "hello world" + + lookup_environment_history_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :lookup_environment_history, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, lookup_environment_history_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.lookup_environment_history({ name: name, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.lookup_environment_history name: name, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.lookup_environment_history ::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest.new(name: name, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.lookup_environment_history({ name: name, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.lookup_environment_history(::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest.new(name: name, 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, lookup_environment_history_client_stub.call_rpc_count + end + end + + def test_run_continuous_test + # 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. + environment = "hello world" + + run_continuous_test_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :run_continuous_test, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest, request + assert_equal "hello world", request["environment"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, run_continuous_test_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.run_continuous_test({ environment: environment }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.run_continuous_test environment: environment do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.run_continuous_test ::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest.new(environment: environment) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.run_continuous_test({ environment: environment }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.run_continuous_test(::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest.new(environment: environment), 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, run_continuous_test_client_stub.call_rpc_count + end + end + + def test_list_continuous_test_results + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_continuous_test_results_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_continuous_test_results, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest, 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_continuous_test_results_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_continuous_test_results({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_continuous_test_results parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_continuous_test_results ::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_continuous_test_results({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_continuous_test_results(::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest.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_continuous_test_results_client_stub.call_rpc_count + end + end + + def test_deploy_flow + # 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. + environment = "hello world" + flow_version = "hello world" + + deploy_flow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :deploy_flow, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest, request + assert_equal "hello world", request["environment"] + assert_equal "hello world", request["flow_version"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, deploy_flow_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.deploy_flow({ environment: environment, flow_version: flow_version }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.deploy_flow environment: environment, flow_version: flow_version do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.deploy_flow ::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest.new(environment: environment, flow_version: flow_version) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.deploy_flow({ environment: environment, flow_version: flow_version }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.deploy_flow(::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest.new(environment: environment, flow_version: flow_version), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, deploy_flow_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::CX::V3::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::CX::V3::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::CX::V3::Environments::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Environments::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::CX::V3::Environments::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Environments::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_paths_test.rb new file mode 100644 index 000000000000..da9c68608eba --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_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/cx/v3/examples" + +class ::Google::Cloud::Dialogflow::CX::V3::Examples::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_example_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::CX::V3::Examples::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.example_path project: "value0", location: "value1", agent: "value2", playbook: "value3", example: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/playbooks/value3/examples/value4", path + end + end + + def test_flow_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::CX::V3::Examples::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.flow_path project: "value0", location: "value1", agent: "value2", flow: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/flows/value3", path + end + end + + def test_playbook_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::CX::V3::Examples::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.playbook_path project: "value0", location: "value1", agent: "value2", playbook: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/playbooks/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::CX::V3::Examples::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tool_path project: "value0", location: "value1", agent: "value2", tool: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/tools/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_rest_test.rb new file mode 100644 index 000000000000..d443a3f19b54 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_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/cx/v3/example_pb" +require "google/cloud/dialogflow/cx/v3/examples/rest" + + +class ::Google::Cloud::Dialogflow::CX::V3::Examples::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_example + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Example.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + example = {} + + create_example_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Examples::Rest::ServiceStub.stub :transcode_create_example_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_example_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Examples::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_example({ parent: parent, example: example }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_example parent: parent, example: example do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_example ::Google::Cloud::Dialogflow::CX::V3::CreateExampleRequest.new(parent: parent, example: example) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_example({ parent: parent, example: example }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_example(::Google::Cloud::Dialogflow::CX::V3::CreateExampleRequest.new(parent: parent, example: example), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_example_client_stub.call_count + end + end + end + + def test_delete_example + # 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_example_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Examples::Rest::ServiceStub.stub :transcode_delete_example_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_example_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Examples::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_example({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_example name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_example ::Google::Cloud::Dialogflow::CX::V3::DeleteExampleRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_example({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_example(::Google::Cloud::Dialogflow::CX::V3::DeleteExampleRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_example_client_stub.call_count + end + end + end + + def test_list_examples + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::ListExamplesResponse.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" + language_code = "hello world" + + list_examples_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Examples::Rest::ServiceStub.stub :transcode_list_examples_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_examples_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Examples::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_examples({ parent: parent, page_size: page_size, page_token: page_token, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_examples parent: parent, page_size: page_size, page_token: page_token, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_examples ::Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest.new(parent: parent, page_size: page_size, page_token: page_token, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_examples({ parent: parent, page_size: page_size, page_token: page_token, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_examples(::Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest.new(parent: parent, page_size: page_size, page_token: page_token, language_code: language_code), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_examples_client_stub.call_count + end + end + end + + def test_get_example + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Example.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_example_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Examples::Rest::ServiceStub.stub :transcode_get_example_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_example_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Examples::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_example({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_example name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_example ::Google::Cloud::Dialogflow::CX::V3::GetExampleRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_example({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_example(::Google::Cloud::Dialogflow::CX::V3::GetExampleRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_example_client_stub.call_count + end + end + end + + def test_update_example + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Example.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + example = {} + update_mask = {} + + update_example_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Examples::Rest::ServiceStub.stub :transcode_update_example_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_example_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Examples::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_example({ example: example, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_example example: example, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_example ::Google::Cloud::Dialogflow::CX::V3::UpdateExampleRequest.new(example: example, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_example({ example: example, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_example(::Google::Cloud::Dialogflow::CX::V3::UpdateExampleRequest.new(example: example, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_example_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::CX::V3::Examples::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::CX::V3::Examples::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_test.rb new file mode 100644 index 000000000000..eaf559de2846 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_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/cx/v3/example_pb" +require "google/cloud/dialogflow/cx/v3/examples" + +class ::Google::Cloud::Dialogflow::CX::V3::Examples::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_example + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Example.new + grpc_operation = GRPC::ActiveCall::Operation.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" + example = {} + + create_example_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_example, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CreateExampleRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Example), request["example"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_example_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Examples::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_example({ parent: parent, example: example }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_example parent: parent, example: example do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_example ::Google::Cloud::Dialogflow::CX::V3::CreateExampleRequest.new(parent: parent, example: example) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_example({ parent: parent, example: example }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_example(::Google::Cloud::Dialogflow::CX::V3::CreateExampleRequest.new(parent: parent, example: example), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_example_client_stub.call_rpc_count + end + end + + def test_delete_example + # 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_example_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_example, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DeleteExampleRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_example_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Examples::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_example({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_example name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_example ::Google::Cloud::Dialogflow::CX::V3::DeleteExampleRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_example({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_example(::Google::Cloud::Dialogflow::CX::V3::DeleteExampleRequest.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_example_client_stub.call_rpc_count + end + end + + def test_list_examples + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListExamplesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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" + language_code = "hello world" + + list_examples_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_examples, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest, 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["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_examples_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Examples::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_examples({ parent: parent, page_size: page_size, page_token: page_token, language_code: language_code }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_examples parent: parent, page_size: page_size, page_token: page_token, language_code: language_code do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_examples ::Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest.new(parent: parent, page_size: page_size, page_token: page_token, language_code: language_code) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_examples({ parent: parent, page_size: page_size, page_token: page_token, language_code: language_code }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_examples(::Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest.new(parent: parent, page_size: page_size, page_token: page_token, language_code: language_code), 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_examples_client_stub.call_rpc_count + end + end + + def test_get_example + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Example.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_example_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_example, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetExampleRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_example_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Examples::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_example({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_example name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_example ::Google::Cloud::Dialogflow::CX::V3::GetExampleRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_example({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_example(::Google::Cloud::Dialogflow::CX::V3::GetExampleRequest.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_example_client_stub.call_rpc_count + end + end + + def test_update_example + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Example.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + example = {} + update_mask = {} + + update_example_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_example, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::UpdateExampleRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Example), request["example"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_example_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Examples::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_example({ example: example, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_example example: example, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_example ::Google::Cloud::Dialogflow::CX::V3::UpdateExampleRequest.new(example: example, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_example({ example: example, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_example(::Google::Cloud::Dialogflow::CX::V3::UpdateExampleRequest.new(example: example, 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_example_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::CX::V3::Examples::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::CX::V3::Examples::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::CX::V3::Examples::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Examples::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_paths_test.rb new file mode 100644 index 000000000000..1b93ab32075a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_paths_test.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/experiments" + +class ::Google::Cloud::Dialogflow::CX::V3::Experiments::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_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::CX::V3::Experiments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.environment_path project: "value0", location: "value1", agent: "value2", environment: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/environments/value3", path + end + end + + def test_experiment_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::CX::V3::Experiments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.experiment_path project: "value0", location: "value1", agent: "value2", environment: "value3", experiment: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/environments/value3/experiments/value4", 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::CX::V3::Experiments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.version_path project: "value0", location: "value1", agent: "value2", flow: "value3", version: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/versions/value4", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_rest_test.rb new file mode 100644 index 000000000000..210c059980dc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_rest_test.rb @@ -0,0 +1,481 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/dialogflow/cx/v3/experiment_pb" +require "google/cloud/dialogflow/cx/v3/experiments/rest" + + +class ::Google::Cloud::Dialogflow::CX::V3::Experiments::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_experiments + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::ListExperimentsResponse.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_experiments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Experiments::Rest::ServiceStub.stub :transcode_list_experiments_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_experiments_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_experiments({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_experiments parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_experiments ::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_experiments({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_experiments(::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest.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_experiments_client_stub.call_count + end + end + end + + def test_get_experiment + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Experiment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_experiment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Experiments::Rest::ServiceStub.stub :transcode_get_experiment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_experiment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_experiment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_experiment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_experiment ::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_experiment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_experiment(::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_experiment_client_stub.call_count + end + end + end + + def test_create_experiment + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Experiment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + experiment = {} + + create_experiment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Experiments::Rest::ServiceStub.stub :transcode_create_experiment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_experiment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_experiment({ parent: parent, experiment: experiment }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_experiment parent: parent, experiment: experiment do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_experiment ::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest.new(parent: parent, experiment: experiment) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_experiment({ parent: parent, experiment: experiment }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_experiment(::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest.new(parent: parent, experiment: experiment), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_experiment_client_stub.call_count + end + end + end + + def test_update_experiment + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Experiment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + experiment = {} + update_mask = {} + + update_experiment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Experiments::Rest::ServiceStub.stub :transcode_update_experiment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_experiment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_experiment({ experiment: experiment, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_experiment experiment: experiment, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_experiment ::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest.new(experiment: experiment, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_experiment({ experiment: experiment, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_experiment(::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest.new(experiment: experiment, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_experiment_client_stub.call_count + end + end + end + + def test_delete_experiment + # 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_experiment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Experiments::Rest::ServiceStub.stub :transcode_delete_experiment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_experiment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_experiment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_experiment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_experiment ::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_experiment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_experiment(::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_experiment_client_stub.call_count + end + end + end + + def test_start_experiment + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Experiment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + start_experiment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Experiments::Rest::ServiceStub.stub :transcode_start_experiment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, start_experiment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.start_experiment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.start_experiment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.start_experiment ::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.start_experiment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.start_experiment(::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, start_experiment_client_stub.call_count + end + end + end + + def test_stop_experiment + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Experiment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + stop_experiment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Experiments::Rest::ServiceStub.stub :transcode_stop_experiment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, stop_experiment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.stop_experiment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.stop_experiment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.stop_experiment ::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.stop_experiment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.stop_experiment(::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, stop_experiment_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::CX::V3::Experiments::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::CX::V3::Experiments::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_test.rb new file mode 100644 index 000000000000..16825f2a6403 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_test.rb @@ -0,0 +1,523 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/experiment_pb" +require "google/cloud/dialogflow/cx/v3/experiments" + +class ::Google::Cloud::Dialogflow::CX::V3::Experiments::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_experiments + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListExperimentsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_experiments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_experiments, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest, 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_experiments_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_experiments({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_experiments parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_experiments ::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_experiments({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_experiments(::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest.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_experiments_client_stub.call_rpc_count + end + end + + def test_get_experiment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Experiment.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_experiment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_experiment, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_experiment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_experiment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_experiment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_experiment ::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_experiment({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_experiment(::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest.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_experiment_client_stub.call_rpc_count + end + end + + def test_create_experiment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Experiment.new + grpc_operation = GRPC::ActiveCall::Operation.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" + experiment = {} + + create_experiment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_experiment, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Experiment), request["experiment"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_experiment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_experiment({ parent: parent, experiment: experiment }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_experiment parent: parent, experiment: experiment do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_experiment ::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest.new(parent: parent, experiment: experiment) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_experiment({ parent: parent, experiment: experiment }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_experiment(::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest.new(parent: parent, experiment: experiment), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_experiment_client_stub.call_rpc_count + end + end + + def test_update_experiment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Experiment.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + experiment = {} + update_mask = {} + + update_experiment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_experiment, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Experiment), request["experiment"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_experiment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_experiment({ experiment: experiment, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_experiment experiment: experiment, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_experiment ::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest.new(experiment: experiment, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_experiment({ experiment: experiment, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_experiment(::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest.new(experiment: experiment, 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_experiment_client_stub.call_rpc_count + end + end + + def test_delete_experiment + # 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_experiment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_experiment, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_experiment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_experiment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_experiment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_experiment ::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_experiment({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_experiment(::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest.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_experiment_client_stub.call_rpc_count + end + end + + def test_start_experiment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Experiment.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + start_experiment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :start_experiment, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, start_experiment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.start_experiment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.start_experiment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.start_experiment ::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.start_experiment({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.start_experiment(::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest.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, start_experiment_client_stub.call_rpc_count + end + end + + def test_stop_experiment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Experiment.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + stop_experiment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :stop_experiment, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, stop_experiment_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.stop_experiment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.stop_experiment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.stop_experiment ::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.stop_experiment({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.stop_experiment(::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest.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, stop_experiment_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::CX::V3::Experiments::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::CX::V3::Experiments::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::CX::V3::Experiments::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_operations_test.rb new file mode 100644 index 000000000000..fc4cdc34a141 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_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/cx/v3/flow_pb" +require "google/cloud/dialogflow/cx/v3/flow_services_pb" +require "google/cloud/dialogflow/cx/v3/flows" + +class ::Google::Cloud::Dialogflow::CX::V3::Flows::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::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::CX::V3::Flows::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_paths_test.rb new file mode 100644 index 000000000000..100f203f923c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_paths_test.rb @@ -0,0 +1,166 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/flows" + +class ::Google::Cloud::Dialogflow::CX::V3::Flows::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::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_path project: "value0", location: "value1", agent: "value2" + assert_equal "projects/value0/locations/value1/agents/value2", path + end + end + + def test_flow_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::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.flow_path project: "value0", location: "value1", agent: "value2", flow: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/flows/value3", path + end + end + + def test_flow_validation_result_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::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.flow_validation_result_path project: "value0", location: "value1", agent: "value2", flow: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/validationResult", 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::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.generator_path project: "value0", location: "value1", agent: "value2", generator: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/generators/value3", 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::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.intent_path project: "value0", location: "value1", agent: "value2", intent: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/intents/value3", path + end + end + + def test_page_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::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.page_path project: "value0", location: "value1", agent: "value2", flow: "value3", page: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/pages/value4", path + end + end + + def test_playbook_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::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.playbook_path project: "value0", location: "value1", agent: "value2", playbook: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/playbooks/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::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tool_path project: "value0", location: "value1", agent: "value2", tool: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/tools/value3", path + end + end + + def test_transition_route_group_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::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.transition_route_group_path project: "value0", location: "value1", agent: "value2", flow: "value3", transition_route_group: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/transitionRouteGroups/value4", path + + path = client.transition_route_group_path project: "value0", location: "value1", agent: "value2", transition_route_group: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/transitionRouteGroups/value3", path + end + end + + def test_webhook_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::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.webhook_path project: "value0", location: "value1", agent: "value2", webhook: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/webhooks/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_rest_test.rb new file mode 100644 index 000000000000..ef662ba89df1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_rest_test.rb @@ -0,0 +1,655 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/flow_pb" +require "google/cloud/dialogflow/cx/v3/flows/rest" + + +class ::Google::Cloud::Dialogflow::CX::V3::Flows::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_flow + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Flow.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + flow = {} + language_code = "hello world" + + create_flow_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Flows::Rest::ServiceStub.stub :transcode_create_flow_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_flow_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_flow({ parent: parent, flow: flow, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_flow parent: parent, flow: flow, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_flow ::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest.new(parent: parent, flow: flow, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_flow({ parent: parent, flow: flow, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_flow(::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest.new(parent: parent, flow: flow, language_code: language_code), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_flow_client_stub.call_count + end + end + end + + def test_delete_flow + # 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_flow_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Flows::Rest::ServiceStub.stub :transcode_delete_flow_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_flow_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_flow({ name: name, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_flow name: name, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_flow ::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest.new(name: name, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_flow({ name: name, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_flow(::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest.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_flow_client_stub.call_count + end + end + end + + def test_list_flows + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::ListFlowsResponse.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" + language_code = "hello world" + + list_flows_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Flows::Rest::ServiceStub.stub :transcode_list_flows_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_flows_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_flows({ parent: parent, page_size: page_size, page_token: page_token, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_flows parent: parent, page_size: page_size, page_token: page_token, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_flows ::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest.new(parent: parent, page_size: page_size, page_token: page_token, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_flows({ parent: parent, page_size: page_size, page_token: page_token, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_flows(::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest.new(parent: parent, page_size: page_size, page_token: page_token, language_code: language_code), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_flows_client_stub.call_count + end + end + end + + def test_get_flow + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Flow.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_flow_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Flows::Rest::ServiceStub.stub :transcode_get_flow_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_flow_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_flow({ name: name, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_flow name: name, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_flow ::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest.new(name: name, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_flow({ name: name, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_flow(::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest.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_flow_client_stub.call_count + end + end + end + + def test_update_flow + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Flow.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + flow = {} + update_mask = {} + language_code = "hello world" + + update_flow_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Flows::Rest::ServiceStub.stub :transcode_update_flow_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_flow_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_flow({ flow: flow, update_mask: update_mask, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_flow flow: flow, update_mask: update_mask, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_flow ::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest.new(flow: flow, update_mask: update_mask, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_flow({ flow: flow, update_mask: update_mask, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_flow(::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest.new(flow: flow, update_mask: update_mask, language_code: language_code), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_flow_client_stub.call_count + end + end + end + + def test_train_flow + # 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" + + train_flow_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Flows::Rest::ServiceStub.stub :transcode_train_flow_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, train_flow_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.train_flow({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.train_flow name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.train_flow ::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.train_flow({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.train_flow(::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, train_flow_client_stub.call_count + end + end + end + + def test_validate_flow + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult.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" + + validate_flow_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Flows::Rest::ServiceStub.stub :transcode_validate_flow_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, validate_flow_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.validate_flow({ name: name, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.validate_flow name: name, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.validate_flow ::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest.new(name: name, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.validate_flow({ name: name, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.validate_flow(::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest.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, validate_flow_client_stub.call_count + end + end + end + + def test_get_flow_validation_result + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult.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_flow_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::CX::V3::Flows::Rest::ServiceStub.stub :transcode_get_flow_validation_result_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_flow_validation_result_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_flow_validation_result({ name: name, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_flow_validation_result name: name, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_flow_validation_result ::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest.new(name: name, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_flow_validation_result({ name: name, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_flow_validation_result(::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest.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_flow_validation_result_client_stub.call_count + end + end + end + + def test_import_flow + # 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" + flow_uri = "hello world" + import_option = :IMPORT_OPTION_UNSPECIFIED + flow_import_strategy = {} + + import_flow_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Flows::Rest::ServiceStub.stub :transcode_import_flow_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_flow_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_flow({ parent: parent, flow_uri: flow_uri, import_option: import_option, flow_import_strategy: flow_import_strategy }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_flow parent: parent, flow_uri: flow_uri, import_option: import_option, flow_import_strategy: flow_import_strategy do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_flow ::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest.new(parent: parent, flow_uri: flow_uri, import_option: import_option, flow_import_strategy: flow_import_strategy) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_flow({ parent: parent, flow_uri: flow_uri, import_option: import_option, flow_import_strategy: flow_import_strategy }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_flow(::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest.new(parent: parent, flow_uri: flow_uri, import_option: import_option, flow_import_strategy: flow_import_strategy), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_flow_client_stub.call_count + end + end + end + + def test_export_flow + # 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" + flow_uri = "hello world" + include_referenced_flows = true + + export_flow_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Flows::Rest::ServiceStub.stub :transcode_export_flow_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, export_flow_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.export_flow({ name: name, flow_uri: flow_uri, include_referenced_flows: include_referenced_flows }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.export_flow name: name, flow_uri: flow_uri, include_referenced_flows: include_referenced_flows do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.export_flow ::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest.new(name: name, flow_uri: flow_uri, include_referenced_flows: include_referenced_flows) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.export_flow({ name: name, flow_uri: flow_uri, include_referenced_flows: include_referenced_flows }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.export_flow(::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest.new(name: name, flow_uri: flow_uri, include_referenced_flows: include_referenced_flows), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, export_flow_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::CX::V3::Flows::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::CX::V3::Flows::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_test.rb new file mode 100644 index 000000000000..964b1a547032 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_test.rb @@ -0,0 +1,751 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/flow_pb" +require "google/cloud/dialogflow/cx/v3/flows" + +class ::Google::Cloud::Dialogflow::CX::V3::Flows::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_flow + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Flow.new + grpc_operation = GRPC::ActiveCall::Operation.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" + flow = {} + language_code = "hello world" + + create_flow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_flow, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Flow), request["flow"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_flow_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_flow({ parent: parent, flow: flow, language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_flow parent: parent, flow: flow, language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_flow ::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest.new(parent: parent, flow: flow, language_code: language_code) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_flow({ parent: parent, flow: flow, 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 + client.create_flow(::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest.new(parent: parent, flow: flow, 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_flow_client_stub.call_rpc_count + end + end + + def test_delete_flow + # 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_flow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_flow, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_flow_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_flow({ name: name, force: force }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_flow name: name, force: force do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_flow ::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest.new(name: name, force: force) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_flow({ 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 + client.delete_flow(::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest.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_flow_client_stub.call_rpc_count + end + end + + def test_list_flows + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListFlowsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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" + language_code = "hello world" + + list_flows_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_flows, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest, 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["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_flows_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_flows({ parent: parent, page_size: page_size, page_token: page_token, language_code: language_code }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_flows parent: parent, page_size: page_size, page_token: page_token, language_code: language_code do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_flows ::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest.new(parent: parent, page_size: page_size, page_token: page_token, language_code: language_code) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_flows({ parent: parent, page_size: page_size, page_token: page_token, language_code: language_code }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_flows(::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest.new(parent: parent, page_size: page_size, page_token: page_token, language_code: language_code), 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_flows_client_stub.call_rpc_count + end + end + + def test_get_flow + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Flow.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_flow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_flow, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_flow_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_flow({ name: name, language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_flow name: name, language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_flow ::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest.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 + client.get_flow({ 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 + client.get_flow(::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest.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_flow_client_stub.call_rpc_count + end + end + + def test_update_flow + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Flow.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + flow = {} + update_mask = {} + language_code = "hello world" + + update_flow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_flow, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Flow), request["flow"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_flow_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_flow({ flow: flow, update_mask: update_mask, language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_flow flow: flow, update_mask: update_mask, language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_flow ::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest.new(flow: flow, update_mask: update_mask, language_code: language_code) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_flow({ flow: flow, update_mask: update_mask, 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 + client.update_flow(::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest.new(flow: flow, update_mask: update_mask, 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, update_flow_client_stub.call_rpc_count + end + end + + def test_train_flow + # 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" + + train_flow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :train_flow, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, train_flow_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.train_flow({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.train_flow name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.train_flow ::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.train_flow({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.train_flow(::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest.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, train_flow_client_stub.call_rpc_count + end + end + + def test_validate_flow + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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" + + validate_flow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :validate_flow, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, validate_flow_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.validate_flow({ name: name, language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.validate_flow name: name, language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.validate_flow ::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest.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 + client.validate_flow({ 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 + client.validate_flow(::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest.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, validate_flow_client_stub.call_rpc_count + end + end + + def test_get_flow_validation_result + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_flow_validation_result_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_flow_validation_result, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_flow_validation_result_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_flow_validation_result({ name: name, language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_flow_validation_result name: name, language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_flow_validation_result ::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest.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 + client.get_flow_validation_result({ 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 + client.get_flow_validation_result(::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest.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_flow_validation_result_client_stub.call_rpc_count + end + end + + def test_import_flow + # 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" + flow_uri = "hello world" + import_option = :IMPORT_OPTION_UNSPECIFIED + flow_import_strategy = {} + + import_flow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_flow, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["flow_uri"] + assert_equal :flow_uri, request.flow + assert_equal :IMPORT_OPTION_UNSPECIFIED, request["import_option"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::FlowImportStrategy), request["flow_import_strategy"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_flow_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_flow({ parent: parent, flow_uri: flow_uri, import_option: import_option, flow_import_strategy: flow_import_strategy }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.import_flow parent: parent, flow_uri: flow_uri, import_option: import_option, flow_import_strategy: flow_import_strategy do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.import_flow ::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest.new(parent: parent, flow_uri: flow_uri, import_option: import_option, flow_import_strategy: flow_import_strategy) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.import_flow({ parent: parent, flow_uri: flow_uri, import_option: import_option, flow_import_strategy: flow_import_strategy }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.import_flow(::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest.new(parent: parent, flow_uri: flow_uri, import_option: import_option, flow_import_strategy: flow_import_strategy), 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_flow_client_stub.call_rpc_count + end + end + + def test_export_flow + # 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" + flow_uri = "hello world" + include_referenced_flows = true + + export_flow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :export_flow, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["flow_uri"] + assert_equal true, request["include_referenced_flows"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, export_flow_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.export_flow({ name: name, flow_uri: flow_uri, include_referenced_flows: include_referenced_flows }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.export_flow name: name, flow_uri: flow_uri, include_referenced_flows: include_referenced_flows do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.export_flow ::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest.new(name: name, flow_uri: flow_uri, include_referenced_flows: include_referenced_flows) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.export_flow({ name: name, flow_uri: flow_uri, include_referenced_flows: include_referenced_flows }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.export_flow(::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest.new(name: name, flow_uri: flow_uri, include_referenced_flows: include_referenced_flows), 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_flow_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::CX::V3::Flows::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::CX::V3::Flows::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::CX::V3::Flows::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Flows::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::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Flows::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_paths_test.rb new file mode 100644 index 000000000000..8e20a34e9d12 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_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/cx/v3/generators" + +class ::Google::Cloud::Dialogflow::CX::V3::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_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::CX::V3::Generators::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_path project: "value0", location: "value1", agent: "value2" + assert_equal "projects/value0/locations/value1/agents/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::CX::V3::Generators::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.generator_path project: "value0", location: "value1", agent: "value2", generator: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/generators/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_rest_test.rb new file mode 100644 index 000000000000..f72fe54fbe3e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_rest_test.rb @@ -0,0 +1,378 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/dialogflow/cx/v3/generator_pb" +require "google/cloud/dialogflow/cx/v3/generators/rest" + + +class ::Google::Cloud::Dialogflow::CX::V3::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_list_generators + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsResponse.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_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::CX::V3::Generators::Rest::ServiceStub.stub :transcode_list_generators_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_generators_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_generators({ 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 + client.list_generators 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 + client.list_generators ::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsRequest.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 + client.list_generators({ 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 + client.list_generators(::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsRequest.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_generators_client_stub.call_count + end + end + end + + def test_get_generator + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Generator.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_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::CX::V3::Generators::Rest::ServiceStub.stub :transcode_get_generator_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_generator_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_generator({ name: name, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_generator name: name, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_generator ::Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest.new(name: name, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_generator({ name: name, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_generator(::Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest.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_generator_client_stub.call_count + end + end + end + + def test_create_generator + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Generator.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + generator = {} + language_code = "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::CX::V3::Generators::Rest::ServiceStub.stub :transcode_create_generator_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_generator_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_generator({ parent: parent, generator: generator, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_generator parent: parent, generator: generator, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_generator ::Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest.new(parent: parent, generator: generator, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_generator({ parent: parent, generator: generator, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_generator(::Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest.new(parent: parent, generator: generator, language_code: language_code), 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_update_generator + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Generator.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + generator = {} + language_code = "hello world" + 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::CX::V3::Generators::Rest::ServiceStub.stub :transcode_update_generator_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_generator_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_generator({ generator: generator, language_code: language_code, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_generator generator: generator, language_code: language_code, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_generator ::Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest.new(generator: generator, language_code: language_code, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_generator({ generator: generator, 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 + client.update_generator(::Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest.new(generator: generator, 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_generator_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" + force = true + + 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::CX::V3::Generators::Rest::ServiceStub.stub :transcode_delete_generator_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_generator_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_generator({ name: name, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_generator name: name, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_generator ::Google::Cloud::Dialogflow::CX::V3::DeleteGeneratorRequest.new(name: name, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_generator({ name: name, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_generator(::Google::Cloud::Dialogflow::CX::V3::DeleteGeneratorRequest.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_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::CX::V3::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::CX::V3::Generators::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_test.rb new file mode 100644 index 000000000000..b341ddc20e28 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_test.rb @@ -0,0 +1,417 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/generator_pb" +require "google/cloud/dialogflow/cx/v3/generators" + +class ::Google::Cloud::Dialogflow::CX::V3::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_list_generators + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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" + language_code = "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::CX::V3::ListGeneratorsRequest, 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_generators_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_generators({ 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 + client.list_generators 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 + client.list_generators ::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsRequest.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 + client.list_generators({ 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 + client.list_generators(::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsRequest.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_generators_client_stub.call_rpc_count + end + end + + def test_get_generator + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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" + language_code = "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::CX::V3::GetGeneratorRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_generator_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_generator({ name: name, language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_generator name: name, language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_generator ::Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest.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 + client.get_generator({ 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 + client.get_generator(::Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest.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_generator_client_stub.call_rpc_count + end + end + + def test_create_generator + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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 = {} + language_code = "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::CX::V3::CreateGeneratorRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Generator), request["generator"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_generator_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_generator({ parent: parent, generator: generator, language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_generator parent: parent, generator: generator, language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_generator ::Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest.new(parent: parent, generator: generator, language_code: language_code) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_generator({ parent: parent, generator: generator, 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 + client.create_generator(::Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest.new(parent: parent, generator: generator, 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_generator_client_stub.call_rpc_count + end + end + + def test_update_generator + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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 = {} + language_code = "hello world" + 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::CX::V3::UpdateGeneratorRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Generator), request["generator"] + 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_generator_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_generator({ generator: generator, 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 + client.update_generator generator: generator, 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 + client.update_generator ::Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest.new(generator: generator, 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 + client.update_generator({ generator: generator, 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 + client.update_generator(::Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest.new(generator: generator, 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_generator_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" + force = true + + 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::CX::V3::DeleteGeneratorRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_generator_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_generator({ name: name, force: force }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_generator name: name, force: force do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_generator ::Google::Cloud::Dialogflow::CX::V3::DeleteGeneratorRequest.new(name: name, force: force) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_generator({ 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 + client.delete_generator(::Google::Cloud::Dialogflow::CX::V3::DeleteGeneratorRequest.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_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::CX::V3::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::CX::V3::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::CX::V3::Generators::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Generators::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_operations_test.rb new file mode 100644 index 000000000000..5f46f9cb2c65 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/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/cx/v3/intent_pb" +require "google/cloud/dialogflow/cx/v3/intent_services_pb" +require "google/cloud/dialogflow/cx/v3/intents" + +class ::Google::Cloud::Dialogflow::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Intents::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_paths_test.rb new file mode 100644 index 000000000000..a6e65114668f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_paths_test.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/intents" + +class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Intents::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_path project: "value0", location: "value1", agent: "value2" + assert_equal "projects/value0/locations/value1/agents/value2", 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::CX::V3::Intents::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.entity_type_path project: "value0", location: "value1", agent: "value2", entity_type: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/entityTypes/value3", 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::CX::V3::Intents::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.intent_path project: "value0", location: "value1", agent: "value2", intent: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/intents/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_rest_test.rb new file mode 100644 index 000000000000..dd1268ac557e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_rest_test.rb @@ -0,0 +1,491 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/dialogflow/cx/v3/intent_pb" +require "google/cloud/dialogflow/cx/v3/intents/rest" + + +class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::Intents::Rest::ServiceStub.stub :transcode_list_intents_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_intents_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.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 + client.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 + client.list_intents ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.list_intents(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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" + + 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::CX::V3::Intents::Rest::ServiceStub.stub :transcode_get_intent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_intent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_intent({ name: name, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_intent name: name, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_intent ::Google::Cloud::Dialogflow::CX::V3::GetIntentRequest.new(name: name, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_intent({ name: name, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_intent(::Google::Cloud::Dialogflow::CX::V3::GetIntentRequest.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_intent_client_stub.call_count + end + end + end + + def test_create_intent + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::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" + + 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::CX::V3::Intents::Rest::ServiceStub.stub :transcode_create_intent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_intent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_intent({ parent: parent, intent: intent, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_intent parent: parent, intent: intent, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_intent ::Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest.new(parent: parent, intent: intent, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_intent({ parent: parent, intent: intent, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_intent(::Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest.new(parent: parent, intent: intent, language_code: language_code), 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::CX::V3::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 = {} + + 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::CX::V3::Intents::Rest::ServiceStub.stub :transcode_update_intent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_intent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_intent({ intent: intent, language_code: language_code, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_intent intent: intent, language_code: language_code, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_intent ::Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest.new(intent: intent, language_code: language_code, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_intent({ intent: intent, 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 + client.update_intent(::Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest.new(intent: intent, 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_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::CX::V3::Intents::Rest::ServiceStub.stub :transcode_delete_intent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_intent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_intent({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_intent name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_intent ::Google::Cloud::Dialogflow::CX::V3::DeleteIntentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_intent({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_intent(::Google::Cloud::Dialogflow::CX::V3::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_import_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_uri = "hello world" + merge_option = :MERGE_OPTION_UNSPECIFIED + + import_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::CX::V3::Intents::Rest::ServiceStub.stub :transcode_import_intents_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_intents_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_intents({ parent: parent, intents_uri: intents_uri, merge_option: merge_option }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_intents parent: parent, intents_uri: intents_uri, merge_option: merge_option do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_intents ::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest.new(parent: parent, intents_uri: intents_uri, merge_option: merge_option) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_intents({ parent: parent, intents_uri: intents_uri, merge_option: merge_option }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_intents(::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest.new(parent: parent, intents_uri: intents_uri, merge_option: merge_option), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_intents_client_stub.call_count + end + end + end + + def test_export_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 = ["hello world"] + intents_uri = "hello world" + data_format = :DATA_FORMAT_UNSPECIFIED + + export_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::CX::V3::Intents::Rest::ServiceStub.stub :transcode_export_intents_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, export_intents_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.export_intents({ parent: parent, intents: intents, intents_uri: intents_uri, data_format: data_format }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.export_intents parent: parent, intents: intents, intents_uri: intents_uri, data_format: data_format do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.export_intents ::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest.new(parent: parent, intents: intents, intents_uri: intents_uri, data_format: data_format) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.export_intents({ parent: parent, intents: intents, intents_uri: intents_uri, data_format: data_format }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.export_intents(::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest.new(parent: parent, intents: intents, intents_uri: intents_uri, data_format: data_format), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, export_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::CX::V3::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::CX::V3::Intents::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_test.rb new file mode 100644 index 000000000000..fe39e65efc7f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_test.rb @@ -0,0 +1,569 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/intent_pb" +require "google/cloud/dialogflow/cx/v3/intents" + +class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.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 + client.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 + client.list_intents ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.list_intents(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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" + + 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::CX::V3::GetIntentRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_intent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_intent({ name: name, language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_intent name: name, language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_intent ::Google::Cloud::Dialogflow::CX::V3::GetIntentRequest.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 + client.get_intent({ 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 + client.get_intent(::Google::Cloud::Dialogflow::CX::V3::GetIntentRequest.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_intent_client_stub.call_rpc_count + end + end + + def test_create_intent + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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" + + 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::CX::V3::CreateIntentRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Intent), request["intent"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_intent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_intent({ parent: parent, intent: intent, language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_intent parent: parent, intent: intent, language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_intent ::Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest.new(parent: parent, intent: intent, language_code: language_code) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_intent({ parent: parent, intent: intent, 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 + client.create_intent(::Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest.new(parent: parent, intent: intent, 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_intent_client_stub.call_rpc_count + end + end + + def test_update_intent + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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 = {} + + 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::CX::V3::UpdateIntentRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Intent), request["intent"] + 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_intent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_intent({ intent: intent, 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 + client.update_intent intent: intent, 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 + client.update_intent ::Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest.new(intent: intent, 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 + client.update_intent({ intent: intent, 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 + client.update_intent(::Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest.new(intent: intent, 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_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::CX::V3::DeleteIntentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_intent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_intent({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_intent name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_intent ::Google::Cloud::Dialogflow::CX::V3::DeleteIntentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.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 + client.delete_intent(::Google::Cloud::Dialogflow::CX::V3::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_import_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_uri = "hello world" + merge_option = :MERGE_OPTION_UNSPECIFIED + + import_intents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_intents, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["intents_uri"] + assert_equal :intents_uri, request.intents + assert_equal :MERGE_OPTION_UNSPECIFIED, request["merge_option"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_intents_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_intents({ parent: parent, intents_uri: intents_uri, merge_option: merge_option }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.import_intents parent: parent, intents_uri: intents_uri, merge_option: merge_option do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.import_intents ::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest.new(parent: parent, intents_uri: intents_uri, merge_option: merge_option) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.import_intents({ parent: parent, intents_uri: intents_uri, merge_option: merge_option }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.import_intents(::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest.new(parent: parent, intents_uri: intents_uri, merge_option: merge_option), 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_intents_client_stub.call_rpc_count + end + end + + def test_export_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 = ["hello world"] + intents_uri = "hello world" + data_format = :DATA_FORMAT_UNSPECIFIED + + export_intents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :export_intents, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest, request + assert_equal "hello world", request["parent"] + assert_equal ["hello world"], request["intents"] + assert_equal "hello world", request["intents_uri"] + assert_equal :intents_uri, request.destination + assert_equal :DATA_FORMAT_UNSPECIFIED, request["data_format"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, export_intents_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.export_intents({ parent: parent, intents: intents, intents_uri: intents_uri, data_format: data_format }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.export_intents parent: parent, intents: intents, intents_uri: intents_uri, data_format: data_format do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.export_intents ::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest.new(parent: parent, intents: intents, intents_uri: intents_uri, data_format: data_format) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.export_intents({ parent: parent, intents: intents, intents_uri: intents_uri, data_format: data_format }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.export_intents(::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest.new(parent: parent, intents: intents, intents_uri: intents_uri, data_format: data_format), 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_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::CX::V3::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::CX::V3::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::CX::V3::Intents::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Intents::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Intents::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_paths_test.rb new file mode 100644 index 000000000000..0d213594ae2a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_paths_test.rb @@ -0,0 +1,154 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dialogflow/cx/v3/pages" + +class ::Google::Cloud::Dialogflow::CX::V3::Pages::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_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::CX::V3::Pages::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.entity_type_path project: "value0", location: "value1", agent: "value2", entity_type: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/entityTypes/value3", path + end + end + + def test_flow_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::CX::V3::Pages::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.flow_path project: "value0", location: "value1", agent: "value2", flow: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/flows/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::CX::V3::Pages::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.generator_path project: "value0", location: "value1", agent: "value2", generator: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/generators/value3", 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::CX::V3::Pages::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.intent_path project: "value0", location: "value1", agent: "value2", intent: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/intents/value3", path + end + end + + def test_page_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::CX::V3::Pages::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.page_path project: "value0", location: "value1", agent: "value2", flow: "value3", page: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/pages/value4", path + end + end + + def test_playbook_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::CX::V3::Pages::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.playbook_path project: "value0", location: "value1", agent: "value2", playbook: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/playbooks/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::CX::V3::Pages::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tool_path project: "value0", location: "value1", agent: "value2", tool: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/tools/value3", path + end + end + + def test_transition_route_group_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::CX::V3::Pages::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.transition_route_group_path project: "value0", location: "value1", agent: "value2", flow: "value3", transition_route_group: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/transitionRouteGroups/value4", path + + path = client.transition_route_group_path project: "value0", location: "value1", agent: "value2", transition_route_group: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/transitionRouteGroups/value3", path + end + end + + def test_webhook_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::CX::V3::Pages::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.webhook_path project: "value0", location: "value1", agent: "value2", webhook: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/webhooks/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_rest_test.rb new file mode 100644 index 000000000000..c0174b41d517 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_rest_test.rb @@ -0,0 +1,378 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/dialogflow/cx/v3/page_pb" +require "google/cloud/dialogflow/cx/v3/pages/rest" + + +class ::Google::Cloud::Dialogflow::CX::V3::Pages::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_pages + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::ListPagesResponse.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_pages_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Pages::Rest::ServiceStub.stub :transcode_list_pages_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_pages_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_pages({ 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 + client.list_pages 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 + client.list_pages ::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest.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 + client.list_pages({ 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 + client.list_pages(::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest.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_pages_client_stub.call_count + end + end + end + + def test_get_page + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Page.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_page_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Pages::Rest::ServiceStub.stub :transcode_get_page_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_page_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_page({ name: name, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_page name: name, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_page ::Google::Cloud::Dialogflow::CX::V3::GetPageRequest.new(name: name, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_page({ name: name, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_page(::Google::Cloud::Dialogflow::CX::V3::GetPageRequest.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_page_client_stub.call_count + end + end + end + + def test_create_page + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Page.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page = {} + language_code = "hello world" + + create_page_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Pages::Rest::ServiceStub.stub :transcode_create_page_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_page_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_page({ parent: parent, page: page, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_page parent: parent, page: page, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_page ::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest.new(parent: parent, page: page, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_page({ parent: parent, page: page, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_page(::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest.new(parent: parent, page: page, language_code: language_code), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_page_client_stub.call_count + end + end + end + + def test_update_page + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Page.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + page = {} + language_code = "hello world" + update_mask = {} + + update_page_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Pages::Rest::ServiceStub.stub :transcode_update_page_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_page_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_page({ page: page, language_code: language_code, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_page page: page, language_code: language_code, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_page ::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest.new(page: page, language_code: language_code, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_page({ page: page, 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 + client.update_page(::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest.new(page: page, 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_page_client_stub.call_count + end + end + end + + def test_delete_page + # 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_page_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Pages::Rest::ServiceStub.stub :transcode_delete_page_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_page_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_page({ name: name, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_page name: name, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_page ::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest.new(name: name, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_page({ name: name, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_page(::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest.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_page_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::CX::V3::Pages::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::CX::V3::Pages::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_test.rb new file mode 100644 index 000000000000..735b9697c228 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_test.rb @@ -0,0 +1,417 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/page_pb" +require "google/cloud/dialogflow/cx/v3/pages" + +class ::Google::Cloud::Dialogflow::CX::V3::Pages::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_pages + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListPagesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_pages_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_pages, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest, 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_pages_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_pages({ 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 + client.list_pages 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 + client.list_pages ::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest.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 + client.list_pages({ 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 + client.list_pages(::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest.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_pages_client_stub.call_rpc_count + end + end + + def test_get_page + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Page.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_page_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_page, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetPageRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_page_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_page({ name: name, language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_page name: name, language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_page ::Google::Cloud::Dialogflow::CX::V3::GetPageRequest.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 + client.get_page({ 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 + client.get_page(::Google::Cloud::Dialogflow::CX::V3::GetPageRequest.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_page_client_stub.call_rpc_count + end + end + + def test_create_page + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Page.new + grpc_operation = GRPC::ActiveCall::Operation.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 = {} + language_code = "hello world" + + create_page_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_page, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Page), request["page"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_page_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_page({ parent: parent, page: page, language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_page parent: parent, page: page, language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_page ::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest.new(parent: parent, page: page, language_code: language_code) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_page({ parent: parent, page: page, 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 + client.create_page(::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest.new(parent: parent, page: page, 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_page_client_stub.call_rpc_count + end + end + + def test_update_page + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Page.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + page = {} + language_code = "hello world" + update_mask = {} + + update_page_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_page, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Page), request["page"] + 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_page_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_page({ page: page, 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 + client.update_page page: page, 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 + client.update_page ::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest.new(page: page, 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 + client.update_page({ page: page, 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 + client.update_page(::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest.new(page: page, 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_page_client_stub.call_rpc_count + end + end + + def test_delete_page + # 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_page_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_page, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_page_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_page({ name: name, force: force }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_page name: name, force: force do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_page ::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest.new(name: name, force: force) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_page({ 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 + client.delete_page(::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest.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_page_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::CX::V3::Pages::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::CX::V3::Pages::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::CX::V3::Pages::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Pages::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_operations_test.rb new file mode 100644 index 000000000000..a4429169f38e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_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/cx/v3/playbook_pb" +require "google/cloud/dialogflow/cx/v3/playbook_services_pb" +require "google/cloud/dialogflow/cx/v3/playbooks" + +class ::Google::Cloud::Dialogflow::CX::V3::Playbooks::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::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::CX::V3::Playbooks::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_paths_test.rb new file mode 100644 index 000000000000..49286c65109c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_paths_test.rb @@ -0,0 +1,139 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/playbooks" + +class ::Google::Cloud::Dialogflow::CX::V3::Playbooks::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::CX::V3::Playbooks::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_path project: "value0", location: "value1", agent: "value2" + assert_equal "projects/value0/locations/value1/agents/value2", path + end + end + + def test_example_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::CX::V3::Playbooks::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.example_path project: "value0", location: "value1", agent: "value2", playbook: "value3", example: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/playbooks/value3/examples/value4", path + end + end + + def test_flow_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::CX::V3::Playbooks::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.flow_path project: "value0", location: "value1", agent: "value2", flow: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/flows/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::CX::V3::Playbooks::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.generator_path project: "value0", location: "value1", agent: "value2", generator: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/generators/value3", path + end + end + + def test_playbook_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::CX::V3::Playbooks::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.playbook_path project: "value0", location: "value1", agent: "value2", playbook: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/playbooks/value3", path + end + end + + def test_playbook_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::CX::V3::Playbooks::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.playbook_version_path project: "value0", location: "value1", agent: "value2", playbook: "value3", version: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/playbooks/value3/versions/value4", 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::CX::V3::Playbooks::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tool_path project: "value0", location: "value1", agent: "value2", tool: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/tools/value3", path + end + end + + def test_webhook_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::CX::V3::Playbooks::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.webhook_path project: "value0", location: "value1", agent: "value2", webhook: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/webhooks/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_rest_test.rb new file mode 100644 index 000000000000..5de4f3e0b29e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_rest_test.rb @@ -0,0 +1,758 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/playbook_pb" +require "google/cloud/dialogflow/cx/v3/playbooks/rest" + + +class ::Google::Cloud::Dialogflow::CX::V3::Playbooks::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_playbook + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Playbook.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + playbook = {} + + create_playbook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Playbooks::Rest::ServiceStub.stub :transcode_create_playbook_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_playbook_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_playbook({ parent: parent, playbook: playbook }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_playbook parent: parent, playbook: playbook do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_playbook ::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookRequest.new(parent: parent, playbook: playbook) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_playbook({ parent: parent, playbook: playbook }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_playbook(::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookRequest.new(parent: parent, playbook: playbook), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_playbook_client_stub.call_count + end + end + end + + def test_delete_playbook + # 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_playbook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Playbooks::Rest::ServiceStub.stub :transcode_delete_playbook_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_playbook_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_playbook({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_playbook name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_playbook ::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_playbook({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_playbook(::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_playbook_client_stub.call_count + end + end + end + + def test_list_playbooks + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksResponse.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_playbooks_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Playbooks::Rest::ServiceStub.stub :transcode_list_playbooks_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_playbooks_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_playbooks({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_playbooks parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_playbooks ::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_playbooks({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_playbooks(::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksRequest.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_playbooks_client_stub.call_count + end + end + end + + def test_get_playbook + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Playbook.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_playbook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Playbooks::Rest::ServiceStub.stub :transcode_get_playbook_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_playbook_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_playbook({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_playbook name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_playbook ::Google::Cloud::Dialogflow::CX::V3::GetPlaybookRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_playbook({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_playbook(::Google::Cloud::Dialogflow::CX::V3::GetPlaybookRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_playbook_client_stub.call_count + end + end + end + + def test_export_playbook + # 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" + playbook_uri = "hello world" + data_format = :DATA_FORMAT_UNSPECIFIED + + export_playbook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Playbooks::Rest::ServiceStub.stub :transcode_export_playbook_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, export_playbook_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.export_playbook({ name: name, playbook_uri: playbook_uri, data_format: data_format }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.export_playbook name: name, playbook_uri: playbook_uri, data_format: data_format do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.export_playbook ::Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest.new(name: name, playbook_uri: playbook_uri, data_format: data_format) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.export_playbook({ name: name, playbook_uri: playbook_uri, data_format: data_format }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.export_playbook(::Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest.new(name: name, playbook_uri: playbook_uri, data_format: data_format), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, export_playbook_client_stub.call_count + end + end + end + + def test_import_playbook + # 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" + playbook_uri = "hello world" + import_strategy = {} + + import_playbook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Playbooks::Rest::ServiceStub.stub :transcode_import_playbook_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_playbook_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_playbook({ parent: parent, playbook_uri: playbook_uri, import_strategy: import_strategy }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_playbook parent: parent, playbook_uri: playbook_uri, import_strategy: import_strategy do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_playbook ::Google::Cloud::Dialogflow::CX::V3::ImportPlaybookRequest.new(parent: parent, playbook_uri: playbook_uri, import_strategy: import_strategy) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_playbook({ parent: parent, playbook_uri: playbook_uri, import_strategy: import_strategy }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_playbook(::Google::Cloud::Dialogflow::CX::V3::ImportPlaybookRequest.new(parent: parent, playbook_uri: playbook_uri, import_strategy: import_strategy), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_playbook_client_stub.call_count + end + end + end + + def test_update_playbook + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Playbook.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + playbook = {} + update_mask = {} + + update_playbook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Playbooks::Rest::ServiceStub.stub :transcode_update_playbook_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_playbook_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_playbook({ playbook: playbook, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_playbook playbook: playbook, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_playbook ::Google::Cloud::Dialogflow::CX::V3::UpdatePlaybookRequest.new(playbook: playbook, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_playbook({ playbook: playbook, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_playbook(::Google::Cloud::Dialogflow::CX::V3::UpdatePlaybookRequest.new(playbook: playbook, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_playbook_client_stub.call_count + end + end + end + + def test_create_playbook_version + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + playbook_version = {} + + create_playbook_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::CX::V3::Playbooks::Rest::ServiceStub.stub :transcode_create_playbook_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_playbook_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_playbook_version({ parent: parent, playbook_version: playbook_version }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_playbook_version parent: parent, playbook_version: playbook_version do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_playbook_version ::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookVersionRequest.new(parent: parent, playbook_version: playbook_version) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_playbook_version({ parent: parent, playbook_version: playbook_version }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_playbook_version(::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookVersionRequest.new(parent: parent, playbook_version: playbook_version), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_playbook_version_client_stub.call_count + end + end + end + + def test_get_playbook_version + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_playbook_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::CX::V3::Playbooks::Rest::ServiceStub.stub :transcode_get_playbook_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_playbook_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_playbook_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_playbook_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_playbook_version ::Google::Cloud::Dialogflow::CX::V3::GetPlaybookVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_playbook_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_playbook_version(::Google::Cloud::Dialogflow::CX::V3::GetPlaybookVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_playbook_version_client_stub.call_count + end + end + end + + def test_restore_playbook_version + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + restore_playbook_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::CX::V3::Playbooks::Rest::ServiceStub.stub :transcode_restore_playbook_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, restore_playbook_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.restore_playbook_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.restore_playbook_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.restore_playbook_version ::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.restore_playbook_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.restore_playbook_version(::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, restore_playbook_version_client_stub.call_count + end + end + end + + def test_list_playbook_versions + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsResponse.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_playbook_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::CX::V3::Playbooks::Rest::ServiceStub.stub :transcode_list_playbook_versions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_playbook_versions_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_playbook_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 + client.list_playbook_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 + client.list_playbook_versions ::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_playbook_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 + client.list_playbook_versions(::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsRequest.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_playbook_versions_client_stub.call_count + end + end + end + + def test_delete_playbook_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_playbook_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::CX::V3::Playbooks::Rest::ServiceStub.stub :transcode_delete_playbook_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_playbook_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_playbook_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_playbook_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_playbook_version ::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_playbook_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_playbook_version(::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_playbook_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::CX::V3::Playbooks::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::CX::V3::Playbooks::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_test.rb new file mode 100644 index 000000000000..fa3d0115204d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_test.rb @@ -0,0 +1,857 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/playbook_pb" +require "google/cloud/dialogflow/cx/v3/playbooks" + +class ::Google::Cloud::Dialogflow::CX::V3::Playbooks::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_playbook + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Playbook.new + grpc_operation = GRPC::ActiveCall::Operation.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" + playbook = {} + + create_playbook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_playbook, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Playbook), request["playbook"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_playbook_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_playbook({ parent: parent, playbook: playbook }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_playbook parent: parent, playbook: playbook do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_playbook ::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookRequest.new(parent: parent, playbook: playbook) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_playbook({ parent: parent, playbook: playbook }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_playbook(::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookRequest.new(parent: parent, playbook: playbook), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_playbook_client_stub.call_rpc_count + end + end + + def test_delete_playbook + # 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_playbook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_playbook, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_playbook_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_playbook({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_playbook name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_playbook ::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_playbook({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_playbook(::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookRequest.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_playbook_client_stub.call_rpc_count + end + end + + def test_list_playbooks + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_playbooks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_playbooks, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksRequest, 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_playbooks_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_playbooks({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_playbooks parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_playbooks ::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_playbooks({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_playbooks(::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksRequest.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_playbooks_client_stub.call_rpc_count + end + end + + def test_get_playbook + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Playbook.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_playbook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_playbook, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetPlaybookRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_playbook_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_playbook({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_playbook name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_playbook ::Google::Cloud::Dialogflow::CX::V3::GetPlaybookRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_playbook({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_playbook(::Google::Cloud::Dialogflow::CX::V3::GetPlaybookRequest.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_playbook_client_stub.call_rpc_count + end + end + + def test_export_playbook + # 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" + playbook_uri = "hello world" + data_format = :DATA_FORMAT_UNSPECIFIED + + export_playbook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :export_playbook, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["playbook_uri"] + assert_equal :DATA_FORMAT_UNSPECIFIED, request["data_format"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, export_playbook_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.export_playbook({ name: name, playbook_uri: playbook_uri, data_format: data_format }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.export_playbook name: name, playbook_uri: playbook_uri, data_format: data_format do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.export_playbook ::Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest.new(name: name, playbook_uri: playbook_uri, data_format: data_format) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.export_playbook({ name: name, playbook_uri: playbook_uri, data_format: data_format }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.export_playbook(::Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest.new(name: name, playbook_uri: playbook_uri, data_format: data_format), 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_playbook_client_stub.call_rpc_count + end + end + + def test_import_playbook + # 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" + playbook_uri = "hello world" + import_strategy = {} + + import_playbook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_playbook, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ImportPlaybookRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["playbook_uri"] + assert_equal :playbook_uri, request.playbook + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::PlaybookImportStrategy), request["import_strategy"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_playbook_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_playbook({ parent: parent, playbook_uri: playbook_uri, import_strategy: import_strategy }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.import_playbook parent: parent, playbook_uri: playbook_uri, import_strategy: import_strategy do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.import_playbook ::Google::Cloud::Dialogflow::CX::V3::ImportPlaybookRequest.new(parent: parent, playbook_uri: playbook_uri, import_strategy: import_strategy) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.import_playbook({ parent: parent, playbook_uri: playbook_uri, import_strategy: import_strategy }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.import_playbook(::Google::Cloud::Dialogflow::CX::V3::ImportPlaybookRequest.new(parent: parent, playbook_uri: playbook_uri, import_strategy: import_strategy), 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_playbook_client_stub.call_rpc_count + end + end + + def test_update_playbook + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Playbook.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + playbook = {} + update_mask = {} + + update_playbook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_playbook, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::UpdatePlaybookRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Playbook), request["playbook"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_playbook_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_playbook({ playbook: playbook, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_playbook playbook: playbook, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_playbook ::Google::Cloud::Dialogflow::CX::V3::UpdatePlaybookRequest.new(playbook: playbook, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_playbook({ playbook: playbook, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_playbook(::Google::Cloud::Dialogflow::CX::V3::UpdatePlaybookRequest.new(playbook: playbook, 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_playbook_client_stub.call_rpc_count + end + end + + def test_create_playbook_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion.new + grpc_operation = GRPC::ActiveCall::Operation.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" + playbook_version = {} + + create_playbook_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_playbook_version, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookVersionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion), request["playbook_version"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_playbook_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_playbook_version({ parent: parent, playbook_version: playbook_version }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_playbook_version parent: parent, playbook_version: playbook_version do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_playbook_version ::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookVersionRequest.new(parent: parent, playbook_version: playbook_version) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_playbook_version({ parent: parent, playbook_version: playbook_version }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_playbook_version(::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookVersionRequest.new(parent: parent, playbook_version: playbook_version), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_playbook_version_client_stub.call_rpc_count + end + end + + def test_get_playbook_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_playbook_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_playbook_version, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetPlaybookVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_playbook_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_playbook_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_playbook_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_playbook_version ::Google::Cloud::Dialogflow::CX::V3::GetPlaybookVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_playbook_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_playbook_version(::Google::Cloud::Dialogflow::CX::V3::GetPlaybookVersionRequest.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_playbook_version_client_stub.call_rpc_count + end + end + + def test_restore_playbook_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + restore_playbook_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :restore_playbook_version, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, restore_playbook_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.restore_playbook_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.restore_playbook_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.restore_playbook_version ::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.restore_playbook_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.restore_playbook_version(::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionRequest.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, restore_playbook_version_client_stub.call_rpc_count + end + end + + def test_list_playbook_versions + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_playbook_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_playbook_versions, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsRequest, 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_playbook_versions_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_playbook_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 + client.list_playbook_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 + client.list_playbook_versions ::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_playbook_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 + client.list_playbook_versions(::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsRequest.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_playbook_versions_client_stub.call_rpc_count + end + end + + def test_delete_playbook_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_playbook_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_playbook_version, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_playbook_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_playbook_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_playbook_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_playbook_version ::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_playbook_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_playbook_version(::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookVersionRequest.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_playbook_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::CX::V3::Playbooks::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::CX::V3::Playbooks::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::CX::V3::Playbooks::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Playbooks::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::CX::V3::Playbooks::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Playbooks::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_paths_test.rb new file mode 100644 index 000000000000..aa904f3a8c23 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_paths_test.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dialogflow/cx/v3/security_settings_service" + +class ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::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_deidentify_template_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::CX::V3::SecuritySettingsService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.deidentify_template_path organization: "value0", location: "value1", deidentify_template: "value2" + assert_equal "organizations/value0/locations/value1/deidentifyTemplates/value2", path + + path = client.deidentify_template_path project: "value0", location: "value1", deidentify_template: "value2" + assert_equal "projects/value0/locations/value1/deidentifyTemplates/value2", path + end + end + + def test_inspect_template_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::CX::V3::SecuritySettingsService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.inspect_template_path organization: "value0", location: "value1", inspect_template: "value2" + assert_equal "organizations/value0/locations/value1/inspectTemplates/value2", path + + path = client.inspect_template_path project: "value0", location: "value1", inspect_template: "value2" + assert_equal "projects/value0/locations/value1/inspectTemplates/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::CX::V3::SecuritySettingsService::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_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::CX::V3::SecuritySettingsService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.security_settings_path project: "value0", location: "value1", security_settings: "value2" + assert_equal "projects/value0/locations/value1/securitySettings/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_rest_test.rb new file mode 100644 index 000000000000..f0979a176e23 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_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/cx/v3/security_settings_pb" +require "google/cloud/dialogflow/cx/v3/security_settings_service/rest" + + +class ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::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_security_settings + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + security_settings = {} + + create_security_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::SecuritySettingsService::Rest::ServiceStub.stub :transcode_create_security_settings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_security_settings_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_security_settings({ parent: parent, security_settings: security_settings }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_security_settings parent: parent, security_settings: security_settings do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_security_settings ::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest.new(parent: parent, security_settings: security_settings) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_security_settings({ parent: parent, security_settings: security_settings }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_security_settings(::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest.new(parent: parent, security_settings: security_settings), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_security_settings_client_stub.call_count + end + end + end + + def test_get_security_settings + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_security_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::SecuritySettingsService::Rest::ServiceStub.stub :transcode_get_security_settings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_security_settings_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_security_settings({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_security_settings name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_security_settings ::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_security_settings({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_security_settings(::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_security_settings_client_stub.call_count + end + end + end + + def test_update_security_settings + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + security_settings = {} + update_mask = {} + + update_security_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::SecuritySettingsService::Rest::ServiceStub.stub :transcode_update_security_settings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_security_settings_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_security_settings({ security_settings: security_settings, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_security_settings security_settings: security_settings, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_security_settings ::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest.new(security_settings: security_settings, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_security_settings({ security_settings: security_settings, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_security_settings(::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest.new(security_settings: security_settings, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_security_settings_client_stub.call_count + end + end + end + + def test_list_security_settings + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsResponse.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_security_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::SecuritySettingsService::Rest::ServiceStub.stub :transcode_list_security_settings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_security_settings_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_security_settings({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_security_settings parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_security_settings ::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_security_settings({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_security_settings(::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest.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_security_settings_client_stub.call_count + end + end + end + + def test_delete_security_settings + # 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_security_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::SecuritySettingsService::Rest::ServiceStub.stub :transcode_delete_security_settings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_security_settings_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_security_settings({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_security_settings name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_security_settings ::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_security_settings({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_security_settings(::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_security_settings_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::CX::V3::SecuritySettingsService::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::CX::V3::SecuritySettingsService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_test.rb new file mode 100644 index 000000000000..23082a638ec0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_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/cx/v3/security_settings_pb" +require "google/cloud/dialogflow/cx/v3/security_settings_service" + +class ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::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_security_settings + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings.new + grpc_operation = GRPC::ActiveCall::Operation.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" + security_settings = {} + + create_security_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_security_settings, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings), request["security_settings"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_security_settings_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_security_settings({ parent: parent, security_settings: security_settings }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_security_settings parent: parent, security_settings: security_settings do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_security_settings ::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest.new(parent: parent, security_settings: security_settings) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_security_settings({ parent: parent, 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 + client.create_security_settings(::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest.new(parent: parent, 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, create_security_settings_client_stub.call_rpc_count + end + end + + def test_get_security_settings + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_security_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_security_settings, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_security_settings_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_security_settings({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_security_settings name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_security_settings ::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_security_settings({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_security_settings(::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest.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_security_settings_client_stub.call_rpc_count + end + end + + def test_update_security_settings + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + security_settings = {} + update_mask = {} + + update_security_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_security_settings, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings), request["security_settings"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_security_settings_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_security_settings({ security_settings: security_settings, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_security_settings security_settings: security_settings, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_security_settings ::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest.new(security_settings: security_settings, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_security_settings({ security_settings: security_settings, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_security_settings(::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest.new(security_settings: security_settings, 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_security_settings_client_stub.call_rpc_count + end + end + + def test_list_security_settings + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_security_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_security_settings, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest, 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_security_settings_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_security_settings({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_security_settings parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_security_settings ::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_security_settings({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_security_settings(::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest.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_security_settings_client_stub.call_rpc_count + end + end + + def test_delete_security_settings + # 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_security_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_security_settings, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_security_settings_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_security_settings({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_security_settings name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_security_settings ::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_security_settings({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_security_settings(::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest.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_security_settings_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::CX::V3::SecuritySettingsService::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::CX::V3::SecuritySettingsService::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::CX::V3::SecuritySettingsService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_paths_test.rb new file mode 100644 index 000000000000..776f37f37876 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_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/cx/v3/session_entity_types" + +class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.session_path project: "value0", location: "value1", agent: "value2", session: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/sessions/value3", path + + path = client.session_path project: "value0", location: "value1", agent: "value2", environment: "value3", session: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/environments/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::CX::V3::SessionEntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.session_entity_type_path project: "value0", location: "value1", agent: "value2", session: "value3", entity_type: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/sessions/value3/entityTypes/value4", path + + path = client.session_entity_type_path project: "value0", location: "value1", agent: "value2", environment: "value3", session: "value4", entity_type: "value5" + assert_equal "projects/value0/locations/value1/agents/value2/environments/value3/sessions/value4/entityTypes/value5", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_rest_test.rb new file mode 100644 index 000000000000..a6d8e6ae5cca --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/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/cx/v3/session_entity_type_pb" +require "google/cloud/dialogflow/cx/v3/session_entity_types/rest" + + +class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.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 + client.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 + client.list_session_entity_types ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.list_session_entity_types(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_session_entity_type({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_session_entity_type name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_session_entity_type ::Google::Cloud::Dialogflow::CX::V3::GetSessionEntityTypeRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_session_entity_type({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_session_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.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 + client.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 + client.create_session_entity_type ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.create_session_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.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 + client.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 + client.update_session_entity_type ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.update_session_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_session_entity_type({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_session_entity_type name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_session_entity_type ::Google::Cloud::Dialogflow::CX::V3::DeleteSessionEntityTypeRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_session_entity_type({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_session_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::SessionEntityTypes::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_test.rb new file mode 100644 index 000000000000..3104391ae51e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/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/cx/v3/session_entity_type_pb" +require "google/cloud/dialogflow/cx/v3/session_entity_types" + +class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.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 + client.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 + client.list_session_entity_types ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.list_session_entity_types(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_session_entity_type({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_session_entity_type name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_session_entity_type ::Google::Cloud::Dialogflow::CX::V3::GetSessionEntityTypeRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.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 + client.get_session_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::CreateSessionEntityTypeRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::SessionEntityType), request["session_entity_type"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_session_entity_type_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.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 + client.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 + client.create_session_entity_type ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.create_session_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::UpdateSessionEntityTypeRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.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 + client.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 + client.update_session_entity_type ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.update_session_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_session_entity_type({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_session_entity_type name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_session_entity_type ::Google::Cloud::Dialogflow::CX::V3::DeleteSessionEntityTypeRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_session_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 + client.delete_session_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::SessionEntityTypes::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_paths_test.rb new file mode 100644 index 000000000000..d053c221f0ad --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_paths_test.rb @@ -0,0 +1,160 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/sessions" + +class ::Google::Cloud::Dialogflow::CX::V3::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_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::CX::V3::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.data_store_path project: "value0", location: "value1", data_store: "value2" + assert_equal "projects/value0/locations/value1/dataStores/value2", path + + path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path + end + end + + def test_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::CX::V3::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.entity_type_path project: "value0", location: "value1", agent: "value2", entity_type: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/entityTypes/value3", 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::CX::V3::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.intent_path project: "value0", location: "value1", agent: "value2", intent: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/intents/value3", path + end + end + + def test_page_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::CX::V3::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.page_path project: "value0", location: "value1", agent: "value2", flow: "value3", page: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/pages/value4", path + end + end + + def test_playbook_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::CX::V3::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.playbook_path project: "value0", location: "value1", agent: "value2", playbook: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/playbooks/value3", path + end + end + + def test_session_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.session_path project: "value0", location: "value1", agent: "value2", session: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/sessions/value3", path + + path = client.session_path project: "value0", location: "value1", agent: "value2", environment: "value3", session: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/environments/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::CX::V3::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.session_entity_type_path project: "value0", location: "value1", agent: "value2", session: "value3", entity_type: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/sessions/value3/entityTypes/value4", path + + path = client.session_entity_type_path project: "value0", location: "value1", agent: "value2", environment: "value3", session: "value4", entity_type: "value5" + assert_equal "projects/value0/locations/value1/agents/value2/environments/value3/sessions/value4/entityTypes/value5", 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::CX::V3::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tool_path project: "value0", location: "value1", agent: "value2", tool: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/tools/value3", 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::CX::V3::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.version_path project: "value0", location: "value1", agent: "value2", flow: "value3", version: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/versions/value4", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_rest_test.rb new file mode 100644 index 000000000000..e3fae9be0f2a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_rest_test.rb @@ -0,0 +1,385 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/session_pb" +require "google/cloud/dialogflow/cx/v3/sessions/rest" + + +class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 = {} + response_view = :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED + + 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::CX::V3::Sessions::Rest::ServiceStub.stub :transcode_detect_intent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, detect_intent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.detect_intent session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.detect_intent ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.detect_intent(::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view), 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_server_streaming_detect_intent + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::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 = {} + response_view = :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED + + server_streaming_detect_intent_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, is_server_streaming:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::ServiceStub.stub :transcode_server_streaming_detect_intent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, server_streaming_detect_intent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.server_streaming_detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use named arguments + client.server_streaming_detect_intent session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use protobuf object + client.server_streaming_detect_intent ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use hash object with options + client.server_streaming_detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use protobuf object with options + client.server_streaming_detect_intent(::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Verify method calls + assert_equal 5, server_streaming_detect_intent_client_stub.call_count + end + end + end + + def test_match_intent + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse.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 = {} + persist_parameter_changes = true + + match_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::CX::V3::Sessions::Rest::ServiceStub.stub :transcode_match_intent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, match_intent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.match_intent({ session: session, query_params: query_params, query_input: query_input, persist_parameter_changes: persist_parameter_changes }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.match_intent session: session, query_params: query_params, query_input: query_input, persist_parameter_changes: persist_parameter_changes do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.match_intent ::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest.new(session: session, query_params: query_params, query_input: query_input, persist_parameter_changes: persist_parameter_changes) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.match_intent({ session: session, query_params: query_params, query_input: query_input, persist_parameter_changes: persist_parameter_changes }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.match_intent(::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest.new(session: session, query_params: query_params, query_input: query_input, persist_parameter_changes: persist_parameter_changes), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, match_intent_client_stub.call_count + end + end + end + + def test_fulfill_intent + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + match_intent_request = {} + match = {} + output_audio_config = {} + + fulfill_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::CX::V3::Sessions::Rest::ServiceStub.stub :transcode_fulfill_intent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, fulfill_intent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.fulfill_intent({ match_intent_request: match_intent_request, match: match, output_audio_config: output_audio_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.fulfill_intent match_intent_request: match_intent_request, match: match, output_audio_config: output_audio_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.fulfill_intent ::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest.new(match_intent_request: match_intent_request, match: match, output_audio_config: output_audio_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.fulfill_intent({ match_intent_request: match_intent_request, match: match, output_audio_config: output_audio_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.fulfill_intent(::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest.new(match_intent_request: match_intent_request, match: match, output_audio_config: output_audio_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, fulfill_intent_client_stub.call_count + end + end + end + + def test_submit_answer_feedback + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + session = "hello world" + response_id = "hello world" + answer_feedback = {} + update_mask = {} + + submit_answer_feedback_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Sessions::Rest::ServiceStub.stub :transcode_submit_answer_feedback_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, submit_answer_feedback_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.submit_answer_feedback({ session: session, response_id: response_id, answer_feedback: answer_feedback, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.submit_answer_feedback session: session, response_id: response_id, answer_feedback: answer_feedback, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.submit_answer_feedback ::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest.new(session: session, response_id: response_id, answer_feedback: answer_feedback, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.submit_answer_feedback({ session: session, response_id: response_id, answer_feedback: answer_feedback, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.submit_answer_feedback(::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest.new(session: session, response_id: response_id, answer_feedback: answer_feedback, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, submit_answer_feedback_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::CX::V3::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::CX::V3::Sessions::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_test.rb new file mode 100644 index 000000000000..8a960b6dec3c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_test.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! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dialogflow/cx/v3/session_pb" +require "google/cloud/dialogflow/cx/v3/sessions" + +class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 = {} + response_view = :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED + + 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::CX::V3::DetectIntentRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::QueryParameters), request["query_params"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::QueryInput), request["query_input"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig), request["output_audio_config"] + assert_equal :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED, request["response_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, detect_intent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.detect_intent session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.detect_intent ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.detect_intent(::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view), 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_server_streaming_detect_intent + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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 server streaming method. + session = "hello world" + query_params = {} + query_input = {} + output_audio_config = {} + response_view = :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED + + server_streaming_detect_intent_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :server_streaming_detect_intent, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::QueryParameters), request["query_params"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::QueryInput), request["query_input"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig), request["output_audio_config"] + assert_equal :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED, request["response_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, server_streaming_detect_intent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.server_streaming_detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse, r + end + assert_equal grpc_operation, operation + end + + # Use named arguments + client.server_streaming_detect_intent session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.server_streaming_detect_intent ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse, r + end + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.server_streaming_detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }, grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.server_streaming_detect_intent(::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view), grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse, r + end + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, server_streaming_detect_intent_client_stub.call_rpc_count + end + end + + def test_streaming_detect_intent + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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 = {} + output_audio_config = {} + enable_partial_response = true + enable_debugging_info = true + response_view = :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED + + 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 + client = ::Google::Cloud::Dialogflow::CX::V3::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, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view } + request_proto = ::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view + enum_input = [request_hash, request_proto].to_enum + client.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::CX::V3::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, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view } + request_proto = ::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view + stream_input = Gapic::StreamInput.new + client.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::CX::V3::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, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view } + request_proto = ::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view + enum_input = [request_hash, request_proto].to_enum + client.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::CX::V3::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, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view } + request_proto = ::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view + stream_input = Gapic::StreamInput.new + client.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::CX::V3::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::CX::V3::StreamingDetectIntentRequest, r + assert_equal "hello world", r["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::QueryParameters), r["query_params"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::QueryInput), r["query_input"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig), r["output_audio_config"] + assert_equal true, r["enable_partial_response"] + assert_equal true, r["enable_debugging_info"] + assert_equal :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED, r["response_view"] + end + end + end + end + + def test_match_intent + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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 = {} + persist_parameter_changes = true + + match_intent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :match_intent, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::QueryParameters), request["query_params"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::QueryInput), request["query_input"] + assert_equal true, request["persist_parameter_changes"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, match_intent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.match_intent({ session: session, query_params: query_params, query_input: query_input, persist_parameter_changes: persist_parameter_changes }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.match_intent session: session, query_params: query_params, query_input: query_input, persist_parameter_changes: persist_parameter_changes do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.match_intent ::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest.new(session: session, query_params: query_params, query_input: query_input, persist_parameter_changes: persist_parameter_changes) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.match_intent({ session: session, query_params: query_params, query_input: query_input, persist_parameter_changes: persist_parameter_changes }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.match_intent(::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest.new(session: session, query_params: query_params, query_input: query_input, persist_parameter_changes: persist_parameter_changes), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, match_intent_client_stub.call_rpc_count + end + end + + def test_fulfill_intent + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + match_intent_request = {} + match = {} + output_audio_config = {} + + fulfill_intent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :fulfill_intent, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest), request["match_intent_request"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Match), request["match"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig), request["output_audio_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, fulfill_intent_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.fulfill_intent({ match_intent_request: match_intent_request, match: match, output_audio_config: output_audio_config }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.fulfill_intent match_intent_request: match_intent_request, match: match, output_audio_config: output_audio_config do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.fulfill_intent ::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest.new(match_intent_request: match_intent_request, match: match, output_audio_config: output_audio_config) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.fulfill_intent({ match_intent_request: match_intent_request, match: match, output_audio_config: output_audio_config }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.fulfill_intent(::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest.new(match_intent_request: match_intent_request, match: match, output_audio_config: output_audio_config), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, fulfill_intent_client_stub.call_rpc_count + end + end + + def test_submit_answer_feedback + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback.new + grpc_operation = GRPC::ActiveCall::Operation.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" + response_id = "hello world" + answer_feedback = {} + update_mask = {} + + submit_answer_feedback_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :submit_answer_feedback, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest, request + assert_equal "hello world", request["session"] + assert_equal "hello world", request["response_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback), request["answer_feedback"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, submit_answer_feedback_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.submit_answer_feedback({ session: session, response_id: response_id, answer_feedback: answer_feedback, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.submit_answer_feedback session: session, response_id: response_id, answer_feedback: answer_feedback, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.submit_answer_feedback ::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest.new(session: session, response_id: response_id, answer_feedback: answer_feedback, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.submit_answer_feedback({ session: session, response_id: response_id, answer_feedback: answer_feedback, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.submit_answer_feedback(::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest.new(session: session, response_id: response_id, answer_feedback: answer_feedback, 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, submit_answer_feedback_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::CX::V3::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::CX::V3::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::CX::V3::Sessions::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_operations_test.rb new file mode 100644 index 000000000000..e7c36e52bde3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_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/cx/v3/test_case_pb" +require "google/cloud/dialogflow/cx/v3/test_case_services_pb" +require "google/cloud/dialogflow/cx/v3/test_cases" + +class ::Google::Cloud::Dialogflow::CX::V3::TestCases::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::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::CX::V3::TestCases::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_paths_test.rb new file mode 100644 index 000000000000..9ee606a95f37 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_paths_test.rb @@ -0,0 +1,202 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/test_cases" + +class ::Google::Cloud::Dialogflow::CX::V3::TestCases::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::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_path project: "value0", location: "value1", agent: "value2" + assert_equal "projects/value0/locations/value1/agents/value2", 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::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.entity_type_path project: "value0", location: "value1", agent: "value2", entity_type: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/entityTypes/value3", 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::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.environment_path project: "value0", location: "value1", agent: "value2", environment: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/environments/value3", path + end + end + + def test_flow_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::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.flow_path project: "value0", location: "value1", agent: "value2", flow: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/flows/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::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.generator_path project: "value0", location: "value1", agent: "value2", generator: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/generators/value3", 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::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.intent_path project: "value0", location: "value1", agent: "value2", intent: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/intents/value3", path + end + end + + def test_page_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::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.page_path project: "value0", location: "value1", agent: "value2", flow: "value3", page: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/pages/value4", path + end + end + + def test_playbook_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::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.playbook_path project: "value0", location: "value1", agent: "value2", playbook: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/playbooks/value3", path + end + end + + def test_test_case_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::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.test_case_path project: "value0", location: "value1", agent: "value2", test_case: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/testCases/value3", path + end + end + + def test_test_case_result_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::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.test_case_result_path project: "value0", location: "value1", agent: "value2", test_case: "value3", result: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/testCases/value3/results/value4", 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::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tool_path project: "value0", location: "value1", agent: "value2", tool: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/tools/value3", path + end + end + + def test_transition_route_group_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::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.transition_route_group_path project: "value0", location: "value1", agent: "value2", flow: "value3", transition_route_group: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/transitionRouteGroups/value4", path + + path = client.transition_route_group_path project: "value0", location: "value1", agent: "value2", transition_route_group: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/transitionRouteGroups/value3", path + end + end + + def test_webhook_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::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.webhook_path project: "value0", location: "value1", agent: "value2", webhook: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/webhooks/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_rest_test.rb new file mode 100644 index 000000000000..7ab4fb4beef7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_rest_test.rb @@ -0,0 +1,764 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/test_case_pb" +require "google/cloud/dialogflow/cx/v3/test_cases/rest" + + +class ::Google::Cloud::Dialogflow::CX::V3::TestCases::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_test_cases + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::ListTestCasesResponse.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" + view = :TEST_CASE_VIEW_UNSPECIFIED + + list_test_cases_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_list_test_cases_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_test_cases_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_test_cases({ parent: parent, page_size: page_size, page_token: page_token, view: view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_test_cases parent: parent, page_size: page_size, page_token: page_token, view: view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_test_cases ::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_test_cases({ parent: parent, page_size: page_size, page_token: page_token, view: view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_test_cases(::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_test_cases_client_stub.call_count + end + end + end + + def test_batch_delete_test_cases + # 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" + names = ["hello world"] + + batch_delete_test_cases_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_batch_delete_test_cases_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_delete_test_cases_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_delete_test_cases({ parent: parent, names: names }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_delete_test_cases parent: parent, names: names do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_delete_test_cases ::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest.new(parent: parent, names: names) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_delete_test_cases({ parent: parent, names: names }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_delete_test_cases(::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest.new(parent: parent, names: names), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_delete_test_cases_client_stub.call_count + end + end + end + + def test_get_test_case + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::TestCase.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_test_case_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_get_test_case_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_test_case_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_test_case({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_test_case name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_test_case ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_test_case({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_test_case(::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_test_case_client_stub.call_count + end + end + end + + def test_create_test_case + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::TestCase.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + test_case = {} + + create_test_case_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_create_test_case_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_test_case_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_test_case({ parent: parent, test_case: test_case }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_test_case parent: parent, test_case: test_case do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_test_case ::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest.new(parent: parent, test_case: test_case) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_test_case({ parent: parent, test_case: test_case }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_test_case(::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest.new(parent: parent, test_case: test_case), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_test_case_client_stub.call_count + end + end + end + + def test_update_test_case + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::TestCase.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + test_case = {} + update_mask = {} + + update_test_case_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_update_test_case_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_test_case_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_test_case({ test_case: test_case, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_test_case test_case: test_case, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_test_case ::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest.new(test_case: test_case, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_test_case({ test_case: test_case, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_test_case(::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest.new(test_case: test_case, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_test_case_client_stub.call_count + end + end + end + + def test_run_test_case + # 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" + environment = "hello world" + + run_test_case_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_run_test_case_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, run_test_case_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.run_test_case({ name: name, environment: environment }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.run_test_case name: name, environment: environment do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.run_test_case ::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest.new(name: name, environment: environment) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.run_test_case({ name: name, environment: environment }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.run_test_case(::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest.new(name: name, environment: environment), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, run_test_case_client_stub.call_count + end + end + end + + def test_batch_run_test_cases + # 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" + environment = "hello world" + test_cases = ["hello world"] + + batch_run_test_cases_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_batch_run_test_cases_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_run_test_cases_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_run_test_cases({ parent: parent, environment: environment, test_cases: test_cases }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_run_test_cases parent: parent, environment: environment, test_cases: test_cases do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_run_test_cases ::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest.new(parent: parent, environment: environment, test_cases: test_cases) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_run_test_cases({ parent: parent, environment: environment, test_cases: test_cases }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_run_test_cases(::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest.new(parent: parent, environment: environment, test_cases: test_cases), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_run_test_cases_client_stub.call_count + end + end + end + + def test_calculate_coverage + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + agent = "hello world" + type = :COVERAGE_TYPE_UNSPECIFIED + + calculate_coverage_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_calculate_coverage_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, calculate_coverage_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.calculate_coverage({ agent: agent, type: type }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.calculate_coverage agent: agent, type: type do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.calculate_coverage ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest.new(agent: agent, type: type) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.calculate_coverage({ agent: agent, type: type }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.calculate_coverage(::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest.new(agent: agent, type: type), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, calculate_coverage_client_stub.call_count + end + end + end + + def test_import_test_cases + # 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_uri = "hello world" + + import_test_cases_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_import_test_cases_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_test_cases_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_test_cases({ parent: parent, gcs_uri: gcs_uri }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_test_cases parent: parent, gcs_uri: gcs_uri do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_test_cases ::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest.new(parent: parent, gcs_uri: gcs_uri) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_test_cases({ parent: parent, gcs_uri: gcs_uri }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_test_cases(::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest.new(parent: parent, gcs_uri: gcs_uri), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_test_cases_client_stub.call_count + end + end + end + + def test_export_test_cases + # 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_uri = "hello world" + data_format = :DATA_FORMAT_UNSPECIFIED + filter = "hello world" + + export_test_cases_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_export_test_cases_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, export_test_cases_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.export_test_cases({ parent: parent, gcs_uri: gcs_uri, data_format: data_format, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.export_test_cases parent: parent, gcs_uri: gcs_uri, data_format: data_format, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.export_test_cases ::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest.new(parent: parent, gcs_uri: gcs_uri, data_format: data_format, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.export_test_cases({ parent: parent, gcs_uri: gcs_uri, data_format: data_format, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.export_test_cases(::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest.new(parent: parent, gcs_uri: gcs_uri, data_format: data_format, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, export_test_cases_client_stub.call_count + end + end + end + + def test_list_test_case_results + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsResponse.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_test_case_results_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_list_test_case_results_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_test_case_results_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_test_case_results({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_test_case_results parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_test_case_results ::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_test_case_results({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_test_case_results(::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest.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_test_case_results_client_stub.call_count + end + end + end + + def test_get_test_case_result + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::TestCaseResult.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_test_case_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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_get_test_case_result_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_test_case_result_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_test_case_result({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_test_case_result name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_test_case_result ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_test_case_result({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_test_case_result(::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_test_case_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::CX::V3::TestCases::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::CX::V3::TestCases::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_test.rb new file mode 100644 index 000000000000..2fbe45e67d18 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_test.rb @@ -0,0 +1,880 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/test_case_pb" +require "google/cloud/dialogflow/cx/v3/test_cases" + +class ::Google::Cloud::Dialogflow::CX::V3::TestCases::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_test_cases + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListTestCasesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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" + view = :TEST_CASE_VIEW_UNSPECIFIED + + list_test_cases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_test_cases, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal :TEST_CASE_VIEW_UNSPECIFIED, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_test_cases_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_test_cases({ parent: parent, page_size: page_size, page_token: page_token, view: view }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_test_cases parent: parent, page_size: page_size, page_token: page_token, view: view do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_test_cases ::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_test_cases({ parent: parent, page_size: page_size, page_token: page_token, view: view }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_test_cases(::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view), 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_test_cases_client_stub.call_rpc_count + end + end + + def test_batch_delete_test_cases + # 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" + names = ["hello world"] + + batch_delete_test_cases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_delete_test_cases, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest, request + assert_equal "hello world", request["parent"] + assert_equal ["hello world"], request["names"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_delete_test_cases_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_delete_test_cases({ parent: parent, names: names }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_delete_test_cases parent: parent, names: names do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_delete_test_cases ::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest.new(parent: parent, names: names) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_delete_test_cases({ parent: parent, names: names }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_delete_test_cases(::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest.new(parent: parent, names: names), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_delete_test_cases_client_stub.call_rpc_count + end + end + + def test_get_test_case + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::TestCase.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_test_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_test_case, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_test_case_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_test_case({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_test_case name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_test_case ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_test_case({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_test_case(::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest.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_test_case_client_stub.call_rpc_count + end + end + + def test_create_test_case + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::TestCase.new + grpc_operation = GRPC::ActiveCall::Operation.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" + test_case = {} + + create_test_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_test_case, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::TestCase), request["test_case"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_test_case_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_test_case({ parent: parent, test_case: test_case }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_test_case parent: parent, test_case: test_case do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_test_case ::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest.new(parent: parent, test_case: test_case) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_test_case({ parent: parent, test_case: test_case }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_test_case(::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest.new(parent: parent, test_case: test_case), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_test_case_client_stub.call_rpc_count + end + end + + def test_update_test_case + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::TestCase.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + test_case = {} + update_mask = {} + + update_test_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_test_case, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::TestCase), request["test_case"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_test_case_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_test_case({ test_case: test_case, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_test_case test_case: test_case, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_test_case ::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest.new(test_case: test_case, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_test_case({ test_case: test_case, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_test_case(::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest.new(test_case: test_case, 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_test_case_client_stub.call_rpc_count + end + end + + def test_run_test_case + # 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" + environment = "hello world" + + run_test_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :run_test_case, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["environment"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, run_test_case_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.run_test_case({ name: name, environment: environment }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.run_test_case name: name, environment: environment do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.run_test_case ::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest.new(name: name, environment: environment) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.run_test_case({ name: name, environment: environment }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.run_test_case(::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest.new(name: name, environment: environment), 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, run_test_case_client_stub.call_rpc_count + end + end + + def test_batch_run_test_cases + # 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" + environment = "hello world" + test_cases = ["hello world"] + + batch_run_test_cases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_run_test_cases, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["environment"] + assert_equal ["hello world"], request["test_cases"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_run_test_cases_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_run_test_cases({ parent: parent, environment: environment, test_cases: test_cases }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_run_test_cases parent: parent, environment: environment, test_cases: test_cases do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_run_test_cases ::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest.new(parent: parent, environment: environment, test_cases: test_cases) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_run_test_cases({ parent: parent, environment: environment, test_cases: test_cases }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_run_test_cases(::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest.new(parent: parent, environment: environment, test_cases: test_cases), 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_run_test_cases_client_stub.call_rpc_count + end + end + + def test_calculate_coverage + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" + type = :COVERAGE_TYPE_UNSPECIFIED + + calculate_coverage_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :calculate_coverage, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest, request + assert_equal "hello world", request["agent"] + assert_equal :COVERAGE_TYPE_UNSPECIFIED, request["type"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, calculate_coverage_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.calculate_coverage({ agent: agent, type: type }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.calculate_coverage agent: agent, type: type do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.calculate_coverage ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest.new(agent: agent, type: type) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.calculate_coverage({ agent: agent, type: type }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.calculate_coverage(::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest.new(agent: agent, type: type), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, calculate_coverage_client_stub.call_rpc_count + end + end + + def test_import_test_cases + # 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_uri = "hello world" + + import_test_cases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_test_cases, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["gcs_uri"] + assert_equal :gcs_uri, request.source + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_test_cases_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_test_cases({ parent: parent, gcs_uri: gcs_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 + client.import_test_cases parent: parent, gcs_uri: gcs_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 + client.import_test_cases ::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest.new(parent: parent, gcs_uri: gcs_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 + client.import_test_cases({ parent: parent, gcs_uri: gcs_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 + client.import_test_cases(::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest.new(parent: parent, gcs_uri: gcs_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_test_cases_client_stub.call_rpc_count + end + end + + def test_export_test_cases + # 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_uri = "hello world" + data_format = :DATA_FORMAT_UNSPECIFIED + filter = "hello world" + + export_test_cases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :export_test_cases, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["gcs_uri"] + assert_equal :gcs_uri, request.destination + assert_equal :DATA_FORMAT_UNSPECIFIED, request["data_format"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, export_test_cases_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.export_test_cases({ parent: parent, gcs_uri: gcs_uri, data_format: data_format, filter: filter }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.export_test_cases parent: parent, gcs_uri: gcs_uri, data_format: data_format, filter: filter do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.export_test_cases ::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest.new(parent: parent, gcs_uri: gcs_uri, data_format: data_format, filter: filter) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.export_test_cases({ parent: parent, gcs_uri: gcs_uri, data_format: data_format, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.export_test_cases(::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest.new(parent: parent, gcs_uri: gcs_uri, data_format: data_format, filter: filter), 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_test_cases_client_stub.call_rpc_count + end + end + + def test_list_test_case_results + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_test_case_results_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_test_case_results, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest, 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_test_case_results_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_test_case_results({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_test_case_results parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_test_case_results ::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_test_case_results({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_test_case_results(::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest.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_test_case_results_client_stub.call_rpc_count + end + end + + def test_get_test_case_result + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::TestCaseResult.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_test_case_result_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_test_case_result, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_test_case_result_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_test_case_result({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_test_case_result name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_test_case_result ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_test_case_result({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_test_case_result(::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest.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_test_case_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::CX::V3::TestCases::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::CX::V3::TestCases::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::CX::V3::TestCases::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::TestCases::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::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::TestCases::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_paths_test.rb new file mode 100644 index 000000000000..b0c5c231d3ec --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_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/cx/v3/tools" + +class ::Google::Cloud::Dialogflow::CX::V3::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_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::CX::V3::Tools::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_path project: "value0", location: "value1", agent: "value2" + assert_equal "projects/value0/locations/value1/agents/value2", 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::CX::V3::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::CX::V3::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::CX::V3::Tools::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tool_path project: "value0", location: "value1", agent: "value2", tool: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/tools/value3", path + end + end + + def test_tool_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::CX::V3::Tools::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tool_version_path project: "value0", location: "value1", agent: "value2", tool: "value3", version: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/tools/value3/versions/value4", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_rest_test.rb new file mode 100644 index 000000000000..e96f99e2ca24 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_rest_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/rest" +require "google/cloud/dialogflow/cx/v3/tool_pb" +require "google/cloud/dialogflow/cx/v3/tools/rest" + + +class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Tool.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + tool = {} + + 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::CX::V3::Tools::Rest::ServiceStub.stub :transcode_create_tool_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_tool_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_tool({ parent: parent, tool: tool }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_tool parent: parent, tool: tool do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_tool ::Google::Cloud::Dialogflow::CX::V3::CreateToolRequest.new(parent: parent, tool: tool) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_tool({ parent: parent, tool: tool }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_tool(::Google::Cloud::Dialogflow::CX::V3::CreateToolRequest.new(parent: parent, tool: tool), 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_list_tools + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Tools::Rest::ServiceStub.stub :transcode_list_tools_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_tools_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.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 + client.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 + client.list_tools ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.list_tools(::Google::Cloud::Dialogflow::CX::V3::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_get_tool + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Tools::Rest::ServiceStub.stub :transcode_get_tool_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_tool_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_tool({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_tool name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_tool ::Google::Cloud::Dialogflow::CX::V3::GetToolRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_tool({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_tool(::Google::Cloud::Dialogflow::CX::V3::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_update_tool + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Tools::Rest::ServiceStub.stub :transcode_update_tool_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_tool_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_tool({ tool: tool, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_tool tool: tool, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_tool ::Google::Cloud::Dialogflow::CX::V3::UpdateToolRequest.new(tool: tool, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.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 + client.update_tool(::Google::Cloud::Dialogflow::CX::V3::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_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" + force = true + + 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::CX::V3::Tools::Rest::ServiceStub.stub :transcode_delete_tool_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_tool_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_tool({ name: name, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_tool name: name, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_tool ::Google::Cloud::Dialogflow::CX::V3::DeleteToolRequest.new(name: name, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_tool({ name: name, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_tool(::Google::Cloud::Dialogflow::CX::V3::DeleteToolRequest.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_tool_client_stub.call_count + end + end + end + + def test_list_tool_versions + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsResponse.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_tool_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::CX::V3::Tools::Rest::ServiceStub.stub :transcode_list_tool_versions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_tool_versions_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_tool_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 + client.list_tool_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 + client.list_tool_versions ::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_tool_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 + client.list_tool_versions(::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsRequest.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_tool_versions_client_stub.call_count + end + end + end + + def test_create_tool_version + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::ToolVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + tool_version = {} + + create_tool_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::CX::V3::Tools::Rest::ServiceStub.stub :transcode_create_tool_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_tool_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_tool_version({ parent: parent, tool_version: tool_version }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_tool_version parent: parent, tool_version: tool_version do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_tool_version ::Google::Cloud::Dialogflow::CX::V3::CreateToolVersionRequest.new(parent: parent, tool_version: tool_version) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_tool_version({ parent: parent, tool_version: tool_version }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_tool_version(::Google::Cloud::Dialogflow::CX::V3::CreateToolVersionRequest.new(parent: parent, tool_version: tool_version), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_tool_version_client_stub.call_count + end + end + end + + def test_get_tool_version + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::ToolVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_tool_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::CX::V3::Tools::Rest::ServiceStub.stub :transcode_get_tool_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_tool_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_tool_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_tool_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_tool_version ::Google::Cloud::Dialogflow::CX::V3::GetToolVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_tool_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_tool_version(::Google::Cloud::Dialogflow::CX::V3::GetToolVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_tool_version_client_stub.call_count + end + end + end + + def test_delete_tool_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" + force = true + + delete_tool_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::CX::V3::Tools::Rest::ServiceStub.stub :transcode_delete_tool_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_tool_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_tool_version({ name: name, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_tool_version name: name, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_tool_version ::Google::Cloud::Dialogflow::CX::V3::DeleteToolVersionRequest.new(name: name, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_tool_version({ name: name, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_tool_version(::Google::Cloud::Dialogflow::CX::V3::DeleteToolVersionRequest.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_tool_version_client_stub.call_count + end + end + end + + def test_restore_tool_version + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + restore_tool_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::CX::V3::Tools::Rest::ServiceStub.stub :transcode_restore_tool_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, restore_tool_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.restore_tool_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.restore_tool_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.restore_tool_version ::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.restore_tool_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.restore_tool_version(::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, restore_tool_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::CX::V3::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::CX::V3::Tools::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_test.rb new file mode 100644 index 000000000000..4e550c70186a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_test.rb @@ -0,0 +1,712 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/tool_pb" +require "google/cloud/dialogflow/cx/v3/tools" + +class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 = {} + + 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::CX::V3::CreateToolRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Tool), request["tool"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_tool_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_tool({ parent: parent, tool: tool }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_tool parent: parent, tool: tool do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_tool ::Google::Cloud::Dialogflow::CX::V3::CreateToolRequest.new(parent: parent, tool: tool) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_tool({ parent: parent, tool: tool }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_tool(::Google::Cloud::Dialogflow::CX::V3::CreateToolRequest.new(parent: parent, tool: tool), 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_list_tools + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.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 + client.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 + client.list_tools ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.list_tools(::Google::Cloud::Dialogflow::CX::V3::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_get_tool + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::GetToolRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_tool_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_tool({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_tool name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_tool ::Google::Cloud::Dialogflow::CX::V3::GetToolRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.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 + client.get_tool(::Google::Cloud::Dialogflow::CX::V3::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_update_tool + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::UpdateToolRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.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 + client.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 + client.update_tool ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.update_tool(::Google::Cloud::Dialogflow::CX::V3::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_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" + force = true + + 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::CX::V3::DeleteToolRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_tool_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_tool({ name: name, force: force }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_tool name: name, force: force do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_tool ::Google::Cloud::Dialogflow::CX::V3::DeleteToolRequest.new(name: name, force: force) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_tool({ 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 + client.delete_tool(::Google::Cloud::Dialogflow::CX::V3::DeleteToolRequest.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_tool_client_stub.call_rpc_count + end + end + + def test_list_tool_versions + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_tool_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_tool_versions, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsRequest, 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_tool_versions_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_tool_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 + client.list_tool_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 + client.list_tool_versions ::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_tool_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 + client.list_tool_versions(::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsRequest.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_tool_versions_client_stub.call_rpc_count + end + end + + def test_create_tool_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ToolVersion.new + grpc_operation = GRPC::ActiveCall::Operation.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_version = {} + + create_tool_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_tool_version, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CreateToolVersionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::ToolVersion), request["tool_version"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_tool_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_tool_version({ parent: parent, tool_version: tool_version }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_tool_version parent: parent, tool_version: tool_version do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_tool_version ::Google::Cloud::Dialogflow::CX::V3::CreateToolVersionRequest.new(parent: parent, tool_version: tool_version) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_tool_version({ parent: parent, tool_version: tool_version }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_tool_version(::Google::Cloud::Dialogflow::CX::V3::CreateToolVersionRequest.new(parent: parent, tool_version: tool_version), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_tool_version_client_stub.call_rpc_count + end + end + + def test_get_tool_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ToolVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_tool_version, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetToolVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_tool_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_tool_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_tool_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_tool_version ::Google::Cloud::Dialogflow::CX::V3::GetToolVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_tool_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_tool_version(::Google::Cloud::Dialogflow::CX::V3::GetToolVersionRequest.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_version_client_stub.call_rpc_count + end + end + + def test_delete_tool_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" + force = true + + delete_tool_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_tool_version, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DeleteToolVersionRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_tool_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_tool_version({ name: name, force: force }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_tool_version name: name, force: force do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_tool_version ::Google::Cloud::Dialogflow::CX::V3::DeleteToolVersionRequest.new(name: name, force: force) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_tool_version({ 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 + client.delete_tool_version(::Google::Cloud::Dialogflow::CX::V3::DeleteToolVersionRequest.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_tool_version_client_stub.call_rpc_count + end + end + + def test_restore_tool_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + restore_tool_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :restore_tool_version, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, restore_tool_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.restore_tool_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.restore_tool_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.restore_tool_version ::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.restore_tool_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.restore_tool_version(::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionRequest.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, restore_tool_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::CX::V3::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::CX::V3::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::CX::V3::Tools::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Tools::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_paths_test.rb new file mode 100644 index 000000000000..7017f577cace --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_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/cx/v3/transition_route_groups" + +class ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::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::CX::V3::TransitionRouteGroups::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_path project: "value0", location: "value1", agent: "value2" + assert_equal "projects/value0/locations/value1/agents/value2", path + end + end + + def test_flow_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::CX::V3::TransitionRouteGroups::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.flow_path project: "value0", location: "value1", agent: "value2", flow: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/flows/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::CX::V3::TransitionRouteGroups::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.generator_path project: "value0", location: "value1", agent: "value2", generator: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/generators/value3", 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::CX::V3::TransitionRouteGroups::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.intent_path project: "value0", location: "value1", agent: "value2", intent: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/intents/value3", path + end + end + + def test_page_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::CX::V3::TransitionRouteGroups::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.page_path project: "value0", location: "value1", agent: "value2", flow: "value3", page: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/pages/value4", 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::CX::V3::TransitionRouteGroups::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tool_path project: "value0", location: "value1", agent: "value2", tool: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/tools/value3", path + end + end + + def test_transition_route_group_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::CX::V3::TransitionRouteGroups::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.transition_route_group_path project: "value0", location: "value1", agent: "value2", flow: "value3", transition_route_group: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/transitionRouteGroups/value4", path + + path = client.transition_route_group_path project: "value0", location: "value1", agent: "value2", transition_route_group: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/transitionRouteGroups/value3", path + end + end + + def test_webhook_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::CX::V3::TransitionRouteGroups::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.webhook_path project: "value0", location: "value1", agent: "value2", webhook: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/webhooks/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_rest_test.rb new file mode 100644 index 000000000000..d861c1a91df0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_rest_test.rb @@ -0,0 +1,378 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/dialogflow/cx/v3/transition_route_group_pb" +require "google/cloud/dialogflow/cx/v3/transition_route_groups/rest" + + +class ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::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_transition_route_groups + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsResponse.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" + language_code = "hello world" + + list_transition_route_groups_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::TransitionRouteGroups::Rest::ServiceStub.stub :transcode_list_transition_route_groups_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_transition_route_groups_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_transition_route_groups({ parent: parent, page_size: page_size, page_token: page_token, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_transition_route_groups parent: parent, page_size: page_size, page_token: page_token, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_transition_route_groups ::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest.new(parent: parent, page_size: page_size, page_token: page_token, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_transition_route_groups({ parent: parent, page_size: page_size, page_token: page_token, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_transition_route_groups(::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest.new(parent: parent, page_size: page_size, page_token: page_token, language_code: language_code), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_transition_route_groups_client_stub.call_count + end + end + end + + def test_get_transition_route_group + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.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_transition_route_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::TransitionRouteGroups::Rest::ServiceStub.stub :transcode_get_transition_route_group_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_transition_route_group_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_transition_route_group({ name: name, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_transition_route_group name: name, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_transition_route_group ::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest.new(name: name, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_transition_route_group({ name: name, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_transition_route_group(::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest.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_transition_route_group_client_stub.call_count + end + end + end + + def test_create_transition_route_group + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + transition_route_group = {} + language_code = "hello world" + + create_transition_route_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::TransitionRouteGroups::Rest::ServiceStub.stub :transcode_create_transition_route_group_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_transition_route_group_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_transition_route_group({ parent: parent, transition_route_group: transition_route_group, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_transition_route_group parent: parent, transition_route_group: transition_route_group, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_transition_route_group ::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest.new(parent: parent, transition_route_group: transition_route_group, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_transition_route_group({ parent: parent, transition_route_group: transition_route_group, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_transition_route_group(::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest.new(parent: parent, transition_route_group: transition_route_group, language_code: language_code), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_transition_route_group_client_stub.call_count + end + end + end + + def test_update_transition_route_group + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + transition_route_group = {} + update_mask = {} + language_code = "hello world" + + update_transition_route_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::TransitionRouteGroups::Rest::ServiceStub.stub :transcode_update_transition_route_group_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_transition_route_group_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_transition_route_group({ transition_route_group: transition_route_group, update_mask: update_mask, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_transition_route_group transition_route_group: transition_route_group, update_mask: update_mask, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_transition_route_group ::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest.new(transition_route_group: transition_route_group, update_mask: update_mask, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_transition_route_group({ transition_route_group: transition_route_group, update_mask: update_mask, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_transition_route_group(::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest.new(transition_route_group: transition_route_group, update_mask: update_mask, language_code: language_code), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_transition_route_group_client_stub.call_count + end + end + end + + def test_delete_transition_route_group + # 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_transition_route_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::TransitionRouteGroups::Rest::ServiceStub.stub :transcode_delete_transition_route_group_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_transition_route_group_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_transition_route_group({ name: name, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_transition_route_group name: name, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_transition_route_group ::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest.new(name: name, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_transition_route_group({ name: name, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_transition_route_group(::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest.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_transition_route_group_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::CX::V3::TransitionRouteGroups::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::CX::V3::TransitionRouteGroups::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_test.rb new file mode 100644 index 000000000000..2ee5f6933c18 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_test.rb @@ -0,0 +1,417 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/transition_route_group_pb" +require "google/cloud/dialogflow/cx/v3/transition_route_groups" + +class ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::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_transition_route_groups + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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" + language_code = "hello world" + + list_transition_route_groups_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_transition_route_groups, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest, 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["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_transition_route_groups_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_transition_route_groups({ parent: parent, page_size: page_size, page_token: page_token, language_code: language_code }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_transition_route_groups parent: parent, page_size: page_size, page_token: page_token, language_code: language_code do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_transition_route_groups ::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest.new(parent: parent, page_size: page_size, page_token: page_token, language_code: language_code) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_transition_route_groups({ parent: parent, page_size: page_size, page_token: page_token, language_code: language_code }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_transition_route_groups(::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest.new(parent: parent, page_size: page_size, page_token: page_token, language_code: language_code), 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_transition_route_groups_client_stub.call_rpc_count + end + end + + def test_get_transition_route_group + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_transition_route_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_transition_route_group, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_transition_route_group_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_transition_route_group({ name: name, language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_transition_route_group name: name, language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_transition_route_group ::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest.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 + client.get_transition_route_group({ 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 + client.get_transition_route_group(::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest.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_transition_route_group_client_stub.call_rpc_count + end + end + + def test_create_transition_route_group + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.new + grpc_operation = GRPC::ActiveCall::Operation.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" + transition_route_group = {} + language_code = "hello world" + + create_transition_route_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_transition_route_group, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup), request["transition_route_group"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_transition_route_group_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_transition_route_group({ parent: parent, transition_route_group: transition_route_group, language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_transition_route_group parent: parent, transition_route_group: transition_route_group, language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_transition_route_group ::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest.new(parent: parent, transition_route_group: transition_route_group, language_code: language_code) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_transition_route_group({ parent: parent, transition_route_group: transition_route_group, 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 + client.create_transition_route_group(::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest.new(parent: parent, transition_route_group: transition_route_group, 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_transition_route_group_client_stub.call_rpc_count + end + end + + def test_update_transition_route_group + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + transition_route_group = {} + update_mask = {} + language_code = "hello world" + + update_transition_route_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_transition_route_group, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup), request["transition_route_group"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_transition_route_group_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_transition_route_group({ transition_route_group: transition_route_group, update_mask: update_mask, language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_transition_route_group transition_route_group: transition_route_group, update_mask: update_mask, language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_transition_route_group ::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest.new(transition_route_group: transition_route_group, update_mask: update_mask, language_code: language_code) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_transition_route_group({ transition_route_group: transition_route_group, update_mask: update_mask, 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 + client.update_transition_route_group(::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest.new(transition_route_group: transition_route_group, update_mask: update_mask, 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, update_transition_route_group_client_stub.call_rpc_count + end + end + + def test_delete_transition_route_group + # 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_transition_route_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_transition_route_group, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_transition_route_group_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_transition_route_group({ name: name, force: force }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_transition_route_group name: name, force: force do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_transition_route_group ::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest.new(name: name, force: force) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_transition_route_group({ 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 + client.delete_transition_route_group(::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest.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_transition_route_group_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::CX::V3::TransitionRouteGroups::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::CX::V3::TransitionRouteGroups::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::CX::V3::TransitionRouteGroups::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_operations_test.rb new file mode 100644 index 000000000000..875805bb7255 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_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/cx/v3/version_pb" +require "google/cloud/dialogflow/cx/v3/version_services_pb" +require "google/cloud/dialogflow/cx/v3/versions" + +class ::Google::Cloud::Dialogflow::CX::V3::Versions::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dialogflow::CX::V3::Versions::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::CX::V3::Versions::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_paths_test.rb new file mode 100644 index 000000000000..9846d8d6b929 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_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/cx/v3/versions" + +class ::Google::Cloud::Dialogflow::CX::V3::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_flow_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::CX::V3::Versions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.flow_path project: "value0", location: "value1", agent: "value2", flow: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/flows/value3", 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::CX::V3::Versions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.version_path project: "value0", location: "value1", agent: "value2", flow: "value3", version: "value4" + assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/versions/value4", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_rest_test.rb new file mode 100644 index 000000000000..4dfc0384c75d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_rest_test.rb @@ -0,0 +1,484 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/version_pb" +require "google/cloud/dialogflow/cx/v3/versions/rest" + + +class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::Versions::Rest::ServiceStub.stub :transcode_list_versions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_versions_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.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 + client.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 + client.list_versions ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.list_versions(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::Versions::Rest::ServiceStub.stub :transcode_get_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_version ::Google::Cloud::Dialogflow::CX::V3::GetVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_version(::Google::Cloud::Dialogflow::CX::V3::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::Longrunning::Operation.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::CX::V3::Versions::Rest::ServiceStub.stub :transcode_create_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_version({ parent: parent, version: version }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_version parent: parent, version: version do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_version ::Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest.new(parent: parent, version: version) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_version({ parent: parent, version: version }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_version(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::Versions::Rest::ServiceStub.stub :transcode_update_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_version({ version: version, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_version version: version, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_version ::Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest.new(version: version, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.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 + client.update_version(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Versions::Rest::ServiceStub.stub :transcode_delete_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_version ::Google::Cloud::Dialogflow::CX::V3::DeleteVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_version(::Google::Cloud::Dialogflow::CX::V3::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_load_version + # 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" + allow_override_agent_resources = true + + load_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::CX::V3::Versions::Rest::ServiceStub.stub :transcode_load_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, load_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.load_version({ name: name, allow_override_agent_resources: allow_override_agent_resources }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.load_version name: name, allow_override_agent_resources: allow_override_agent_resources do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.load_version ::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest.new(name: name, allow_override_agent_resources: allow_override_agent_resources) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.load_version({ name: name, allow_override_agent_resources: allow_override_agent_resources }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.load_version(::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest.new(name: name, allow_override_agent_resources: allow_override_agent_resources), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, load_version_client_stub.call_count + end + end + end + + def test_compare_versions + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + base_version = "hello world" + target_version = "hello world" + language_code = "hello world" + + compare_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::CX::V3::Versions::Rest::ServiceStub.stub :transcode_compare_versions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, compare_versions_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.compare_versions({ base_version: base_version, target_version: target_version, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.compare_versions base_version: base_version, target_version: target_version, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.compare_versions ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest.new(base_version: base_version, target_version: target_version, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.compare_versions({ base_version: base_version, target_version: target_version, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.compare_versions(::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest.new(base_version: base_version, target_version: target_version, language_code: language_code), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, compare_versions_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::CX::V3::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::CX::V3::Versions::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_test.rb new file mode 100644 index 000000000000..2bdebe57deaf --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_test.rb @@ -0,0 +1,553 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/cx/v3/version_pb" +require "google/cloud/dialogflow/cx/v3/versions" + +class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.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 + client.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 + client.list_versions ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.list_versions(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::GetVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_version ::Google::Cloud::Dialogflow::CX::V3::GetVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.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 + client.get_version(::Google::Cloud::Dialogflow::CX::V3::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::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" + 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::CX::V3::CreateVersionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Version), request["version"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_version({ parent: parent, version: version }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_version parent: parent, version: version do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_version ::Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest.new(parent: parent, version: version) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_version({ parent: parent, version: version }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_version(::Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest.new(parent: parent, version: version), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_version_client_stub.call_rpc_count + end + end + + def test_update_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::UpdateVersionRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::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 + client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.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 + client.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 + client.update_version ::Google::Cloud::Dialogflow::CX::V3::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 + client.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 + client.update_version(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::DeleteVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_version ::Google::Cloud::Dialogflow::CX::V3::DeleteVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.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 + client.delete_version(::Google::Cloud::Dialogflow::CX::V3::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_load_version + # 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" + allow_override_agent_resources = true + + load_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :load_version, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["allow_override_agent_resources"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, load_version_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.load_version({ name: name, allow_override_agent_resources: allow_override_agent_resources }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.load_version name: name, allow_override_agent_resources: allow_override_agent_resources do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.load_version ::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest.new(name: name, allow_override_agent_resources: allow_override_agent_resources) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.load_version({ name: name, allow_override_agent_resources: allow_override_agent_resources }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.load_version(::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest.new(name: name, allow_override_agent_resources: allow_override_agent_resources), 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, load_version_client_stub.call_rpc_count + end + end + + def test_compare_versions + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + base_version = "hello world" + target_version = "hello world" + language_code = "hello world" + + compare_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :compare_versions, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest, request + assert_equal "hello world", request["base_version"] + assert_equal "hello world", request["target_version"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, compare_versions_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.compare_versions({ base_version: base_version, target_version: target_version, language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.compare_versions base_version: base_version, target_version: target_version, language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.compare_versions ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest.new(base_version: base_version, target_version: target_version, language_code: language_code) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.compare_versions({ base_version: base_version, target_version: target_version, 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 + client.compare_versions(::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest.new(base_version: base_version, target_version: target_version, 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, compare_versions_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::CX::V3::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::CX::V3::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::CX::V3::Versions::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Versions::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::CX::V3::Versions::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Versions::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_paths_test.rb new file mode 100644 index 000000000000..43aa78a52ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_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/cx/v3/webhooks" + +class ::Google::Cloud::Dialogflow::CX::V3::Webhooks::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::CX::V3::Webhooks::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_path project: "value0", location: "value1", agent: "value2" + assert_equal "projects/value0/locations/value1/agents/value2", 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::CX::V3::Webhooks::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::CX::V3::Webhooks::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_webhook_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::CX::V3::Webhooks::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.webhook_path project: "value0", location: "value1", agent: "value2", webhook: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/webhooks/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_rest_test.rb new file mode 100644 index 000000000000..b6b8b118ee20 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_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/cx/v3/webhook_pb" +require "google/cloud/dialogflow/cx/v3/webhooks/rest" + + +class ::Google::Cloud::Dialogflow::CX::V3::Webhooks::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_webhooks + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksResponse.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_webhooks_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Webhooks::Rest::ServiceStub.stub :transcode_list_webhooks_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_webhooks_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_webhooks({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_webhooks parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_webhooks ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_webhooks({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_webhooks(::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest.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_webhooks_client_stub.call_count + end + end + end + + def test_get_webhook + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Webhook.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_webhook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Webhooks::Rest::ServiceStub.stub :transcode_get_webhook_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_webhook_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_webhook({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_webhook name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_webhook ::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_webhook({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_webhook(::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_webhook_client_stub.call_count + end + end + end + + def test_create_webhook + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Webhook.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + webhook = {} + + create_webhook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Webhooks::Rest::ServiceStub.stub :transcode_create_webhook_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_webhook_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_webhook({ parent: parent, webhook: webhook }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_webhook parent: parent, webhook: webhook do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_webhook ::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest.new(parent: parent, webhook: webhook) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_webhook({ parent: parent, webhook: webhook }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_webhook(::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest.new(parent: parent, webhook: webhook), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_webhook_client_stub.call_count + end + end + end + + def test_update_webhook + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::CX::V3::Webhook.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + webhook = {} + update_mask = {} + + update_webhook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Webhooks::Rest::ServiceStub.stub :transcode_update_webhook_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_webhook_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_webhook({ webhook: webhook, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_webhook webhook: webhook, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_webhook ::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest.new(webhook: webhook, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_webhook({ webhook: webhook, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_webhook(::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest.new(webhook: webhook, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_webhook_client_stub.call_count + end + end + end + + def test_delete_webhook + # 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_webhook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-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::CX::V3::Webhooks::Rest::ServiceStub.stub :transcode_delete_webhook_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_webhook_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_webhook({ name: name, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_webhook name: name, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_webhook ::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest.new(name: name, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_webhook({ name: name, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_webhook(::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest.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_webhook_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::CX::V3::Webhooks::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::CX::V3::Webhooks::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_test.rb new file mode 100644 index 000000000000..96f811b1f873 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_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/cx/v3/webhook_pb" +require "google/cloud/dialogflow/cx/v3/webhooks" + +class ::Google::Cloud::Dialogflow::CX::V3::Webhooks::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_webhooks + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_webhooks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_webhooks, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest, 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_webhooks_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_webhooks({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_webhooks parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_webhooks ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_webhooks({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_webhooks(::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest.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_webhooks_client_stub.call_rpc_count + end + end + + def test_get_webhook + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Webhook.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_webhook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_webhook, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_webhook_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_webhook({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_webhook name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_webhook ::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_webhook({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_webhook(::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest.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_webhook_client_stub.call_rpc_count + end + end + + def test_create_webhook + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Webhook.new + grpc_operation = GRPC::ActiveCall::Operation.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" + webhook = {} + + create_webhook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_webhook, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Webhook), request["webhook"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_webhook_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_webhook({ parent: parent, webhook: webhook }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_webhook parent: parent, webhook: webhook do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_webhook ::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest.new(parent: parent, webhook: webhook) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_webhook({ parent: parent, webhook: webhook }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_webhook(::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest.new(parent: parent, webhook: webhook), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_webhook_client_stub.call_rpc_count + end + end + + def test_update_webhook + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Webhook.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + webhook = {} + update_mask = {} + + update_webhook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_webhook, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Webhook), request["webhook"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_webhook_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_webhook({ webhook: webhook, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_webhook webhook: webhook, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_webhook ::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest.new(webhook: webhook, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_webhook({ webhook: webhook, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_webhook(::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest.new(webhook: webhook, 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_webhook_client_stub.call_rpc_count + end + end + + def test_delete_webhook + # 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_webhook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_webhook, name + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_webhook_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_webhook({ name: name, force: force }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_webhook name: name, force: force do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_webhook ::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest.new(name: name, force: force) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_webhook({ 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 + client.delete_webhook(::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest.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_webhook_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::CX::V3::Webhooks::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::CX::V3::Webhooks::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::CX::V3::Webhooks::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/helper.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" From 216d74c3d108764cac51f1536842855ce65ab507 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 15 Jan 2026 22:08:28 +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 --- .../.owlbot-manifest.json | 77 + .../gapic_metadata.json | 162 + .../lib/google/cloud/dialogflow/cx/v3.rb | 3 + .../google/cloud/dialogflow/cx/v3/agent_pb.rb | 2 +- .../cloud/dialogflow/cx/v3/agents/paths.rb | 21 + .../cloud/dialogflow/cx/v3/code_block_pb.rb | 0 .../cx/v3/data_store_connection_pb.rb | 4 +- .../dialogflow/cx/v3/environments/paths.rb | 19 + .../cloud/dialogflow/cx/v3/example_pb.rb | 0 .../dialogflow/cx/v3/example_services_pb.rb | 0 .../google/cloud/dialogflow/cx/v3/examples.rb | 0 .../cloud/dialogflow/cx/v3/examples/client.rb | 0 .../dialogflow/cx/v3/examples/credentials.rb | 0 .../cloud/dialogflow/cx/v3/examples/paths.rb | 0 .../cloud/dialogflow/cx/v3/examples/rest.rb | 0 .../dialogflow/cx/v3/examples/rest/client.rb | 0 .../cx/v3/examples/rest/service_stub.rb | 0 .../google/cloud/dialogflow/cx/v3/flow_pb.rb | 4 +- .../cloud/dialogflow/cx/v3/flows/paths.rb | 42 + .../cx/v3/generative_settings_pb.rb | 3 +- .../cloud/dialogflow/cx/v3/generator_pb.rb | 4 +- .../google/cloud/dialogflow/cx/v3/page_pb.rb | 2 +- .../cloud/dialogflow/cx/v3/pages/paths.rb | 42 + .../cx/v3/parameter_definition_pb.rb | 0 .../cloud/dialogflow/cx/v3/playbook_pb.rb | 0 .../dialogflow/cx/v3/playbook_services_pb.rb | 0 .../cloud/dialogflow/cx/v3/playbooks.rb | 0 .../dialogflow/cx/v3/playbooks/client.rb | 0 .../dialogflow/cx/v3/playbooks/credentials.rb | 0 .../dialogflow/cx/v3/playbooks/operations.rb | 0 .../cloud/dialogflow/cx/v3/playbooks/paths.rb | 0 .../cloud/dialogflow/cx/v3/playbooks/rest.rb | 0 .../dialogflow/cx/v3/playbooks/rest/client.rb | 0 .../cx/v3/playbooks/rest/operations.rb | 0 .../cx/v3/playbooks/rest/service_stub.rb | 0 .../dialogflow/cx/v3/response_message_pb.rb | 4 +- .../lib/google/cloud/dialogflow/cx/v3/rest.rb | 3 + .../dialogflow/cx/v3/safety_settings_pb.rb | 8 +- .../cloud/dialogflow/cx/v3/session_pb.rb | 7 +- .../cloud/dialogflow/cx/v3/sessions/client.rb | 12 +- .../cloud/dialogflow/cx/v3/sessions/paths.rb | 42 + .../dialogflow/cx/v3/sessions/rest/client.rb | 12 +- .../dialogflow/cx/v3/test_cases/paths.rb | 42 + .../cloud/dialogflow/cx/v3/tool_call_pb.rb | 0 .../google/cloud/dialogflow/cx/v3/tool_pb.rb | 0 .../dialogflow/cx/v3/tool_services_pb.rb | 0 .../google/cloud/dialogflow/cx/v3/tools.rb | 0 .../cloud/dialogflow/cx/v3/tools/client.rb | 0 .../dialogflow/cx/v3/tools/credentials.rb | 0 .../cloud/dialogflow/cx/v3/tools/paths.rb | 0 .../cloud/dialogflow/cx/v3/tools/rest.rb | 0 .../dialogflow/cx/v3/tools/rest/client.rb | 0 .../cx/v3/tools/rest/service_stub.rb | 0 .../google/cloud/dialogflow/cx/v3/trace_pb.rb | 0 .../cx/v3/transition_route_groups/paths.rb | 21 + .../cloud/dialogflow/cx/v3/webhook_pb.rb | 4 +- .../cloud/dialogflow/cx/v3/webhooks/paths.rb | 19 + .../google/cloud/dialogflow/cx/v3/agent.rb | 23 +- .../cloud/dialogflow/cx/v3/audio_config.rb | 3 + .../cloud/dialogflow/cx/v3/code_block.rb | 0 .../dialogflow/cx/v3/data_store_connection.rb | 3 + .../cloud/dialogflow/cx/v3/environment.rb | 4 +- .../google/cloud/dialogflow/cx/v3/example.rb | 0 .../google/cloud/dialogflow/cx/v3/flow.rb | 6 + .../dialogflow/cx/v3/generative_settings.rb | 15 + .../cloud/dialogflow/cx/v3/generator.rb | 3 + .../google/cloud/dialogflow/cx/v3/page.rb | 11 +- .../dialogflow/cx/v3/parameter_definition.rb | 0 .../google/cloud/dialogflow/cx/v3/playbook.rb | 0 .../dialogflow/cx/v3/response_message.rb | 26 +- .../cloud/dialogflow/cx/v3/safety_settings.rb | 94 + .../dialogflow/cx/v3/security_settings.rb | 3 + .../google/cloud/dialogflow/cx/v3/session.rb | 80 +- .../google/cloud/dialogflow/cx/v3/tool.rb | 0 .../cloud/dialogflow/cx/v3/tool_call.rb | 0 .../google/cloud/dialogflow/cx/v3/trace.rb | 0 .../google/cloud/dialogflow/cx/v3/webhook.rb | 59 + .../snippets/examples/create_example.rb | 0 .../snippets/examples/delete_example.rb | 0 .../snippets/examples/get_example.rb | 0 .../snippets/examples/list_examples.rb | 0 .../snippets/examples/update_example.rb | 0 .../snippets/playbooks/create_playbook.rb | 0 .../playbooks/create_playbook_version.rb | 0 .../snippets/playbooks/delete_playbook.rb | 0 .../playbooks/delete_playbook_version.rb | 0 .../snippets/playbooks/export_playbook.rb | 0 .../snippets/playbooks/get_playbook.rb | 0 .../playbooks/get_playbook_version.rb | 0 .../snippets/playbooks/import_playbook.rb | 0 .../playbooks/list_playbook_versions.rb | 0 .../snippets/playbooks/list_playbooks.rb | 0 .../playbooks/restore_playbook_version.rb | 0 .../snippets/playbooks/update_playbook.rb | 0 ...etadata_google.cloud.dialogflow.cx.v3.json | 1222 +++- .../snippets/tools/create_tool.rb | 0 .../snippets/tools/create_tool_version.rb | 0 .../snippets/tools/delete_tool.rb | 0 .../snippets/tools/delete_tool_version.rb | 0 .../snippets/tools/get_tool.rb | 0 .../snippets/tools/get_tool_version.rb | 0 .../snippets/tools/list_tool_versions.rb | 0 .../snippets/tools/list_tools.rb | 0 .../snippets/tools/restore_tool_version.rb | 0 .../snippets/tools/update_tool.rb | 0 .../dialogflow/cx/v3/agents_paths_test.rb | 12 + .../cx/v3/environments_paths_test.rb | 12 + .../dialogflow/cx/v3/examples_paths_test.rb | 0 .../dialogflow/cx/v3/examples_rest_test.rb | 0 .../cloud/dialogflow/cx/v3/examples_test.rb | 0 .../dialogflow/cx/v3/flows_paths_test.rb | 24 + .../dialogflow/cx/v3/pages_paths_test.rb | 24 + .../cx/v3/playbooks_operations_test.rb | 0 .../dialogflow/cx/v3/playbooks_paths_test.rb | 0 .../dialogflow/cx/v3/playbooks_rest_test.rb | 0 .../cloud/dialogflow/cx/v3/playbooks_test.rb | 0 .../dialogflow/cx/v3/sessions_paths_test.rb | 24 + .../dialogflow/cx/v3/sessions_rest_test.rb | 22 +- .../cloud/dialogflow/cx/v3/sessions_test.rb | 42 +- .../dialogflow/cx/v3/test_cases_paths_test.rb | 24 + .../dialogflow/cx/v3/tools_paths_test.rb | 0 .../cloud/dialogflow/cx/v3/tools_rest_test.rb | 0 .../cloud/dialogflow/cx/v3/tools_test.rb | 0 .../v3/transition_route_groups_paths_test.rb | 12 + .../dialogflow/cx/v3/webhooks_paths_test.rb | 12 + .../google-cloud-dialogflow-cx-v3/.gitignore | 22 - .../.repo-metadata.json | 19 - .../.rubocop.yml | 33 - .../google-cloud-dialogflow-cx-v3/.toys.rb | 28 - .../google-cloud-dialogflow-cx-v3/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-dialogflow-cx-v3/Gemfile | 11 - .../google-cloud-dialogflow-cx-v3/LICENSE.md | 201 - .../google-cloud-dialogflow-cx-v3/README.md | 154 - .../google-cloud-dialogflow-cx-v3/Rakefile | 169 - .../gapic_metadata.json | 874 --- .../google-cloud-dialogflow-cx-v3.gemspec | 29 - .../lib/google-cloud-dialogflow-cx-v3.rb | 21 - .../lib/google/cloud/dialogflow/cx/v3.rb | 66 - .../dialogflow/cx/v3/advanced_settings_pb.rb | 53 - .../google/cloud/dialogflow/cx/v3/agent_pb.rb | 88 - .../dialogflow/cx/v3/agent_services_pb.rb | 103 - .../google/cloud/dialogflow/cx/v3/agents.rb | 58 - .../cloud/dialogflow/cx/v3/agents/client.rb | 1569 ----- .../dialogflow/cx/v3/agents/credentials.rb | 54 - .../dialogflow/cx/v3/agents/operations.rb | 843 --- .../cloud/dialogflow/cx/v3/agents/paths.rb | 210 - .../cloud/dialogflow/cx/v3/agents/rest.rb | 56 - .../dialogflow/cx/v3/agents/rest/client.rb | 1457 ----- .../cx/v3/agents/rest/operations.rb | 947 --- .../cx/v3/agents/rest/service_stub.rb | 760 --- .../cloud/dialogflow/cx/v3/audio_config_pb.rb | 59 - .../dialogflow/cx/v3/bindings_override.rb | 77 - .../cloud/dialogflow/cx/v3/changelog_pb.rb | 54 - .../dialogflow/cx/v3/changelog_services_pb.rb | 49 - .../cloud/dialogflow/cx/v3/changelogs.rb | 57 - .../dialogflow/cx/v3/changelogs/client.rb | 624 -- .../cx/v3/changelogs/credentials.rb | 54 - .../dialogflow/cx/v3/changelogs/paths.rb | 75 - .../cloud/dialogflow/cx/v3/changelogs/rest.rb | 55 - .../cx/v3/changelogs/rest/client.rb | 575 -- .../cx/v3/changelogs/rest/service_stub.rb | 205 - .../cx/v3/data_store_connection_pb.rb | 62 - .../cloud/dialogflow/cx/v3/deployment_pb.rb | 56 - .../cx/v3/deployment_services_pb.rb | 51 - .../cloud/dialogflow/cx/v3/deployments.rb | 57 - .../dialogflow/cx/v3/deployments/client.rb | 606 -- .../cx/v3/deployments/credentials.rb | 54 - .../dialogflow/cx/v3/deployments/paths.rb | 79 - .../dialogflow/cx/v3/deployments/rest.rb | 55 - .../cx/v3/deployments/rest/client.rb | 557 -- .../cx/v3/deployments/rest/service_stub.rb | 205 - .../cloud/dialogflow/cx/v3/entity_type_pb.rb | 74 - .../cx/v3/entity_type_services_pb.rb | 71 - .../cloud/dialogflow/cx/v3/entity_types.rb | 58 - .../dialogflow/cx/v3/entity_types/client.rb | 1243 ---- .../cx/v3/entity_types/credentials.rb | 54 - .../cx/v3/entity_types/operations.rb | 843 --- .../dialogflow/cx/v3/entity_types/paths.rb | 75 - .../dialogflow/cx/v3/entity_types/rest.rb | 56 - .../cx/v3/entity_types/rest/client.rb | 1159 ---- .../cx/v3/entity_types/rest/operations.rb | 947 --- .../cx/v3/entity_types/rest/service_stub.rb | 514 -- .../cloud/dialogflow/cx/v3/environment_pb.rb | 81 - .../cx/v3/environment_services_pb.rb | 106 - .../cloud/dialogflow/cx/v3/environments.rb | 59 - .../dialogflow/cx/v3/environments/client.rb | 1382 ----- .../cx/v3/environments/credentials.rb | 54 - .../cx/v3/environments/operations.rb | 843 --- .../dialogflow/cx/v3/environments/paths.rb | 180 - .../dialogflow/cx/v3/environments/rest.rb | 57 - .../cx/v3/environments/rest/client.rb | 1284 ---- .../cx/v3/environments/rest/operations.rb | 947 --- .../cx/v3/environments/rest/service_stub.rb | 636 -- .../cloud/dialogflow/cx/v3/experiment_pb.rb | 78 - .../cx/v3/experiment_services_pb.rb | 67 - .../cloud/dialogflow/cx/v3/experiments.rb | 57 - .../dialogflow/cx/v3/experiments/client.rb | 1084 ---- .../cx/v3/experiments/credentials.rb | 54 - .../dialogflow/cx/v3/experiments/paths.rb | 102 - .../dialogflow/cx/v3/experiments/rest.rb | 55 - .../cx/v3/experiments/rest/client.rb | 1000 --- .../cx/v3/experiments/rest/service_stub.rb | 514 -- .../google/cloud/dialogflow/cx/v3/flow_pb.rb | 85 - .../dialogflow/cx/v3/flow_services_pb.rb | 115 - .../google/cloud/dialogflow/cx/v3/flows.rb | 58 - .../cloud/dialogflow/cx/v3/flows/client.rb | 1550 ----- .../dialogflow/cx/v3/flows/credentials.rb | 54 - .../dialogflow/cx/v3/flows/operations.rb | 843 --- .../cloud/dialogflow/cx/v3/flows/paths.rb | 273 - .../cloud/dialogflow/cx/v3/flows/rest.rb | 56 - .../dialogflow/cx/v3/flows/rest/client.rb | 1445 ----- .../dialogflow/cx/v3/flows/rest/operations.rb | 947 --- .../cx/v3/flows/rest/service_stub.rb | 699 --- .../cloud/dialogflow/cx/v3/fulfillment_pb.rb | 58 - .../google/cloud/dialogflow/cx/v3/gcs_pb.rb | 46 - .../cx/v3/generative_settings_pb.rb | 52 - .../cloud/dialogflow/cx/v3/generator_pb.rb | 63 - .../dialogflow/cx/v3/generator_services_pb.rb | 55 - .../cloud/dialogflow/cx/v3/generators.rb | 57 - .../dialogflow/cx/v3/generators/client.rb | 906 --- .../cx/v3/generators/credentials.rb | 54 - .../dialogflow/cx/v3/generators/paths.rb | 75 - .../cloud/dialogflow/cx/v3/generators/rest.rb | 55 - .../cx/v3/generators/rest/client.rb | 836 --- .../cx/v3/generators/rest/service_stub.rb | 390 -- .../dialogflow/cx/v3/import_strategy_pb.rb | 44 - .../cloud/dialogflow/cx/v3/inline_pb.rb | 47 - .../cloud/dialogflow/cx/v3/intent_pb.rb | 74 - .../dialogflow/cx/v3/intent_services_pb.rb | 89 - .../google/cloud/dialogflow/cx/v3/intents.rb | 58 - .../cloud/dialogflow/cx/v3/intents/client.rb | 1221 ---- .../dialogflow/cx/v3/intents/credentials.rb | 54 - .../dialogflow/cx/v3/intents/operations.rb | 843 --- .../cloud/dialogflow/cx/v3/intents/paths.rb | 96 - .../cloud/dialogflow/cx/v3/intents/rest.rb | 56 - .../dialogflow/cx/v3/intents/rest/client.rb | 1137 ---- .../cx/v3/intents/rest/operations.rb | 947 --- .../cx/v3/intents/rest/service_stub.rb | 514 -- .../google/cloud/dialogflow/cx/v3/page_pb.rb | 72 - .../dialogflow/cx/v3/page_services_pb.rb | 67 - .../google/cloud/dialogflow/cx/v3/pages.rb | 57 - .../cloud/dialogflow/cx/v3/pages/client.rb | 998 --- .../dialogflow/cx/v3/pages/credentials.rb | 54 - .../cloud/dialogflow/cx/v3/pages/paths.rb | 254 - .../cloud/dialogflow/cx/v3/pages/rest.rb | 55 - .../dialogflow/cx/v3/pages/rest/client.rb | 928 --- .../cx/v3/pages/rest/service_stub.rb | 390 -- .../dialogflow/cx/v3/response_message_pb.rb | 61 - .../lib/google/cloud/dialogflow/cx/v3/rest.rb | 59 - .../dialogflow/cx/v3/safety_settings_pb.rb | 53 - .../dialogflow/cx/v3/security_settings_pb.rb | 65 - .../cx/v3/security_settings_service.rb | 57 - .../cx/v3/security_settings_service/client.rb | 894 --- .../security_settings_service/credentials.rb | 54 - .../cx/v3/security_settings_service/paths.rb | 157 - .../cx/v3/security_settings_service/rest.rb | 55 - .../security_settings_service/rest/client.rb | 824 --- .../rest/service_stub.rb | 390 -- .../cx/v3/security_settings_services_pb.rb | 59 - .../cx/v3/session_entity_type_pb.rb | 61 - .../cx/v3/session_entity_type_services_pb.rb | 56 - .../dialogflow/cx/v3/session_entity_types.rb | 58 - .../cx/v3/session_entity_types/client.rb | 911 --- .../cx/v3/session_entity_types/credentials.rb | 54 - .../cx/v3/session_entity_types/paths.rb | 137 - .../cx/v3/session_entity_types/rest.rb | 56 - .../cx/v3/session_entity_types/rest/client.rb | 841 --- .../session_entity_types/rest/service_stub.rb | 427 -- .../cloud/dialogflow/cx/v3/session_pb.rb | 115 - .../dialogflow/cx/v3/session_services_pb.rb | 85 - .../google/cloud/dialogflow/cx/v3/sessions.rb | 60 - .../cloud/dialogflow/cx/v3/sessions/client.rb | 1073 ---- .../dialogflow/cx/v3/sessions/credentials.rb | 54 - .../cloud/dialogflow/cx/v3/sessions/paths.rb | 312 - .../cloud/dialogflow/cx/v3/sessions/rest.rb | 58 - .../dialogflow/cx/v3/sessions/rest/client.rb | 912 --- .../cx/v3/sessions/rest/service_stub.rb | 419 -- .../cloud/dialogflow/cx/v3/test_case_pb.rb | 115 - .../dialogflow/cx/v3/test_case_services_pb.rb | 110 - .../cloud/dialogflow/cx/v3/test_cases.rb | 59 - .../dialogflow/cx/v3/test_cases/client.rb | 1729 ------ .../cx/v3/test_cases/credentials.rb | 54 - .../dialogflow/cx/v3/test_cases/operations.rb | 843 --- .../dialogflow/cx/v3/test_cases/paths.rb | 338 - .../cloud/dialogflow/cx/v3/test_cases/rest.rb | 57 - .../cx/v3/test_cases/rest/client.rb | 1610 ----- .../cx/v3/test_cases/rest/operations.rb | 947 --- .../cx/v3/test_cases/rest/service_stub.rb | 822 --- .../cx/v3/transition_route_group_pb.rb | 60 - .../v3/transition_route_group_services_pb.rb | 73 - .../cx/v3/transition_route_groups.rb | 58 - .../cx/v3/transition_route_groups/client.rb | 974 --- .../v3/transition_route_groups/credentials.rb | 54 - .../cx/v3/transition_route_groups/paths.rb | 231 - .../cx/v3/transition_route_groups/rest.rb | 56 - .../v3/transition_route_groups/rest/client.rb | 904 --- .../rest/service_stub.rb | 427 -- .../dialogflow/cx/v3/validation_message_pb.rb | 47 - .../google/cloud/dialogflow/cx/v3/version.rb | 30 - .../cloud/dialogflow/cx/v3/version_pb.rb | 69 - .../dialogflow/cx/v3/version_services_pb.rb | 78 - .../google/cloud/dialogflow/cx/v3/versions.rb | 58 - .../cloud/dialogflow/cx/v3/versions/client.rb | 1148 ---- .../dialogflow/cx/v3/versions/credentials.rb | 54 - .../dialogflow/cx/v3/versions/operations.rb | 843 --- .../cloud/dialogflow/cx/v3/versions/paths.rb | 79 - .../cloud/dialogflow/cx/v3/versions/rest.rb | 56 - .../dialogflow/cx/v3/versions/rest/client.rb | 1064 ---- .../cx/v3/versions/rest/operations.rb | 947 --- .../cx/v3/versions/rest/service_stub.rb | 514 -- .../cloud/dialogflow/cx/v3/webhook_pb.rb | 86 - .../dialogflow/cx/v3/webhook_services_pb.rb | 55 - .../google/cloud/dialogflow/cx/v3/webhooks.rb | 57 - .../cloud/dialogflow/cx/v3/webhooks/client.rb | 898 --- .../dialogflow/cx/v3/webhooks/credentials.rb | 54 - .../cloud/dialogflow/cx/v3/webhooks/paths.rb | 115 - .../cloud/dialogflow/cx/v3/webhooks/rest.rb | 55 - .../dialogflow/cx/v3/webhooks/rest/client.rb | 828 --- .../cx/v3/webhooks/rest/service_stub.rb | 390 -- .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../dialogflow/cx/v3/advanced_settings.rb | 150 - .../google/cloud/dialogflow/cx/v3/agent.rb | 576 -- .../cloud/dialogflow/cx/v3/audio_config.rb | 401 -- .../cloud/dialogflow/cx/v3/changelog.rb | 128 - .../dialogflow/cx/v3/data_store_connection.rb | 282 - .../cloud/dialogflow/cx/v3/deployment.rb | 138 - .../cloud/dialogflow/cx/v3/entity_type.rb | 519 -- .../cloud/dialogflow/cx/v3/environment.rb | 380 -- .../cloud/dialogflow/cx/v3/experiment.rb | 450 -- .../google/cloud/dialogflow/cx/v3/flow.rb | 536 -- .../cloud/dialogflow/cx/v3/fulfillment.rb | 188 - .../google/cloud/dialogflow/cx/v3/gcs.rb | 40 - .../dialogflow/cx/v3/generative_settings.rb | 128 - .../cloud/dialogflow/cx/v3/generator.rb | 223 - .../cloud/dialogflow/cx/v3/import_strategy.rb | 54 - .../google/cloud/dialogflow/cx/v3/inline.rb | 49 - .../google/cloud/dialogflow/cx/v3/intent.rb | 517 -- .../google/cloud/dialogflow/cx/v3/page.rb | 578 -- .../dialogflow/cx/v3/response_message.rb | 319 - .../cloud/dialogflow/cx/v3/safety_settings.rb | 143 - .../dialogflow/cx/v3/security_settings.rb | 327 - .../google/cloud/dialogflow/cx/v3/session.rb | 1348 ---- .../dialogflow/cx/v3/session_entity_type.rb | 193 - .../cloud/dialogflow/cx/v3/test_case.rb | 835 --- .../cx/v3/transition_route_group.rb | 212 - .../dialogflow/cx/v3/validation_message.rb | 125 - .../google/cloud/dialogflow/cx/v3/version.rb | 235 - .../google/cloud/dialogflow/cx/v3/webhook.rb | 782 --- .../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/create_agent.rb | 47 - .../snippets/agents/delete_agent.rb | 47 - .../snippets/agents/export_agent.rb | 54 - .../snippets/agents/get_agent.rb | 47 - .../agents/get_agent_validation_result.rb | 47 - .../agents/get_generative_settings.rb | 47 - .../snippets/agents/list_agents.rb | 51 - .../snippets/agents/restore_agent.rb | 54 - .../snippets/agents/update_agent.rb | 47 - .../agents/update_generative_settings.rb | 47 - .../snippets/agents/validate_agent.rb | 47 - .../snippets/changelogs/get_changelog.rb | 47 - .../snippets/changelogs/list_changelogs.rb | 51 - .../snippets/deployments/get_deployment.rb | 47 - .../snippets/deployments/list_deployments.rb | 51 - .../entity_types/create_entity_type.rb | 47 - .../entity_types/delete_entity_type.rb | 47 - .../entity_types/export_entity_types.rb | 54 - .../snippets/entity_types/get_entity_type.rb | 47 - .../entity_types/import_entity_types.rb | 54 - .../entity_types/list_entity_types.rb | 51 - .../entity_types/update_entity_type.rb | 47 - .../environments/create_environment.rb | 54 - .../environments/delete_environment.rb | 47 - .../snippets/environments/deploy_flow.rb | 54 - .../snippets/environments/get_environment.rb | 47 - .../list_continuous_test_results.rb | 51 - .../environments/list_environments.rb | 51 - .../lookup_environment_history.rb | 51 - .../environments/run_continuous_test.rb | 54 - .../environments/update_environment.rb | 54 - .../snippets/experiments/create_experiment.rb | 47 - .../snippets/experiments/delete_experiment.rb | 47 - .../snippets/experiments/get_experiment.rb | 47 - .../snippets/experiments/list_experiments.rb | 51 - .../snippets/experiments/start_experiment.rb | 47 - .../snippets/experiments/stop_experiment.rb | 47 - .../snippets/experiments/update_experiment.rb | 47 - .../snippets/flows/create_flow.rb | 47 - .../snippets/flows/delete_flow.rb | 47 - .../snippets/flows/export_flow.rb | 54 - .../snippets/flows/get_flow.rb | 47 - .../flows/get_flow_validation_result.rb | 47 - .../snippets/flows/import_flow.rb | 54 - .../snippets/flows/list_flows.rb | 51 - .../snippets/flows/train_flow.rb | 54 - .../snippets/flows/update_flow.rb | 47 - .../snippets/flows/validate_flow.rb | 47 - .../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/create_intent.rb | 47 - .../snippets/intents/delete_intent.rb | 47 - .../snippets/intents/export_intents.rb | 54 - .../snippets/intents/get_intent.rb | 47 - .../snippets/intents/import_intents.rb | 54 - .../snippets/intents/list_intents.rb | 51 - .../snippets/intents/update_intent.rb | 47 - .../snippets/pages/create_page.rb | 47 - .../snippets/pages/delete_page.rb | 47 - .../snippets/pages/get_page.rb | 47 - .../snippets/pages/list_pages.rb | 51 - .../snippets/pages/update_page.rb | 47 - .../create_security_settings.rb | 47 - .../delete_security_settings.rb | 47 - .../get_security_settings.rb | 47 - .../list_security_settings.rb | 51 - .../update_security_settings.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 - .../snippets/sessions/fulfill_intent.rb | 47 - .../snippets/sessions/match_intent.rb | 47 - .../server_streaming_detect_intent.rb | 50 - .../sessions/streaming_detect_intent.rb | 56 - .../sessions/submit_answer_feedback.rb | 47 - ...etadata_google.cloud.dialogflow.cx.v3.json | 5495 ----------------- .../test_cases/batch_delete_test_cases.rb | 47 - .../test_cases/batch_run_test_cases.rb | 54 - .../snippets/test_cases/calculate_coverage.rb | 47 - .../snippets/test_cases/create_test_case.rb | 47 - .../snippets/test_cases/export_test_cases.rb | 54 - .../snippets/test_cases/get_test_case.rb | 47 - .../test_cases/get_test_case_result.rb | 47 - .../snippets/test_cases/import_test_cases.rb | 54 - .../test_cases/list_test_case_results.rb | 51 - .../snippets/test_cases/list_test_cases.rb | 51 - .../snippets/test_cases/run_test_case.rb | 54 - .../snippets/test_cases/update_test_case.rb | 47 - .../create_transition_route_group.rb | 47 - .../delete_transition_route_group.rb | 47 - .../get_transition_route_group.rb | 47 - .../list_transition_route_groups.rb | 51 - .../update_transition_route_group.rb | 47 - .../snippets/versions/compare_versions.rb | 47 - .../snippets/versions/create_version.rb | 54 - .../snippets/versions/delete_version.rb | 47 - .../snippets/versions/get_version.rb | 47 - .../snippets/versions/list_versions.rb | 51 - .../snippets/versions/load_version.rb | 54 - .../snippets/versions/update_version.rb | 47 - .../snippets/webhooks/create_webhook.rb | 47 - .../snippets/webhooks/delete_webhook.rb | 47 - .../snippets/webhooks/get_webhook.rb | 47 - .../snippets/webhooks/list_webhooks.rb | 51 - .../snippets/webhooks/update_webhook.rb | 47 - .../cx/v3/agents_operations_test.rb | 400 -- .../dialogflow/cx/v3/agents_paths_test.rb | 151 - .../dialogflow/cx/v3/agents_rest_test.rb | 708 --- .../cloud/dialogflow/cx/v3/agents_test.rb | 802 --- .../dialogflow/cx/v3/changelogs_paths_test.rb | 67 - .../dialogflow/cx/v3/changelogs_rest_test.rb | 210 - .../cloud/dialogflow/cx/v3/changelogs_test.rb | 231 - .../cx/v3/deployments_paths_test.rb | 67 - .../dialogflow/cx/v3/deployments_rest_test.rb | 209 - .../dialogflow/cx/v3/deployments_test.rb | 229 - .../cx/v3/entity_types_operations_test.rb | 400 -- .../cx/v3/entity_types_paths_test.rb | 67 - .../cx/v3/entity_types_rest_test.rb | 493 -- .../dialogflow/cx/v3/entity_types_test.rb | 573 -- .../cx/v3/environments_operations_test.rb | 400 -- .../cx/v3/environments_paths_test.rb | 127 - .../cx/v3/environments_rest_test.rb | 594 -- .../dialogflow/cx/v3/environments_test.rb | 693 --- .../cx/v3/experiments_paths_test.rb | 79 - .../dialogflow/cx/v3/experiments_rest_test.rb | 481 -- .../dialogflow/cx/v3/experiments_test.rb | 523 -- .../dialogflow/cx/v3/flows_operations_test.rb | 400 -- .../dialogflow/cx/v3/flows_paths_test.rb | 166 - .../cloud/dialogflow/cx/v3/flows_rest_test.rb | 655 -- .../cloud/dialogflow/cx/v3/flows_test.rb | 751 --- .../dialogflow/cx/v3/generators_paths_test.rb | 67 - .../dialogflow/cx/v3/generators_rest_test.rb | 378 -- .../cloud/dialogflow/cx/v3/generators_test.rb | 417 -- .../cx/v3/intents_operations_test.rb | 400 -- .../dialogflow/cx/v3/intents_paths_test.rb | 79 - .../dialogflow/cx/v3/intents_rest_test.rb | 491 -- .../cloud/dialogflow/cx/v3/intents_test.rb | 569 -- .../dialogflow/cx/v3/pages_paths_test.rb | 154 - .../cloud/dialogflow/cx/v3/pages_rest_test.rb | 378 -- .../cloud/dialogflow/cx/v3/pages_test.rb | 417 -- .../security_settings_service_paths_test.rb | 97 - .../v3/security_settings_service_rest_test.rb | 373 -- .../cx/v3/security_settings_service_test.rb | 407 -- .../cx/v3/session_entity_types_paths_test.rb | 73 - .../cx/v3/session_entity_types_rest_test.rb | 373 -- .../cx/v3/session_entity_types_test.rb | 407 -- .../dialogflow/cx/v3/sessions_paths_test.rb | 160 - .../dialogflow/cx/v3/sessions_rest_test.rb | 385 -- .../cloud/dialogflow/cx/v3/sessions_test.rb | 541 -- .../cx/v3/test_cases_operations_test.rb | 400 -- .../dialogflow/cx/v3/test_cases_paths_test.rb | 202 - .../dialogflow/cx/v3/test_cases_rest_test.rb | 764 --- .../cloud/dialogflow/cx/v3/test_cases_test.rb | 880 --- .../v3/transition_route_groups_paths_test.rb | 142 - .../v3/transition_route_groups_rest_test.rb | 378 -- .../cx/v3/transition_route_groups_test.rb | 417 -- .../cx/v3/versions_operations_test.rb | 400 -- .../dialogflow/cx/v3/versions_paths_test.rb | 67 - .../dialogflow/cx/v3/versions_rest_test.rb | 484 -- .../cloud/dialogflow/cx/v3/versions_test.rb | 553 -- .../dialogflow/cx/v3/webhooks_paths_test.rb | 91 - .../dialogflow/cx/v3/webhooks_rest_test.rb | 374 -- .../cloud/dialogflow/cx/v3/webhooks_test.rb | 409 -- .../test/helper.rb | 25 - 534 files changed, 2172 insertions(+), 111678 deletions(-) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/code_block_pb.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/example_pb.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/example_services_pb.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/examples.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/examples/client.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/examples/credentials.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/examples/paths.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/examples/rest.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/examples/rest/client.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/examples/rest/service_stub.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/parameter_definition_pb.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/playbook_pb.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/playbook_services_pb.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/playbooks.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/playbooks/client.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/playbooks/credentials.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/playbooks/operations.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/playbooks/paths.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/playbooks/rest.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/client.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/operations.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/service_stub.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/tool_call_pb.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/tool_pb.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/tool_services_pb.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/tools.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/tools/client.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/tools/credentials.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/tools/paths.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/tools/rest.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/tools/rest/client.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/tools/rest/service_stub.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/lib/google/cloud/dialogflow/cx/v3/trace_pb.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/proto_docs/google/cloud/dialogflow/cx/v3/code_block.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/proto_docs/google/cloud/dialogflow/cx/v3/example.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/proto_docs/google/cloud/dialogflow/cx/v3/parameter_definition.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/proto_docs/google/cloud/dialogflow/cx/v3/playbook.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/proto_docs/google/cloud/dialogflow/cx/v3/tool.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/proto_docs/google/cloud/dialogflow/cx/v3/tool_call.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/proto_docs/google/cloud/dialogflow/cx/v3/trace.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/examples/create_example.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/examples/delete_example.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/examples/get_example.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/examples/list_examples.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/examples/update_example.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/playbooks/create_playbook.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/playbooks/create_playbook_version.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/playbooks/delete_playbook.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/playbooks/delete_playbook_version.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/playbooks/export_playbook.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/playbooks/get_playbook.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/playbooks/get_playbook_version.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/playbooks/import_playbook.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/playbooks/list_playbook_versions.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/playbooks/list_playbooks.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/playbooks/restore_playbook_version.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/playbooks/update_playbook.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/tools/create_tool.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/tools/create_tool_version.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/tools/delete_tool.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/tools/delete_tool_version.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/tools/get_tool.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/tools/get_tool_version.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/tools/list_tool_versions.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/tools/list_tools.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/tools/restore_tool_version.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/snippets/tools/update_tool.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/test/google/cloud/dialogflow/cx/v3/examples_paths_test.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/test/google/cloud/dialogflow/cx/v3/examples_rest_test.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/test/google/cloud/dialogflow/cx/v3/examples_test.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/test/google/cloud/dialogflow/cx/v3/playbooks_operations_test.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/test/google/cloud/dialogflow/cx/v3/playbooks_paths_test.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/test/google/cloud/dialogflow/cx/v3/playbooks_rest_test.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/test/google/cloud/dialogflow/cx/v3/playbooks_test.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/test/google/cloud/dialogflow/cx/v3/tools_paths_test.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/test/google/cloud/dialogflow/cx/v3/tools_rest_test.rb (100%) rename {owl-bot-staging/google-cloud-dialogflow-cx-v3 => google-cloud-dialogflow-cx-v3}/test/google/cloud/dialogflow/cx/v3/tools_test.rb (100%) delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/.gitignore delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/.yardopts delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/Gemfile delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/README.md delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/Rakefile delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/google-cloud-dialogflow-cx-v3.gemspec delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google-cloud-dialogflow-cx-v3.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/advanced_settings_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agent_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/audio_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelog_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelog_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/data_store_connection_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployment_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployment_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_type_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_type_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environment_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environment_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiment_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiment_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flow_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/fulfillment_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/gcs_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generative_settings_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generator_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generator_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/import_strategy_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/inline_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intent_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intent_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/page_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/page_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/response_message_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/safety_settings_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_type_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_type_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_case_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_case_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_group_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_group_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/validation_message_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhook_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/advanced_settings.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/changelog.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/data_store_connection.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/deployment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/entity_type.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/environment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/experiment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/fulfillment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/gcs.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generative_settings.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generator.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/import_strategy.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/inline.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/intent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/page.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/safety_settings.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/session.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/session_entity_type.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/test_case.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/transition_route_group.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/validation_message.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/version.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/struct.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/type/latlng.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/create_agent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/delete_agent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/export_agent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent_validation_result.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_generative_settings.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/list_agents.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/restore_agent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/update_agent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/update_generative_settings.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/validate_agent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/changelogs/get_changelog.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/changelogs/list_changelogs.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/deployments/get_deployment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/deployments/list_deployments.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/create_entity_type.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/delete_entity_type.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/export_entity_types.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/get_entity_type.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/import_entity_types.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/list_entity_types.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/update_entity_type.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/create_environment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/delete_environment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/deploy_flow.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/get_environment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/list_continuous_test_results.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/list_environments.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/lookup_environment_history.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/run_continuous_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/update_environment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/create_experiment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/delete_experiment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/get_experiment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/list_experiments.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/start_experiment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/stop_experiment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/update_experiment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/create_flow.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/delete_flow.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/export_flow.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow_validation_result.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/import_flow.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/list_flows.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/train_flow.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/update_flow.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/validate_flow.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/create_generator.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/delete_generator.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/get_generator.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/list_generators.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/update_generator.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/create_intent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/delete_intent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/export_intents.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/get_intent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/import_intents.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/list_intents.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/update_intent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/create_page.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/delete_page.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/get_page.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/list_pages.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/update_page.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/create_security_settings.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/delete_security_settings.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/get_security_settings.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/list_security_settings.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/update_security_settings.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/create_session_entity_type.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/delete_session_entity_type.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/get_session_entity_type.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/list_session_entity_types.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/update_session_entity_type.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/detect_intent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/fulfill_intent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/match_intent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/server_streaming_detect_intent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/streaming_detect_intent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/submit_answer_feedback.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/snippet_metadata_google.cloud.dialogflow.cx.v3.json delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_delete_test_cases.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_run_test_cases.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/calculate_coverage.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/create_test_case.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/export_test_cases.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case_result.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/import_test_cases.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_case_results.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_cases.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/run_test_case.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/update_test_case.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/create_transition_route_group.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/delete_transition_route_group.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/get_transition_route_group.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/list_transition_route_groups.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/update_transition_route_group.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/compare_versions.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/create_version.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/delete_version.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/get_version.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/list_versions.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/load_version.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/update_version.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/create_webhook.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/delete_webhook.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/get_webhook.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/list_webhooks.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/update_webhook.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-cx-v3/test/helper.rb diff --git a/google-cloud-dialogflow-cx-v3/.owlbot-manifest.json b/google-cloud-dialogflow-cx-v3/.owlbot-manifest.json index e1fe777ad394..4daa82492d7e 100644 --- a/google-cloud-dialogflow-cx-v3/.owlbot-manifest.json +++ b/google-cloud-dialogflow-cx-v3/.owlbot-manifest.json @@ -38,6 +38,7 @@ "lib/google/cloud/dialogflow/cx/v3/changelogs/rest.rb", "lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb", "lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb", + "lib/google/cloud/dialogflow/cx/v3/code_block_pb.rb", "lib/google/cloud/dialogflow/cx/v3/data_store_connection_pb.rb", "lib/google/cloud/dialogflow/cx/v3/deployment_pb.rb", "lib/google/cloud/dialogflow/cx/v3/deployment_services_pb.rb", @@ -70,6 +71,15 @@ "lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb", "lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb", "lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb", + "lib/google/cloud/dialogflow/cx/v3/example_pb.rb", + "lib/google/cloud/dialogflow/cx/v3/example_services_pb.rb", + "lib/google/cloud/dialogflow/cx/v3/examples.rb", + "lib/google/cloud/dialogflow/cx/v3/examples/client.rb", + "lib/google/cloud/dialogflow/cx/v3/examples/credentials.rb", + "lib/google/cloud/dialogflow/cx/v3/examples/paths.rb", + "lib/google/cloud/dialogflow/cx/v3/examples/rest.rb", + "lib/google/cloud/dialogflow/cx/v3/examples/rest/client.rb", + "lib/google/cloud/dialogflow/cx/v3/examples/rest/service_stub.rb", "lib/google/cloud/dialogflow/cx/v3/experiment_pb.rb", "lib/google/cloud/dialogflow/cx/v3/experiment_services_pb.rb", "lib/google/cloud/dialogflow/cx/v3/experiments.rb", @@ -124,6 +134,18 @@ "lib/google/cloud/dialogflow/cx/v3/pages/rest.rb", "lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb", "lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb", + "lib/google/cloud/dialogflow/cx/v3/parameter_definition_pb.rb", + "lib/google/cloud/dialogflow/cx/v3/playbook_pb.rb", + "lib/google/cloud/dialogflow/cx/v3/playbook_services_pb.rb", + "lib/google/cloud/dialogflow/cx/v3/playbooks.rb", + "lib/google/cloud/dialogflow/cx/v3/playbooks/client.rb", + "lib/google/cloud/dialogflow/cx/v3/playbooks/credentials.rb", + "lib/google/cloud/dialogflow/cx/v3/playbooks/operations.rb", + "lib/google/cloud/dialogflow/cx/v3/playbooks/paths.rb", + "lib/google/cloud/dialogflow/cx/v3/playbooks/rest.rb", + "lib/google/cloud/dialogflow/cx/v3/playbooks/rest/client.rb", + "lib/google/cloud/dialogflow/cx/v3/playbooks/rest/operations.rb", + "lib/google/cloud/dialogflow/cx/v3/playbooks/rest/service_stub.rb", "lib/google/cloud/dialogflow/cx/v3/response_message_pb.rb", "lib/google/cloud/dialogflow/cx/v3/rest.rb", "lib/google/cloud/dialogflow/cx/v3/safety_settings_pb.rb", @@ -165,6 +187,17 @@ "lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb", "lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb", "lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb", + "lib/google/cloud/dialogflow/cx/v3/tool_call_pb.rb", + "lib/google/cloud/dialogflow/cx/v3/tool_pb.rb", + "lib/google/cloud/dialogflow/cx/v3/tool_services_pb.rb", + "lib/google/cloud/dialogflow/cx/v3/tools.rb", + "lib/google/cloud/dialogflow/cx/v3/tools/client.rb", + "lib/google/cloud/dialogflow/cx/v3/tools/credentials.rb", + "lib/google/cloud/dialogflow/cx/v3/tools/paths.rb", + "lib/google/cloud/dialogflow/cx/v3/tools/rest.rb", + "lib/google/cloud/dialogflow/cx/v3/tools/rest/client.rb", + "lib/google/cloud/dialogflow/cx/v3/tools/rest/service_stub.rb", + "lib/google/cloud/dialogflow/cx/v3/trace_pb.rb", "lib/google/cloud/dialogflow/cx/v3/transition_route_group_pb.rb", "lib/google/cloud/dialogflow/cx/v3/transition_route_group_services_pb.rb", "lib/google/cloud/dialogflow/cx/v3/transition_route_groups.rb", @@ -205,10 +238,12 @@ "proto_docs/google/cloud/dialogflow/cx/v3/agent.rb", "proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb", "proto_docs/google/cloud/dialogflow/cx/v3/changelog.rb", + "proto_docs/google/cloud/dialogflow/cx/v3/code_block.rb", "proto_docs/google/cloud/dialogflow/cx/v3/data_store_connection.rb", "proto_docs/google/cloud/dialogflow/cx/v3/deployment.rb", "proto_docs/google/cloud/dialogflow/cx/v3/entity_type.rb", "proto_docs/google/cloud/dialogflow/cx/v3/environment.rb", + "proto_docs/google/cloud/dialogflow/cx/v3/example.rb", "proto_docs/google/cloud/dialogflow/cx/v3/experiment.rb", "proto_docs/google/cloud/dialogflow/cx/v3/flow.rb", "proto_docs/google/cloud/dialogflow/cx/v3/fulfillment.rb", @@ -219,12 +254,17 @@ "proto_docs/google/cloud/dialogflow/cx/v3/inline.rb", "proto_docs/google/cloud/dialogflow/cx/v3/intent.rb", "proto_docs/google/cloud/dialogflow/cx/v3/page.rb", + "proto_docs/google/cloud/dialogflow/cx/v3/parameter_definition.rb", + "proto_docs/google/cloud/dialogflow/cx/v3/playbook.rb", "proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb", "proto_docs/google/cloud/dialogflow/cx/v3/safety_settings.rb", "proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb", "proto_docs/google/cloud/dialogflow/cx/v3/session.rb", "proto_docs/google/cloud/dialogflow/cx/v3/session_entity_type.rb", "proto_docs/google/cloud/dialogflow/cx/v3/test_case.rb", + "proto_docs/google/cloud/dialogflow/cx/v3/tool.rb", + "proto_docs/google/cloud/dialogflow/cx/v3/tool_call.rb", + "proto_docs/google/cloud/dialogflow/cx/v3/trace.rb", "proto_docs/google/cloud/dialogflow/cx/v3/transition_route_group.rb", "proto_docs/google/cloud/dialogflow/cx/v3/validation_message.rb", "proto_docs/google/cloud/dialogflow/cx/v3/version.rb", @@ -270,6 +310,11 @@ "snippets/environments/lookup_environment_history.rb", "snippets/environments/run_continuous_test.rb", "snippets/environments/update_environment.rb", + "snippets/examples/create_example.rb", + "snippets/examples/delete_example.rb", + "snippets/examples/get_example.rb", + "snippets/examples/list_examples.rb", + "snippets/examples/update_example.rb", "snippets/experiments/create_experiment.rb", "snippets/experiments/delete_experiment.rb", "snippets/experiments/get_experiment.rb", @@ -304,6 +349,18 @@ "snippets/pages/get_page.rb", "snippets/pages/list_pages.rb", "snippets/pages/update_page.rb", + "snippets/playbooks/create_playbook.rb", + "snippets/playbooks/create_playbook_version.rb", + "snippets/playbooks/delete_playbook.rb", + "snippets/playbooks/delete_playbook_version.rb", + "snippets/playbooks/export_playbook.rb", + "snippets/playbooks/get_playbook.rb", + "snippets/playbooks/get_playbook_version.rb", + "snippets/playbooks/import_playbook.rb", + "snippets/playbooks/list_playbook_versions.rb", + "snippets/playbooks/list_playbooks.rb", + "snippets/playbooks/restore_playbook_version.rb", + "snippets/playbooks/update_playbook.rb", "snippets/security_settings_service/create_security_settings.rb", "snippets/security_settings_service/delete_security_settings.rb", "snippets/security_settings_service/get_security_settings.rb", @@ -333,6 +390,16 @@ "snippets/test_cases/list_test_cases.rb", "snippets/test_cases/run_test_case.rb", "snippets/test_cases/update_test_case.rb", + "snippets/tools/create_tool.rb", + "snippets/tools/create_tool_version.rb", + "snippets/tools/delete_tool.rb", + "snippets/tools/delete_tool_version.rb", + "snippets/tools/get_tool.rb", + "snippets/tools/get_tool_version.rb", + "snippets/tools/list_tool_versions.rb", + "snippets/tools/list_tools.rb", + "snippets/tools/restore_tool_version.rb", + "snippets/tools/update_tool.rb", "snippets/transition_route_groups/create_transition_route_group.rb", "snippets/transition_route_groups/delete_transition_route_group.rb", "snippets/transition_route_groups/get_transition_route_group.rb", @@ -368,6 +435,9 @@ "test/google/cloud/dialogflow/cx/v3/environments_paths_test.rb", "test/google/cloud/dialogflow/cx/v3/environments_rest_test.rb", "test/google/cloud/dialogflow/cx/v3/environments_test.rb", + "test/google/cloud/dialogflow/cx/v3/examples_paths_test.rb", + "test/google/cloud/dialogflow/cx/v3/examples_rest_test.rb", + "test/google/cloud/dialogflow/cx/v3/examples_test.rb", "test/google/cloud/dialogflow/cx/v3/experiments_paths_test.rb", "test/google/cloud/dialogflow/cx/v3/experiments_rest_test.rb", "test/google/cloud/dialogflow/cx/v3/experiments_test.rb", @@ -385,6 +455,10 @@ "test/google/cloud/dialogflow/cx/v3/pages_paths_test.rb", "test/google/cloud/dialogflow/cx/v3/pages_rest_test.rb", "test/google/cloud/dialogflow/cx/v3/pages_test.rb", + "test/google/cloud/dialogflow/cx/v3/playbooks_operations_test.rb", + "test/google/cloud/dialogflow/cx/v3/playbooks_paths_test.rb", + "test/google/cloud/dialogflow/cx/v3/playbooks_rest_test.rb", + "test/google/cloud/dialogflow/cx/v3/playbooks_test.rb", "test/google/cloud/dialogflow/cx/v3/security_settings_service_paths_test.rb", "test/google/cloud/dialogflow/cx/v3/security_settings_service_rest_test.rb", "test/google/cloud/dialogflow/cx/v3/security_settings_service_test.rb", @@ -398,6 +472,9 @@ "test/google/cloud/dialogflow/cx/v3/test_cases_paths_test.rb", "test/google/cloud/dialogflow/cx/v3/test_cases_rest_test.rb", "test/google/cloud/dialogflow/cx/v3/test_cases_test.rb", + "test/google/cloud/dialogflow/cx/v3/tools_paths_test.rb", + "test/google/cloud/dialogflow/cx/v3/tools_rest_test.rb", + "test/google/cloud/dialogflow/cx/v3/tools_test.rb", "test/google/cloud/dialogflow/cx/v3/transition_route_groups_paths_test.rb", "test/google/cloud/dialogflow/cx/v3/transition_route_groups_rest_test.rb", "test/google/cloud/dialogflow/cx/v3/transition_route_groups_test.rb", diff --git a/google-cloud-dialogflow-cx-v3/gapic_metadata.json b/google-cloud-dialogflow-cx-v3/gapic_metadata.json index a05349ab3463..37c2bf5fa424 100644 --- a/google-cloud-dialogflow-cx-v3/gapic_metadata.json +++ b/google-cloud-dialogflow-cx-v3/gapic_metadata.json @@ -552,6 +552,40 @@ } } }, + "Examples": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client", + "rpcs": { + "CreateExample": { + "methods": [ + "create_example" + ] + }, + "DeleteExample": { + "methods": [ + "delete_example" + ] + }, + "ListExamples": { + "methods": [ + "list_examples" + ] + }, + "GetExample": { + "methods": [ + "get_example" + ] + }, + "UpdateExample": { + "methods": [ + "update_example" + ] + } + } + } + } + }, "Experiments": { "clients": { "grpc": { @@ -630,6 +664,75 @@ } } }, + "Playbooks": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client", + "rpcs": { + "CreatePlaybook": { + "methods": [ + "create_playbook" + ] + }, + "DeletePlaybook": { + "methods": [ + "delete_playbook" + ] + }, + "ListPlaybooks": { + "methods": [ + "list_playbooks" + ] + }, + "GetPlaybook": { + "methods": [ + "get_playbook" + ] + }, + "ExportPlaybook": { + "methods": [ + "export_playbook" + ] + }, + "ImportPlaybook": { + "methods": [ + "import_playbook" + ] + }, + "UpdatePlaybook": { + "methods": [ + "update_playbook" + ] + }, + "CreatePlaybookVersion": { + "methods": [ + "create_playbook_version" + ] + }, + "GetPlaybookVersion": { + "methods": [ + "get_playbook_version" + ] + }, + "RestorePlaybookVersion": { + "methods": [ + "restore_playbook_version" + ] + }, + "ListPlaybookVersions": { + "methods": [ + "list_playbook_versions" + ] + }, + "DeletePlaybookVersion": { + "methods": [ + "delete_playbook_version" + ] + } + } + } + } + }, "SecuritySettingsService": { "clients": { "grpc": { @@ -664,6 +767,65 @@ } } }, + "Tools": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client", + "rpcs": { + "CreateTool": { + "methods": [ + "create_tool" + ] + }, + "ListTools": { + "methods": [ + "list_tools" + ] + }, + "GetTool": { + "methods": [ + "get_tool" + ] + }, + "UpdateTool": { + "methods": [ + "update_tool" + ] + }, + "DeleteTool": { + "methods": [ + "delete_tool" + ] + }, + "ListToolVersions": { + "methods": [ + "list_tool_versions" + ] + }, + "CreateToolVersion": { + "methods": [ + "create_tool_version" + ] + }, + "GetToolVersion": { + "methods": [ + "get_tool_version" + ] + }, + "DeleteToolVersion": { + "methods": [ + "delete_tool_version" + ] + }, + "RestoreToolVersion": { + "methods": [ + "restore_tool_version" + ] + } + } + } + } + }, "Versions": { "clients": { "grpc": { diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3.rb index 29cb718186b4..00ee4d30d6f6 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3.rb @@ -29,9 +29,12 @@ require "google/cloud/dialogflow/cx/v3/test_cases" require "google/cloud/dialogflow/cx/v3/webhooks" require "google/cloud/dialogflow/cx/v3/environments" +require "google/cloud/dialogflow/cx/v3/examples" require "google/cloud/dialogflow/cx/v3/experiments" require "google/cloud/dialogflow/cx/v3/generators" +require "google/cloud/dialogflow/cx/v3/playbooks" require "google/cloud/dialogflow/cx/v3/security_settings_service" +require "google/cloud/dialogflow/cx/v3/tools" require "google/cloud/dialogflow/cx/v3/versions" require "google/cloud/dialogflow/cx/v3/version" diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb index 870680bed9e3..30c31944b4eb 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb @@ -18,7 +18,7 @@ require 'google/protobuf/struct_pb' -descriptor_data = "\n)google/cloud/dialogflow/cx/v3/agent.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/advanced_settings.proto\x1a\x30google/cloud/dialogflow/cx/v3/audio_config.proto\x1a(google/cloud/dialogflow/cx/v3/flow.proto\x1a\x37google/cloud/dialogflow/cx/v3/generative_settings.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"8\n\x14SpeechToTextSettings\x12 \n\x18\x65nable_speech_adaptation\x18\x01 \x01(\x08\"\xc5\x10\n\x05\x41gent\x12\x0c\n\x04name\x18\x01 \x01(\t\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\x06\xe0\x41\x02\xe0\x41\x05\x12 \n\x18supported_language_codes\x18\x04 \x03(\t\x12\x16\n\ttime_zone\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x12\n\navatar_uri\x18\x07 \x01(\t\x12T\n\x17speech_to_text_settings\x18\r \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.SpeechToTextSettings\x12:\n\nstart_flow\x18\x10 \x01(\tB&\xe0\x41\x05\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12J\n\x11security_settings\x18\x11 \x01(\tB/\xfa\x41,\n*dialogflow.googleapis.com/SecuritySettings\x12&\n\x1a\x65nable_stackdriver_logging\x18\x12 \x01(\x08\x42\x02\x18\x01\x12\x1f\n\x17\x65nable_spell_correction\x18\x14 \x01(\x08\x12+\n\x1e\x65nable_multi_language_training\x18( \x01(\x08\x42\x03\xe0\x41\x01\x12\x0e\n\x06locked\x18\x1b \x01(\x08\x12J\n\x11\x61\x64vanced_settings\x18\x16 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x12]\n\x18git_integration_settings\x18\x1e \x01(\x0b\x32;.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings\x12T\n\x17text_to_speech_settings\x18\x1f \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.TextToSpeechSettings\x12\x61\n\x18gen_app_builder_settings\x18! \x01(\x0b\x32:.google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettingsH\x00\x88\x01\x01\x12\x62\n\x18\x61nswer_feedback_settings\x18& \x01(\x0b\x32;.google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettingsB\x03\xe0\x41\x01\x12\x63\n\x18personalization_settings\x18* \x01(\x0b\x32<.google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettingsB\x03\xe0\x41\x01\x12h\n\x1b\x63lient_certificate_settings\x18+ \x01(\x0b\x32>.google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettingsB\x03\xe0\x41\x01\x12\"\n\rsatisfies_pzs\x18- \x01(\x08\x42\x06\xe0\x41\x01\xe0\x41\x03H\x01\x88\x01\x01\x12\"\n\rsatisfies_pzi\x18. \x01(\x08\x42\x06\xe0\x41\x01\xe0\x41\x03H\x02\x88\x01\x01\x1a\x90\x02\n\x16GitIntegrationSettings\x12\x65\n\x0fgithub_settings\x18\x01 \x01(\x0b\x32J.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettingsH\x00\x1a\x7f\n\x0eGithubSettings\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x16\n\x0erepository_uri\x18\x02 \x01(\t\x12\x17\n\x0ftracking_branch\x18\x03 \x01(\t\x12\x14\n\x0c\x61\x63\x63\x65ss_token\x18\x04 \x01(\t\x12\x10\n\x08\x62ranches\x18\x05 \x03(\tB\x0e\n\x0cgit_settings\x1a,\n\x15GenAppBuilderSettings\x12\x13\n\x06\x65ngine\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a=\n\x16\x41nswerFeedbackSettings\x12#\n\x16\x65nable_answer_feedback\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x1aZ\n\x17PersonalizationSettings\x12?\n\x19\x64\x65\x66\x61ult_end_user_metadata\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x1a\xca\x01\n\x19\x43lientCertificateSettings\x12\x1c\n\x0fssl_certificate\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12G\n\x0bprivate_key\x18\x02 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x46\n\npassphrase\x18\x03 \x01(\tB2\xe0\x41\x01\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion:\\\xea\x41Y\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x36projects/{project}/locations/{location}/agents/{agent}B\x1b\n\x19_gen_app_builder_settingsB\x10\n\x0e_satisfies_pzsB\x10\n\x0e_satisfies_pzi\"s\n\x11ListAgentsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"c\n\x12ListAgentsResponse\x12\x34\n\x06\x61gents\x18\x01 \x03(\x0b\x32$.google.cloud.dialogflow.cx.v3.Agent\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"H\n\x0fGetAgentRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\"\x87\x01\n\x12\x43reateAgentRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\x12\x38\n\x05\x61gent\x18\x02 \x01(\x0b\x32$.google.cloud.dialogflow.cx.v3.AgentB\x03\xe0\x41\x02\"\x7f\n\x12UpdateAgentRequest\x12\x38\n\x05\x61gent\x18\x01 \x01(\x0b\x32$.google.cloud.dialogflow.cx.v3.AgentB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"K\n\x12\x44\x65leteAgentRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\"\x98\x04\n\x12\x45xportAgentRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x16\n\tagent_uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12V\n\x0b\x64\x61ta_format\x18\x03 \x01(\x0e\x32<.google.cloud.dialogflow.cx.v3.ExportAgentRequest.DataFormatB\x03\xe0\x41\x01\x12\x42\n\x0b\x65nvironment\x18\x05 \x01(\tB-\xe0\x41\x01\xfa\x41\'\n%dialogflow.googleapis.com/Environment\x12^\n\x0fgit_destination\x18\x06 \x01(\x0b\x32@.google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestinationB\x03\xe0\x41\x01\x12-\n include_bigquery_export_settings\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x41\n\x0eGitDestination\x12\x17\n\x0ftracking_branch\x18\x01 \x01(\t\x12\x16\n\x0e\x63ommit_message\x18\x02 \x01(\t\"E\n\nDataFormat\x12\x1b\n\x17\x44\x41TA_FORMAT_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42LOB\x10\x01\x12\x10\n\x0cJSON_PACKAGE\x10\x04\"b\n\x13\x45xportAgentResponse\x12\x13\n\tagent_uri\x18\x01 \x01(\tH\x00\x12\x17\n\ragent_content\x18\x02 \x01(\x0cH\x00\x12\x14\n\ncommit_sha\x18\x03 \x01(\tH\x00\x42\x07\n\x05\x61gent\"\xa0\x03\n\x13RestoreAgentRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\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\x12R\n\ngit_source\x18\x06 \x01(\x0b\x32<.google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSourceH\x00\x12X\n\x0erestore_option\x18\x05 \x01(\x0e\x32@.google.cloud.dialogflow.cx.v3.RestoreAgentRequest.RestoreOption\x1a$\n\tGitSource\x12\x17\n\x0ftracking_branch\x18\x01 \x01(\t\"G\n\rRestoreOption\x12\x1e\n\x1aRESTORE_OPTION_UNSPECIFIED\x10\x00\x12\x08\n\x04KEEP\x10\x01\x12\x0c\n\x08\x46\x41LLBACK\x10\x02\x42\x07\n\x05\x61gent\"d\n\x14ValidateAgentRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\x7f\n\x1fGetAgentValidationResultRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/dialogflow.googleapis.com/AgentValidationResult\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\xfa\x01\n\x15\x41gentValidationResult\x12\x0c\n\x04name\x18\x01 \x01(\t\x12T\n\x17\x66low_validation_results\x18\x02 \x03(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.FlowValidationResult:}\xea\x41z\n/dialogflow.googleapis.com/AgentValidationResult\x12Gprojects/{project}/locations/{location}/agents/{agent}/validationResult\"\x83\x01\n\x1cGetGenerativeSettingsRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1dialogflow.googleapis.com/AgentGenerativeSettings\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\xac\x01\n\x1fUpdateGenerativeSettingsRequest\x12S\n\x13generative_settings\x18\x01 \x01(\x0b\x32\x31.google.cloud.dialogflow.cx.v3.GenerativeSettingsB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x32\xa2\x12\n\x06\x41gents\x12\xae\x01\n\nListAgents\x12\x30.google.cloud.dialogflow.cx.v3.ListAgentsRequest\x1a\x31.google.cloud.dialogflow.cx.v3.ListAgentsResponse\";\xda\x41\x06parent\x82\xd3\xe4\x93\x02,\x12*/v3/{parent=projects/*/locations/*}/agents\x12\x9b\x01\n\x08GetAgent\x12..google.cloud.dialogflow.cx.v3.GetAgentRequest\x1a$.google.cloud.dialogflow.cx.v3.Agent\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,\x12*/v3/{name=projects/*/locations/*/agents/*}\x12\xb0\x01\n\x0b\x43reateAgent\x12\x31.google.cloud.dialogflow.cx.v3.CreateAgentRequest\x1a$.google.cloud.dialogflow.cx.v3.Agent\"H\xda\x41\x0cparent,agent\x82\xd3\xe4\x93\x02\x33\"*/v3/{parent=projects/*/locations/*}/agents:\x05\x61gent\x12\xbb\x01\n\x0bUpdateAgent\x12\x31.google.cloud.dialogflow.cx.v3.UpdateAgentRequest\x1a$.google.cloud.dialogflow.cx.v3.Agent\"S\xda\x41\x11\x61gent,update_mask\x82\xd3\xe4\x93\x02\x39\x32\x30/v3/{agent.name=projects/*/locations/*/agents/*}:\x05\x61gent\x12\x93\x01\n\x0b\x44\x65leteAgent\x12\x31.google.cloud.dialogflow.cx.v3.DeleteAgentRequest\x1a\x16.google.protobuf.Empty\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,**/v3/{name=projects/*/locations/*/agents/*}\x12\xcd\x01\n\x0b\x45xportAgent\x12\x31.google.cloud.dialogflow.cx.v3.ExportAgentRequest\x1a\x1d.google.longrunning.Operation\"l\xca\x41-\n\x13\x45xportAgentResponse\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02\x36\"1/v3/{name=projects/*/locations/*/agents/*}:export:\x01*\x12\xd2\x01\n\x0cRestoreAgent\x12\x32.google.cloud.dialogflow.cx.v3.RestoreAgentRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02\x37\"2/v3/{name=projects/*/locations/*/agents/*}:restore:\x01*\x12\xba\x01\n\rValidateAgent\x12\x33.google.cloud.dialogflow.cx.v3.ValidateAgentRequest\x1a\x34.google.cloud.dialogflow.cx.v3.AgentValidationResult\">\x82\xd3\xe4\x93\x02\x38\"3/v3/{name=projects/*/locations/*/agents/*}:validate:\x01*\x12\xdc\x01\n\x18GetAgentValidationResult\x12>.google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest\x1a\x34.google.cloud.dialogflow.cx.v3.AgentValidationResult\"J\xda\x41\x04name\x82\xd3\xe4\x93\x02=\x12;/v3/{name=projects/*/locations/*/agents/*/validationResult}\x12\xe3\x01\n\x15GetGenerativeSettings\x12;.google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest\x1a\x31.google.cloud.dialogflow.cx.v3.GenerativeSettings\"Z\xda\x41\x12name,language_code\x82\xd3\xe4\x93\x02?\x12=/v3/{name=projects/*/locations/*/agents/*/generativeSettings}\x12\xa0\x02\n\x18UpdateGenerativeSettings\x12>.google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest\x1a\x31.google.cloud.dialogflow.cx.v3.GenerativeSettings\"\x90\x01\xda\x41\x1fgenerative_settings,update_mask\x82\xd3\xe4\x93\x02h2Q/v3/{generative_settings.name=projects/*/locations/*/agents/*/generativeSettings}:\x13generative_settings\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x94\x02\n!com.google.cloud.dialogflow.cx.v3B\nAgentProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3\xea\x41\x64\n*secretmanager.googleapis.com/SecretVersion\x12\x36projects/{project}/secrets/{secret}/versions/{version}b\x06proto3" +descriptor_data = "\n)google/cloud/dialogflow/cx/v3/agent.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/advanced_settings.proto\x1a\x30google/cloud/dialogflow/cx/v3/audio_config.proto\x1a(google/cloud/dialogflow/cx/v3/flow.proto\x1a\x37google/cloud/dialogflow/cx/v3/generative_settings.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"8\n\x14SpeechToTextSettings\x12 \n\x18\x65nable_speech_adaptation\x18\x01 \x01(\x08\"\xa1\x11\n\x05\x41gent\x12\x0c\n\x04name\x18\x01 \x01(\t\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\x06\xe0\x41\x02\xe0\x41\x05\x12 \n\x18supported_language_codes\x18\x04 \x03(\t\x12\x16\n\ttime_zone\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x12\n\navatar_uri\x18\x07 \x01(\t\x12T\n\x17speech_to_text_settings\x18\r \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.SpeechToTextSettings\x12\x39\n\nstart_flow\x18\x10 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/FlowH\x00\x12\x41\n\x0estart_playbook\x18\' \x01(\tB\'\xfa\x41$\n\"dialogflow.googleapis.com/PlaybookH\x00\x12J\n\x11security_settings\x18\x11 \x01(\tB/\xfa\x41,\n*dialogflow.googleapis.com/SecuritySettings\x12&\n\x1a\x65nable_stackdriver_logging\x18\x12 \x01(\x08\x42\x02\x18\x01\x12\x1f\n\x17\x65nable_spell_correction\x18\x14 \x01(\x08\x12+\n\x1e\x65nable_multi_language_training\x18( \x01(\x08\x42\x03\xe0\x41\x01\x12\x0e\n\x06locked\x18\x1b \x01(\x08\x12J\n\x11\x61\x64vanced_settings\x18\x16 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x12]\n\x18git_integration_settings\x18\x1e \x01(\x0b\x32;.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings\x12T\n\x17text_to_speech_settings\x18\x1f \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.TextToSpeechSettings\x12\x61\n\x18gen_app_builder_settings\x18! \x01(\x0b\x32:.google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettingsH\x01\x88\x01\x01\x12\x62\n\x18\x61nswer_feedback_settings\x18& \x01(\x0b\x32;.google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettingsB\x03\xe0\x41\x01\x12\x63\n\x18personalization_settings\x18* \x01(\x0b\x32<.google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettingsB\x03\xe0\x41\x01\x12h\n\x1b\x63lient_certificate_settings\x18+ \x01(\x0b\x32>.google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettingsB\x03\xe0\x41\x01\x12\"\n\rsatisfies_pzs\x18- \x01(\x08\x42\x06\xe0\x41\x01\xe0\x41\x03H\x02\x88\x01\x01\x12\"\n\rsatisfies_pzi\x18. \x01(\x08\x42\x06\xe0\x41\x01\xe0\x41\x03H\x03\x88\x01\x01\x1a\x90\x02\n\x16GitIntegrationSettings\x12\x65\n\x0fgithub_settings\x18\x01 \x01(\x0b\x32J.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettingsH\x00\x1a\x7f\n\x0eGithubSettings\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x16\n\x0erepository_uri\x18\x02 \x01(\t\x12\x17\n\x0ftracking_branch\x18\x03 \x01(\t\x12\x14\n\x0c\x61\x63\x63\x65ss_token\x18\x04 \x01(\t\x12\x10\n\x08\x62ranches\x18\x05 \x03(\tB\x0e\n\x0cgit_settings\x1a,\n\x15GenAppBuilderSettings\x12\x13\n\x06\x65ngine\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a=\n\x16\x41nswerFeedbackSettings\x12#\n\x16\x65nable_answer_feedback\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x1aZ\n\x17PersonalizationSettings\x12?\n\x19\x64\x65\x66\x61ult_end_user_metadata\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x1a\xca\x01\n\x19\x43lientCertificateSettings\x12\x1c\n\x0fssl_certificate\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12G\n\x0bprivate_key\x18\x02 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x46\n\npassphrase\x18\x03 \x01(\tB2\xe0\x41\x01\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion:\\\xea\x41Y\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x36projects/{project}/locations/{location}/agents/{agent}B\x18\n\x16session_entry_resourceB\x1b\n\x19_gen_app_builder_settingsB\x10\n\x0e_satisfies_pzsB\x10\n\x0e_satisfies_pzi\"s\n\x11ListAgentsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"c\n\x12ListAgentsResponse\x12\x34\n\x06\x61gents\x18\x01 \x03(\x0b\x32$.google.cloud.dialogflow.cx.v3.Agent\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"H\n\x0fGetAgentRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\"\x87\x01\n\x12\x43reateAgentRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\x12\x38\n\x05\x61gent\x18\x02 \x01(\x0b\x32$.google.cloud.dialogflow.cx.v3.AgentB\x03\xe0\x41\x02\"\x7f\n\x12UpdateAgentRequest\x12\x38\n\x05\x61gent\x18\x01 \x01(\x0b\x32$.google.cloud.dialogflow.cx.v3.AgentB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"K\n\x12\x44\x65leteAgentRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\"\x98\x04\n\x12\x45xportAgentRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x16\n\tagent_uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12V\n\x0b\x64\x61ta_format\x18\x03 \x01(\x0e\x32<.google.cloud.dialogflow.cx.v3.ExportAgentRequest.DataFormatB\x03\xe0\x41\x01\x12\x42\n\x0b\x65nvironment\x18\x05 \x01(\tB-\xe0\x41\x01\xfa\x41\'\n%dialogflow.googleapis.com/Environment\x12^\n\x0fgit_destination\x18\x06 \x01(\x0b\x32@.google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestinationB\x03\xe0\x41\x01\x12-\n include_bigquery_export_settings\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x41\n\x0eGitDestination\x12\x17\n\x0ftracking_branch\x18\x01 \x01(\t\x12\x16\n\x0e\x63ommit_message\x18\x02 \x01(\t\"E\n\nDataFormat\x12\x1b\n\x17\x44\x41TA_FORMAT_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42LOB\x10\x01\x12\x10\n\x0cJSON_PACKAGE\x10\x04\"b\n\x13\x45xportAgentResponse\x12\x13\n\tagent_uri\x18\x01 \x01(\tH\x00\x12\x17\n\ragent_content\x18\x02 \x01(\x0cH\x00\x12\x14\n\ncommit_sha\x18\x03 \x01(\tH\x00\x42\x07\n\x05\x61gent\"\xa0\x03\n\x13RestoreAgentRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\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\x12R\n\ngit_source\x18\x06 \x01(\x0b\x32<.google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSourceH\x00\x12X\n\x0erestore_option\x18\x05 \x01(\x0e\x32@.google.cloud.dialogflow.cx.v3.RestoreAgentRequest.RestoreOption\x1a$\n\tGitSource\x12\x17\n\x0ftracking_branch\x18\x01 \x01(\t\"G\n\rRestoreOption\x12\x1e\n\x1aRESTORE_OPTION_UNSPECIFIED\x10\x00\x12\x08\n\x04KEEP\x10\x01\x12\x0c\n\x08\x46\x41LLBACK\x10\x02\x42\x07\n\x05\x61gent\"d\n\x14ValidateAgentRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\x7f\n\x1fGetAgentValidationResultRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/dialogflow.googleapis.com/AgentValidationResult\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\xfa\x01\n\x15\x41gentValidationResult\x12\x0c\n\x04name\x18\x01 \x01(\t\x12T\n\x17\x66low_validation_results\x18\x02 \x03(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.FlowValidationResult:}\xea\x41z\n/dialogflow.googleapis.com/AgentValidationResult\x12Gprojects/{project}/locations/{location}/agents/{agent}/validationResult\"\x83\x01\n\x1cGetGenerativeSettingsRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1dialogflow.googleapis.com/AgentGenerativeSettings\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\xac\x01\n\x1fUpdateGenerativeSettingsRequest\x12S\n\x13generative_settings\x18\x01 \x01(\x0b\x32\x31.google.cloud.dialogflow.cx.v3.GenerativeSettingsB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x32\xa2\x12\n\x06\x41gents\x12\xae\x01\n\nListAgents\x12\x30.google.cloud.dialogflow.cx.v3.ListAgentsRequest\x1a\x31.google.cloud.dialogflow.cx.v3.ListAgentsResponse\";\xda\x41\x06parent\x82\xd3\xe4\x93\x02,\x12*/v3/{parent=projects/*/locations/*}/agents\x12\x9b\x01\n\x08GetAgent\x12..google.cloud.dialogflow.cx.v3.GetAgentRequest\x1a$.google.cloud.dialogflow.cx.v3.Agent\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,\x12*/v3/{name=projects/*/locations/*/agents/*}\x12\xb0\x01\n\x0b\x43reateAgent\x12\x31.google.cloud.dialogflow.cx.v3.CreateAgentRequest\x1a$.google.cloud.dialogflow.cx.v3.Agent\"H\xda\x41\x0cparent,agent\x82\xd3\xe4\x93\x02\x33\"*/v3/{parent=projects/*/locations/*}/agents:\x05\x61gent\x12\xbb\x01\n\x0bUpdateAgent\x12\x31.google.cloud.dialogflow.cx.v3.UpdateAgentRequest\x1a$.google.cloud.dialogflow.cx.v3.Agent\"S\xda\x41\x11\x61gent,update_mask\x82\xd3\xe4\x93\x02\x39\x32\x30/v3/{agent.name=projects/*/locations/*/agents/*}:\x05\x61gent\x12\x93\x01\n\x0b\x44\x65leteAgent\x12\x31.google.cloud.dialogflow.cx.v3.DeleteAgentRequest\x1a\x16.google.protobuf.Empty\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,**/v3/{name=projects/*/locations/*/agents/*}\x12\xcd\x01\n\x0b\x45xportAgent\x12\x31.google.cloud.dialogflow.cx.v3.ExportAgentRequest\x1a\x1d.google.longrunning.Operation\"l\xca\x41-\n\x13\x45xportAgentResponse\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02\x36\"1/v3/{name=projects/*/locations/*/agents/*}:export:\x01*\x12\xd2\x01\n\x0cRestoreAgent\x12\x32.google.cloud.dialogflow.cx.v3.RestoreAgentRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02\x37\"2/v3/{name=projects/*/locations/*/agents/*}:restore:\x01*\x12\xba\x01\n\rValidateAgent\x12\x33.google.cloud.dialogflow.cx.v3.ValidateAgentRequest\x1a\x34.google.cloud.dialogflow.cx.v3.AgentValidationResult\">\x82\xd3\xe4\x93\x02\x38\"3/v3/{name=projects/*/locations/*/agents/*}:validate:\x01*\x12\xdc\x01\n\x18GetAgentValidationResult\x12>.google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest\x1a\x34.google.cloud.dialogflow.cx.v3.AgentValidationResult\"J\xda\x41\x04name\x82\xd3\xe4\x93\x02=\x12;/v3/{name=projects/*/locations/*/agents/*/validationResult}\x12\xe3\x01\n\x15GetGenerativeSettings\x12;.google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest\x1a\x31.google.cloud.dialogflow.cx.v3.GenerativeSettings\"Z\xda\x41\x12name,language_code\x82\xd3\xe4\x93\x02?\x12=/v3/{name=projects/*/locations/*/agents/*/generativeSettings}\x12\xa0\x02\n\x18UpdateGenerativeSettings\x12>.google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest\x1a\x31.google.cloud.dialogflow.cx.v3.GenerativeSettings\"\x90\x01\xda\x41\x1fgenerative_settings,update_mask\x82\xd3\xe4\x93\x02h2Q/v3/{generative_settings.name=projects/*/locations/*/agents/*/generativeSettings}:\x13generative_settings\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x94\x02\n!com.google.cloud.dialogflow.cx.v3B\nAgentProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3\xea\x41\x64\n*secretmanager.googleapis.com/SecretVersion\x12\x36projects/{project}/secrets/{secret}/versions/{version}b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/paths.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/paths.rb index 0f4550325327..41cc0254188b 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/paths.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/paths.rb @@ -141,6 +141,27 @@ def location_path project:, location: "projects/#{project}/locations/#{location}" end + ## + # Create a fully-qualified Playbook resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param playbook [String] + # + # @return [::String] + def playbook_path project:, location:, agent:, playbook: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}" + end + ## # Create a fully-qualified SecretVersion resource string. # diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/code_block_pb.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/code_block_pb.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/code_block_pb.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/code_block_pb.rb diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/data_store_connection_pb.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/data_store_connection_pb.rb index df606acd15b4..d26d07a2049c 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/data_store_connection_pb.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/data_store_connection_pb.rb @@ -5,9 +5,10 @@ require 'google/protobuf' require 'google/api/field_behavior_pb' +require 'google/protobuf/struct_pb' -descriptor_data = "\n9google/cloud/dialogflow/cx/v3/data_store_connection.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\"\xc9\x01\n\x13\x44\x61taStoreConnection\x12\x45\n\x0f\x64\x61ta_store_type\x18\x01 \x01(\x0e\x32,.google.cloud.dialogflow.cx.v3.DataStoreType\x12\x12\n\ndata_store\x18\x02 \x01(\t\x12W\n\x18\x64ocument_processing_mode\x18\x04 \x01(\x0e\x32\x35.google.cloud.dialogflow.cx.v3.DocumentProcessingMode\"\xa2\x12\n\x1a\x44\x61taStoreConnectionSignals\x12|\n\x1brewriter_model_call_signals\x18\x01 \x01(\x0b\x32R.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignalsB\x03\xe0\x41\x01\x12\x1c\n\x0frewritten_query\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x65\n\x0fsearch_snippets\x18\x03 \x03(\x0b\x32G.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippetB\x03\xe0\x41\x01\x12\x8d\x01\n$answer_generation_model_call_signals\x18\x04 \x01(\x0b\x32Z.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignalsB\x03\xe0\x41\x01\x12\x13\n\x06\x61nswer\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12_\n\x0c\x61nswer_parts\x18\x06 \x03(\x0b\x32\x44.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPartB\x03\xe0\x41\x01\x12\x63\n\x0e\x63ited_snippets\x18\x07 \x03(\x0b\x32\x46.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippetB\x03\xe0\x41\x01\x12j\n\x11grounding_signals\x18\x08 \x01(\x0b\x32J.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignalsB\x03\xe0\x41\x01\x12\x64\n\x0esafety_signals\x18\t \x01(\x0b\x32G.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignalsB\x03\xe0\x41\x01\x1aX\n\x18RewriterModelCallSignals\x12\x17\n\x0frendered_prompt\x18\x01 \x01(\t\x12\x14\n\x0cmodel_output\x18\x02 \x01(\t\x12\r\n\x05model\x18\x03 \x01(\t\x1aK\n\rSearchSnippet\x12\x16\n\x0e\x64ocument_title\x18\x01 \x01(\t\x12\x14\n\x0c\x64ocument_uri\x18\x02 \x01(\t\x12\x0c\n\x04text\x18\x03 \x01(\t\x1a`\n AnswerGenerationModelCallSignals\x12\x17\n\x0frendered_prompt\x18\x01 \x01(\t\x12\x14\n\x0cmodel_output\x18\x02 \x01(\t\x12\r\n\x05model\x18\x03 \x01(\t\x1a\x36\n\nAnswerPart\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x1a\n\x12supporting_indices\x18\x02 \x03(\x05\x1a\x86\x01\n\x0c\x43itedSnippet\x12_\n\x0esearch_snippet\x18\x01 \x01(\x0b\x32G.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet\x12\x15\n\rsnippet_index\x18\x02 \x01(\x05\x1a\xdd\x03\n\x10GroundingSignals\x12n\n\x08\x64\x65\x63ision\x18\x01 \x01(\x0e\x32\\.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingDecision\x12n\n\x05score\x18\x02 \x01(\x0e\x32_.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket\"m\n\x11GroundingDecision\x12\"\n\x1eGROUNDING_DECISION_UNSPECIFIED\x10\x00\x12\x19\n\x15\x41\x43\x43\x45PTED_BY_GROUNDING\x10\x01\x12\x19\n\x15REJECTED_BY_GROUNDING\x10\x02\"z\n\x14GroundingScoreBucket\x12&\n\"GROUNDING_SCORE_BUCKET_UNSPECIFIED\x10\x00\x12\x0c\n\x08VERY_LOW\x10\x01\x12\x07\n\x03LOW\x10\x03\x12\n\n\x06MEDIUM\x10\x04\x12\x08\n\x04HIGH\x10\x05\x12\r\n\tVERY_HIGH\x10\x06\x1a\x99\x04\n\rSafetySignals\x12h\n\x08\x64\x65\x63ision\x18\x01 \x01(\x0e\x32V.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.SafetyDecision\x12v\n\x13\x62\x61nned_phrase_match\x18\x02 \x01(\x0e\x32Y.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch\x12\x1d\n\x15matched_banned_phrase\x18\x03 \x01(\t\"m\n\x0eSafetyDecision\x12\x1f\n\x1bSAFETY_DECISION_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x41\x43\x43\x45PTED_BY_SAFETY_CHECK\x10\x01\x12\x1c\n\x18REJECTED_BY_SAFETY_CHECK\x10\x02\"\x97\x01\n\x11\x42\x61nnedPhraseMatch\x12#\n\x1f\x42\x41NNED_PHRASE_MATCH_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x42\x41NNED_PHRASE_MATCH_NONE\x10\x01\x12\x1d\n\x19\x42\x41NNED_PHRASE_MATCH_QUERY\x10\x02\x12 \n\x1c\x42\x41NNED_PHRASE_MATCH_RESPONSE\x10\x03*b\n\rDataStoreType\x12\x1f\n\x1b\x44\x41TA_STORE_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nPUBLIC_WEB\x10\x01\x12\x10\n\x0cUNSTRUCTURED\x10\x02\x12\x0e\n\nSTRUCTURED\x10\x03*]\n\x16\x44ocumentProcessingMode\x12(\n$DOCUMENT_PROCESSING_MODE_UNSPECIFIED\x10\x00\x12\r\n\tDOCUMENTS\x10\x01\x12\n\n\x06\x43HUNKS\x10\x02\x42\xbb\x01\n!com.google.cloud.dialogflow.cx.v3B\x18\x44\x61taStoreConnectionProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" +descriptor_data = "\n9google/cloud/dialogflow/cx/v3/data_store_connection.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xc9\x01\n\x13\x44\x61taStoreConnection\x12\x45\n\x0f\x64\x61ta_store_type\x18\x01 \x01(\x0e\x32,.google.cloud.dialogflow.cx.v3.DataStoreType\x12\x12\n\ndata_store\x18\x02 \x01(\t\x12W\n\x18\x64ocument_processing_mode\x18\x04 \x01(\x0e\x32\x35.google.cloud.dialogflow.cx.v3.DocumentProcessingMode\"\xcd\x12\n\x1a\x44\x61taStoreConnectionSignals\x12|\n\x1brewriter_model_call_signals\x18\x01 \x01(\x0b\x32R.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignalsB\x03\xe0\x41\x01\x12\x1c\n\x0frewritten_query\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x65\n\x0fsearch_snippets\x18\x03 \x03(\x0b\x32G.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippetB\x03\xe0\x41\x01\x12\x8d\x01\n$answer_generation_model_call_signals\x18\x04 \x01(\x0b\x32Z.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignalsB\x03\xe0\x41\x01\x12\x13\n\x06\x61nswer\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12_\n\x0c\x61nswer_parts\x18\x06 \x03(\x0b\x32\x44.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPartB\x03\xe0\x41\x01\x12\x63\n\x0e\x63ited_snippets\x18\x07 \x03(\x0b\x32\x46.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippetB\x03\xe0\x41\x01\x12j\n\x11grounding_signals\x18\x08 \x01(\x0b\x32J.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignalsB\x03\xe0\x41\x01\x12\x64\n\x0esafety_signals\x18\t \x01(\x0b\x32G.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignalsB\x03\xe0\x41\x01\x1aX\n\x18RewriterModelCallSignals\x12\x17\n\x0frendered_prompt\x18\x01 \x01(\t\x12\x14\n\x0cmodel_output\x18\x02 \x01(\t\x12\r\n\x05model\x18\x03 \x01(\t\x1av\n\rSearchSnippet\x12\x16\n\x0e\x64ocument_title\x18\x01 \x01(\t\x12\x14\n\x0c\x64ocument_uri\x18\x02 \x01(\t\x12\x0c\n\x04text\x18\x03 \x01(\t\x12)\n\x08metadata\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a`\n AnswerGenerationModelCallSignals\x12\x17\n\x0frendered_prompt\x18\x01 \x01(\t\x12\x14\n\x0cmodel_output\x18\x02 \x01(\t\x12\r\n\x05model\x18\x03 \x01(\t\x1a\x36\n\nAnswerPart\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x1a\n\x12supporting_indices\x18\x02 \x03(\x05\x1a\x86\x01\n\x0c\x43itedSnippet\x12_\n\x0esearch_snippet\x18\x01 \x01(\x0b\x32G.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet\x12\x15\n\rsnippet_index\x18\x02 \x01(\x05\x1a\xdd\x03\n\x10GroundingSignals\x12n\n\x08\x64\x65\x63ision\x18\x01 \x01(\x0e\x32\\.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingDecision\x12n\n\x05score\x18\x02 \x01(\x0e\x32_.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket\"m\n\x11GroundingDecision\x12\"\n\x1eGROUNDING_DECISION_UNSPECIFIED\x10\x00\x12\x19\n\x15\x41\x43\x43\x45PTED_BY_GROUNDING\x10\x01\x12\x19\n\x15REJECTED_BY_GROUNDING\x10\x02\"z\n\x14GroundingScoreBucket\x12&\n\"GROUNDING_SCORE_BUCKET_UNSPECIFIED\x10\x00\x12\x0c\n\x08VERY_LOW\x10\x01\x12\x07\n\x03LOW\x10\x03\x12\n\n\x06MEDIUM\x10\x04\x12\x08\n\x04HIGH\x10\x05\x12\r\n\tVERY_HIGH\x10\x06\x1a\x99\x04\n\rSafetySignals\x12h\n\x08\x64\x65\x63ision\x18\x01 \x01(\x0e\x32V.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.SafetyDecision\x12v\n\x13\x62\x61nned_phrase_match\x18\x02 \x01(\x0e\x32Y.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch\x12\x1d\n\x15matched_banned_phrase\x18\x03 \x01(\t\"m\n\x0eSafetyDecision\x12\x1f\n\x1bSAFETY_DECISION_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x41\x43\x43\x45PTED_BY_SAFETY_CHECK\x10\x01\x12\x1c\n\x18REJECTED_BY_SAFETY_CHECK\x10\x02\"\x97\x01\n\x11\x42\x61nnedPhraseMatch\x12#\n\x1f\x42\x41NNED_PHRASE_MATCH_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x42\x41NNED_PHRASE_MATCH_NONE\x10\x01\x12\x1d\n\x19\x42\x41NNED_PHRASE_MATCH_QUERY\x10\x02\x12 \n\x1c\x42\x41NNED_PHRASE_MATCH_RESPONSE\x10\x03*b\n\rDataStoreType\x12\x1f\n\x1b\x44\x41TA_STORE_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nPUBLIC_WEB\x10\x01\x12\x10\n\x0cUNSTRUCTURED\x10\x02\x12\x0e\n\nSTRUCTURED\x10\x03*]\n\x16\x44ocumentProcessingMode\x12(\n$DOCUMENT_PROCESSING_MODE_UNSPECIFIED\x10\x00\x12\r\n\tDOCUMENTS\x10\x01\x12\n\n\x06\x43HUNKS\x10\x02\x42\xbb\x01\n!com.google.cloud.dialogflow.cx.v3B\x18\x44\x61taStoreConnectionProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -22,6 +23,7 @@ file = pool.add_serialized_file(serialized) warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" imports = [ + ["google.protobuf.Struct", "google/protobuf/struct.proto"], ] imports.each do |type_name, expected_filename| import_file = pool.lookup(type_name).file_descriptor diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/paths.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/paths.rb index 61c993b0dc83..b58eb0303c03 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/paths.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/paths.rb @@ -65,6 +65,25 @@ def environment_path project:, location:, agent:, environment: "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}" 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. # diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/example_pb.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/example_pb.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/example_pb.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/example_pb.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/example_services_pb.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/example_services_pb.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/example_services_pb.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/example_services_pb.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/client.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/client.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/client.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/credentials.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/credentials.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/credentials.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/credentials.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/paths.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/paths.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/paths.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/paths.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest/client.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest/client.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest/client.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest/service_stub.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest/service_stub.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest/service_stub.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/examples/rest/service_stub.rb diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb index e9e7822ea58d..60fc2400f4c8 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb @@ -11,6 +11,7 @@ require 'google/cloud/dialogflow/cx/v3/advanced_settings_pb' require 'google/cloud/dialogflow/cx/v3/import_strategy_pb' require 'google/cloud/dialogflow/cx/v3/page_pb' +require 'google/cloud/dialogflow/cx/v3/parameter_definition_pb' require 'google/cloud/dialogflow/cx/v3/validation_message_pb' require 'google/longrunning/operations_pb' require 'google/protobuf/empty_pb' @@ -19,7 +20,7 @@ require 'google/protobuf/timestamp_pb' -descriptor_data = "\n(google/cloud/dialogflow/cx/v3/flow.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/advanced_settings.proto\x1a\x33google/cloud/dialogflow/cx/v3/import_strategy.proto\x1a(google/cloud/dialogflow/cx/v3/page.proto\x1a\x36google/cloud/dialogflow/cx/v3/validation_message.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xac\x03\n\x0bNluSettings\x12H\n\nmodel_type\x18\x01 \x01(\x0e\x32\x34.google.cloud.dialogflow.cx.v3.NluSettings.ModelType\x12 \n\x18\x63lassification_threshold\x18\x03 \x01(\x02\x12Y\n\x13model_training_mode\x18\x04 \x01(\x0e\x32<.google.cloud.dialogflow.cx.v3.NluSettings.ModelTrainingMode\"Y\n\tModelType\x12\x1a\n\x16MODEL_TYPE_UNSPECIFIED\x10\x00\x12\x17\n\x13MODEL_TYPE_STANDARD\x10\x01\x12\x17\n\x13MODEL_TYPE_ADVANCED\x10\x03\"{\n\x11ModelTrainingMode\x12#\n\x1fMODEL_TRAINING_MODE_UNSPECIFIED\x10\x00\x12!\n\x1dMODEL_TRAINING_MODE_AUTOMATIC\x10\x01\x12\x1e\n\x1aMODEL_TRAINING_MODE_MANUAL\x10\x02\"\xf0\x06\n\x04\x46low\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12I\n\x11transition_routes\x18\x04 \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.TransitionRoute\x12\x43\n\x0e\x65vent_handlers\x18\n \x03(\x0b\x32+.google.cloud.dialogflow.cx.v3.EventHandler\x12T\n\x17transition_route_groups\x18\x0f \x03(\tB3\xfa\x41\x30\n.dialogflow.googleapis.com/TransitionRouteGroup\x12@\n\x0cnlu_settings\x18\x0b \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.NluSettings\x12J\n\x11\x61\x64vanced_settings\x18\x0e \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x12\x64\n\x1cknowledge_connector_settings\x18\x12 \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettingsB\x03\xe0\x41\x01\x12_\n\x17multi_language_settings\x18\x1c \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettingsB\x03\xe0\x41\x01\x12\x0e\n\x06locked\x18\x1e \x01(\x08\x1au\n\x15MultiLanguageSettings\x12,\n\x1f\x65nable_multi_language_detection\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12.\n!supported_response_language_codes\x18\x02 \x03(\tB\x03\xe0\x41\x01:h\xea\x41\x65\n\x1e\x64ialogflow.googleapis.com/Flow\x12\x43projects/{project}/locations/{location}/agents/{agent}/flows/{flow}\"\x9a\x01\n\x11\x43reateFlowRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Flow\x12\x36\n\x04\x66low\x18\x02 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.FlowB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"X\n\x11\x44\x65leteFlowRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\"\x88\x01\n\x10ListFlowsRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Flow\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x15\n\rlanguage_code\x18\x04 \x01(\t\"`\n\x11ListFlowsResponse\x12\x32\n\x05\x66lows\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.cx.v3.Flow\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"]\n\x0eGetFlowRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\x93\x01\n\x11UpdateFlowRequest\x12\x36\n\x04\x66low\x18\x01 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.FlowB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"H\n\x10TrainFlowRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\"b\n\x13ValidateFlowRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"}\n\x1eGetFlowValidationResultRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.dialogflow.googleapis.com/FlowValidationResult\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\xb1\x02\n\x14\x46lowValidationResult\x12\x0c\n\x04name\x18\x01 \x01(\t\x12M\n\x13validation_messages\x18\x02 \x03(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.ValidationMessage\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp:\x8a\x01\xea\x41\x86\x01\n.dialogflow.googleapis.com/FlowValidationResult\x12Tprojects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult\"\xf2\x02\n\x11ImportFlowRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Flow\x12\x12\n\x08\x66low_uri\x18\x02 \x01(\tH\x00\x12\x16\n\x0c\x66low_content\x18\x03 \x01(\x0cH\x00\x12T\n\rimport_option\x18\x04 \x01(\x0e\x32=.google.cloud.dialogflow.cx.v3.ImportFlowRequest.ImportOption\x12T\n\x14\x66low_import_strategy\x18\x05 \x01(\x0b\x32\x31.google.cloud.dialogflow.cx.v3.FlowImportStrategyB\x03\xe0\x41\x01\"E\n\x0cImportOption\x12\x1d\n\x19IMPORT_OPTION_UNSPECIFIED\x10\x00\x12\x08\n\x04KEEP\x10\x01\x12\x0c\n\x08\x46\x41LLBACK\x10\x02\x42\x06\n\x04\x66low\"h\n\x12\x46lowImportStrategy\x12R\n\x16global_import_strategy\x18\x01 \x01(\x0e\x32-.google.cloud.dialogflow.cx.v3.ImportStrategyB\x03\xe0\x41\x01\"G\n\x12ImportFlowResponse\x12\x31\n\x04\x66low\x18\x01 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\"\x87\x01\n\x11\x45xportFlowRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12\x15\n\x08\x66low_uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18include_referenced_flows\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"H\n\x12\x45xportFlowResponse\x12\x12\n\x08\x66low_uri\x18\x01 \x01(\tH\x00\x12\x16\n\x0c\x66low_content\x18\x02 \x01(\x0cH\x00\x42\x06\n\x04\x66low2\x98\x10\n\x05\x46lows\x12\xb3\x01\n\nCreateFlow\x12\x30.google.cloud.dialogflow.cx.v3.CreateFlowRequest\x1a#.google.cloud.dialogflow.cx.v3.Flow\"N\xda\x41\x0bparent,flow\x82\xd3\xe4\x93\x02:\"2/v3/{parent=projects/*/locations/*/agents/*}/flows:\x04\x66low\x12\x99\x01\n\nDeleteFlow\x12\x30.google.cloud.dialogflow.cx.v3.DeleteFlowRequest\x1a\x16.google.protobuf.Empty\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34*2/v3/{name=projects/*/locations/*/agents/*/flows/*}\x12\xb3\x01\n\tListFlows\x12/.google.cloud.dialogflow.cx.v3.ListFlowsRequest\x1a\x30.google.cloud.dialogflow.cx.v3.ListFlowsResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v3/{parent=projects/*/locations/*/agents/*}/flows\x12\xa0\x01\n\x07GetFlow\x12-.google.cloud.dialogflow.cx.v3.GetFlowRequest\x1a#.google.cloud.dialogflow.cx.v3.Flow\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v3/{name=projects/*/locations/*/agents/*/flows/*}\x12\xbd\x01\n\nUpdateFlow\x12\x30.google.cloud.dialogflow.cx.v3.UpdateFlowRequest\x1a#.google.cloud.dialogflow.cx.v3.Flow\"X\xda\x41\x10\x66low,update_mask\x82\xd3\xe4\x93\x02?27/v3/{flow.name=projects/*/locations/*/agents/*/flows/*}:\x04\x66low\x12\xd9\x01\n\tTrainFlow\x12/.google.cloud.dialogflow.cx.v3.TrainFlowRequest\x1a\x1d.google.longrunning.Operation\"|\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xda\x41\x04name\x82\xd3\xe4\x93\x02=\"8/v3/{name=projects/*/locations/*/agents/*/flows/*}:train:\x01*\x12\xbf\x01\n\x0cValidateFlow\x12\x32.google.cloud.dialogflow.cx.v3.ValidateFlowRequest\x1a\x33.google.cloud.dialogflow.cx.v3.FlowValidationResult\"F\x82\xd3\xe4\x93\x02@\";/v3/{name=projects/*/locations/*/agents/*/flows/*}:validate:\x01*\x12\xe1\x01\n\x17GetFlowValidationResult\x12=.google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest\x1a\x33.google.cloud.dialogflow.cx.v3.FlowValidationResult\"R\xda\x41\x04name\x82\xd3\xe4\x93\x02\x45\x12\x43/v3/{name=projects/*/locations/*/agents/*/flows/*/validationResult}\x12\xd2\x01\n\nImportFlow\x12\x30.google.cloud.dialogflow.cx.v3.ImportFlowRequest\x1a\x1d.google.longrunning.Operation\"s\xca\x41,\n\x12ImportFlowResponse\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02>\"9/v3/{parent=projects/*/locations/*/agents/*}/flows:import:\x01*\x12\xd2\x01\n\nExportFlow\x12\x30.google.cloud.dialogflow.cx.v3.ExportFlowRequest\x1a\x1d.google.longrunning.Operation\"s\xca\x41,\n\x12\x45xportFlowResponse\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02>\"9/v3/{name=projects/*/locations/*/agents/*/flows/*}:export:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xac\x01\n!com.google.cloud.dialogflow.cx.v3B\tFlowProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" +descriptor_data = "\n(google/cloud/dialogflow/cx/v3/flow.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/advanced_settings.proto\x1a\x33google/cloud/dialogflow/cx/v3/import_strategy.proto\x1a(google/cloud/dialogflow/cx/v3/page.proto\x1a\x38google/cloud/dialogflow/cx/v3/parameter_definition.proto\x1a\x36google/cloud/dialogflow/cx/v3/validation_message.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xac\x03\n\x0bNluSettings\x12H\n\nmodel_type\x18\x01 \x01(\x0e\x32\x34.google.cloud.dialogflow.cx.v3.NluSettings.ModelType\x12 \n\x18\x63lassification_threshold\x18\x03 \x01(\x02\x12Y\n\x13model_training_mode\x18\x04 \x01(\x0e\x32<.google.cloud.dialogflow.cx.v3.NluSettings.ModelTrainingMode\"Y\n\tModelType\x12\x1a\n\x16MODEL_TYPE_UNSPECIFIED\x10\x00\x12\x17\n\x13MODEL_TYPE_STANDARD\x10\x01\x12\x17\n\x13MODEL_TYPE_ADVANCED\x10\x03\"{\n\x11ModelTrainingMode\x12#\n\x1fMODEL_TRAINING_MODE_UNSPECIFIED\x10\x00\x12!\n\x1dMODEL_TRAINING_MODE_AUTOMATIC\x10\x01\x12\x1e\n\x1aMODEL_TRAINING_MODE_MANUAL\x10\x02\"\xad\x08\n\x04\x46low\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12I\n\x11transition_routes\x18\x04 \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.TransitionRoute\x12\x43\n\x0e\x65vent_handlers\x18\n \x03(\x0b\x32+.google.cloud.dialogflow.cx.v3.EventHandler\x12T\n\x17transition_route_groups\x18\x0f \x03(\tB3\xfa\x41\x30\n.dialogflow.googleapis.com/TransitionRouteGroup\x12@\n\x0cnlu_settings\x18\x0b \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.NluSettings\x12J\n\x11\x61\x64vanced_settings\x18\x0e \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x12\x64\n\x1cknowledge_connector_settings\x18\x12 \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettingsB\x03\xe0\x41\x01\x12\\\n\x1binput_parameter_definitions\x18\x1a \x03(\x0b\x32\x32.google.cloud.dialogflow.cx.v3.ParameterDefinitionB\x03\xe0\x41\x01\x12]\n\x1coutput_parameter_definitions\x18\x1b \x03(\x0b\x32\x32.google.cloud.dialogflow.cx.v3.ParameterDefinitionB\x03\xe0\x41\x01\x12_\n\x17multi_language_settings\x18\x1c \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettingsB\x03\xe0\x41\x01\x12\x0e\n\x06locked\x18\x1e \x01(\x08\x1au\n\x15MultiLanguageSettings\x12,\n\x1f\x65nable_multi_language_detection\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12.\n!supported_response_language_codes\x18\x02 \x03(\tB\x03\xe0\x41\x01:h\xea\x41\x65\n\x1e\x64ialogflow.googleapis.com/Flow\x12\x43projects/{project}/locations/{location}/agents/{agent}/flows/{flow}\"\x9a\x01\n\x11\x43reateFlowRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Flow\x12\x36\n\x04\x66low\x18\x02 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.FlowB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"X\n\x11\x44\x65leteFlowRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\"\x88\x01\n\x10ListFlowsRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Flow\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x15\n\rlanguage_code\x18\x04 \x01(\t\"`\n\x11ListFlowsResponse\x12\x32\n\x05\x66lows\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.cx.v3.Flow\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"]\n\x0eGetFlowRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\x93\x01\n\x11UpdateFlowRequest\x12\x36\n\x04\x66low\x18\x01 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.FlowB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"H\n\x10TrainFlowRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\"b\n\x13ValidateFlowRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"}\n\x1eGetFlowValidationResultRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.dialogflow.googleapis.com/FlowValidationResult\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\xb1\x02\n\x14\x46lowValidationResult\x12\x0c\n\x04name\x18\x01 \x01(\t\x12M\n\x13validation_messages\x18\x02 \x03(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.ValidationMessage\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp:\x8a\x01\xea\x41\x86\x01\n.dialogflow.googleapis.com/FlowValidationResult\x12Tprojects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult\"\xf2\x02\n\x11ImportFlowRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Flow\x12\x12\n\x08\x66low_uri\x18\x02 \x01(\tH\x00\x12\x16\n\x0c\x66low_content\x18\x03 \x01(\x0cH\x00\x12T\n\rimport_option\x18\x04 \x01(\x0e\x32=.google.cloud.dialogflow.cx.v3.ImportFlowRequest.ImportOption\x12T\n\x14\x66low_import_strategy\x18\x05 \x01(\x0b\x32\x31.google.cloud.dialogflow.cx.v3.FlowImportStrategyB\x03\xe0\x41\x01\"E\n\x0cImportOption\x12\x1d\n\x19IMPORT_OPTION_UNSPECIFIED\x10\x00\x12\x08\n\x04KEEP\x10\x01\x12\x0c\n\x08\x46\x41LLBACK\x10\x02\x42\x06\n\x04\x66low\"h\n\x12\x46lowImportStrategy\x12R\n\x16global_import_strategy\x18\x01 \x01(\x0e\x32-.google.cloud.dialogflow.cx.v3.ImportStrategyB\x03\xe0\x41\x01\"G\n\x12ImportFlowResponse\x12\x31\n\x04\x66low\x18\x01 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\"\x87\x01\n\x11\x45xportFlowRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12\x15\n\x08\x66low_uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18include_referenced_flows\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"H\n\x12\x45xportFlowResponse\x12\x12\n\x08\x66low_uri\x18\x01 \x01(\tH\x00\x12\x16\n\x0c\x66low_content\x18\x02 \x01(\x0cH\x00\x42\x06\n\x04\x66low2\x98\x10\n\x05\x46lows\x12\xb3\x01\n\nCreateFlow\x12\x30.google.cloud.dialogflow.cx.v3.CreateFlowRequest\x1a#.google.cloud.dialogflow.cx.v3.Flow\"N\xda\x41\x0bparent,flow\x82\xd3\xe4\x93\x02:\"2/v3/{parent=projects/*/locations/*/agents/*}/flows:\x04\x66low\x12\x99\x01\n\nDeleteFlow\x12\x30.google.cloud.dialogflow.cx.v3.DeleteFlowRequest\x1a\x16.google.protobuf.Empty\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34*2/v3/{name=projects/*/locations/*/agents/*/flows/*}\x12\xb3\x01\n\tListFlows\x12/.google.cloud.dialogflow.cx.v3.ListFlowsRequest\x1a\x30.google.cloud.dialogflow.cx.v3.ListFlowsResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v3/{parent=projects/*/locations/*/agents/*}/flows\x12\xa0\x01\n\x07GetFlow\x12-.google.cloud.dialogflow.cx.v3.GetFlowRequest\x1a#.google.cloud.dialogflow.cx.v3.Flow\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v3/{name=projects/*/locations/*/agents/*/flows/*}\x12\xbd\x01\n\nUpdateFlow\x12\x30.google.cloud.dialogflow.cx.v3.UpdateFlowRequest\x1a#.google.cloud.dialogflow.cx.v3.Flow\"X\xda\x41\x10\x66low,update_mask\x82\xd3\xe4\x93\x02?27/v3/{flow.name=projects/*/locations/*/agents/*/flows/*}:\x04\x66low\x12\xd9\x01\n\tTrainFlow\x12/.google.cloud.dialogflow.cx.v3.TrainFlowRequest\x1a\x1d.google.longrunning.Operation\"|\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xda\x41\x04name\x82\xd3\xe4\x93\x02=\"8/v3/{name=projects/*/locations/*/agents/*/flows/*}:train:\x01*\x12\xbf\x01\n\x0cValidateFlow\x12\x32.google.cloud.dialogflow.cx.v3.ValidateFlowRequest\x1a\x33.google.cloud.dialogflow.cx.v3.FlowValidationResult\"F\x82\xd3\xe4\x93\x02@\";/v3/{name=projects/*/locations/*/agents/*/flows/*}:validate:\x01*\x12\xe1\x01\n\x17GetFlowValidationResult\x12=.google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest\x1a\x33.google.cloud.dialogflow.cx.v3.FlowValidationResult\"R\xda\x41\x04name\x82\xd3\xe4\x93\x02\x45\x12\x43/v3/{name=projects/*/locations/*/agents/*/flows/*/validationResult}\x12\xd2\x01\n\nImportFlow\x12\x30.google.cloud.dialogflow.cx.v3.ImportFlowRequest\x1a\x1d.google.longrunning.Operation\"s\xca\x41,\n\x12ImportFlowResponse\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02>\"9/v3/{parent=projects/*/locations/*/agents/*}/flows:import:\x01*\x12\xd2\x01\n\nExportFlow\x12\x30.google.cloud.dialogflow.cx.v3.ExportFlowRequest\x1a\x1d.google.longrunning.Operation\"s\xca\x41,\n\x12\x45xportFlowResponse\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02>\"9/v3/{name=projects/*/locations/*/agents/*/flows/*}:export:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xac\x01\n!com.google.cloud.dialogflow.cx.v3B\tFlowProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -36,6 +37,7 @@ imports = [ ["google.cloud.dialogflow.cx.v3.TransitionRoute", "google/cloud/dialogflow/cx/v3/page.proto"], ["google.cloud.dialogflow.cx.v3.AdvancedSettings", "google/cloud/dialogflow/cx/v3/advanced_settings.proto"], + ["google.cloud.dialogflow.cx.v3.ParameterDefinition", "google/cloud/dialogflow/cx/v3/parameter_definition.proto"], ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], ["google.cloud.dialogflow.cx.v3.ValidationMessage", "google/cloud/dialogflow/cx/v3/validation_message.proto"], ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/paths.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/paths.rb index 2a622c94442a..35a4a4a67286 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/paths.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/paths.rb @@ -151,6 +151,48 @@ def page_path project:, location:, agent:, flow:, page: "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/pages/#{page}" end + ## + # Create a fully-qualified Playbook resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param playbook [String] + # + # @return [::String] + def playbook_path project:, location:, agent:, playbook: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}" + end + + ## + # Create a fully-qualified Tool resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param tool [String] + # + # @return [::String] + def tool_path project:, location:, agent:, tool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/tools/#{tool}" + end + ## # Create a fully-qualified TransitionRouteGroup resource string. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generative_settings_pb.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generative_settings_pb.rb index 06d8db34db71..3738fddbe12b 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generative_settings_pb.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generative_settings_pb.rb @@ -8,7 +8,7 @@ require 'google/cloud/dialogflow/cx/v3/safety_settings_pb' -descriptor_data = "\n7google/cloud/dialogflow/cx/v3/generative_settings.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x19google/api/resource.proto\x1a\x33google/cloud/dialogflow/cx/v3/safety_settings.proto\"\xfb\x06\n\x12GenerativeSettings\x12\x0c\n\x04name\x18\x05 \x01(\t\x12]\n\x11\x66\x61llback_settings\x18\x01 \x01(\x0b\x32\x42.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings\x12Q\n\x1agenerative_safety_settings\x18\x03 \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.SafetySettings\x12r\n\x1cknowledge_connector_settings\x18\x07 \x01(\x0b\x32L.google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings\x12\x15\n\rlanguage_code\x18\x04 \x01(\t\x1a\xe5\x01\n\x10\x46\x61llbackSettings\x12\x17\n\x0fselected_prompt\x18\x03 \x01(\t\x12k\n\x10prompt_templates\x18\x04 \x03(\x0b\x32Q.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate\x1aK\n\x0ePromptTemplate\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x13\n\x0bprompt_text\x18\x02 \x01(\t\x12\x0e\n\x06\x66rozen\x18\x03 \x01(\x08\x1a\xad\x01\n\x1aKnowledgeConnectorSettings\x12\x10\n\x08\x62usiness\x18\x01 \x01(\t\x12\r\n\x05\x61gent\x18\x02 \x01(\t\x12\x16\n\x0e\x61gent_identity\x18\x03 \x01(\t\x12\x1c\n\x14\x62usiness_description\x18\x04 \x01(\t\x12\x13\n\x0b\x61gent_scope\x18\x05 \x01(\t\x12#\n\x1b\x64isable_data_store_fallback\x18\x08 \x01(\x08:\x81\x01\xea\x41~\n1dialogflow.googleapis.com/AgentGenerativeSettings\x12Iprojects/{project}/locations/{location}/agents/{agent}/generativeSettingsB\xba\x01\n!com.google.cloud.dialogflow.cx.v3B\x17GenerativeSettingsProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" +descriptor_data = "\n7google/cloud/dialogflow/cx/v3/generative_settings.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x19google/api/resource.proto\x1a\x33google/cloud/dialogflow/cx/v3/safety_settings.proto\"\xc8\x07\n\x12GenerativeSettings\x12\x0c\n\x04name\x18\x05 \x01(\t\x12]\n\x11\x66\x61llback_settings\x18\x01 \x01(\x0b\x32\x42.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings\x12Q\n\x1agenerative_safety_settings\x18\x03 \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.SafetySettings\x12r\n\x1cknowledge_connector_settings\x18\x07 \x01(\x0b\x32L.google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings\x12\x15\n\rlanguage_code\x18\x04 \x01(\t\x12K\n\x12llm_model_settings\x18\x08 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.LlmModelSettings\x1a\xe5\x01\n\x10\x46\x61llbackSettings\x12\x17\n\x0fselected_prompt\x18\x03 \x01(\t\x12k\n\x10prompt_templates\x18\x04 \x03(\x0b\x32Q.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate\x1aK\n\x0ePromptTemplate\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x13\n\x0bprompt_text\x18\x02 \x01(\t\x12\x0e\n\x06\x66rozen\x18\x03 \x01(\x08\x1a\xad\x01\n\x1aKnowledgeConnectorSettings\x12\x10\n\x08\x62usiness\x18\x01 \x01(\t\x12\r\n\x05\x61gent\x18\x02 \x01(\t\x12\x16\n\x0e\x61gent_identity\x18\x03 \x01(\t\x12\x1c\n\x14\x62usiness_description\x18\x04 \x01(\t\x12\x13\n\x0b\x61gent_scope\x18\x05 \x01(\t\x12#\n\x1b\x64isable_data_store_fallback\x18\x08 \x01(\x08:\x81\x01\xea\x41~\n1dialogflow.googleapis.com/AgentGenerativeSettings\x12Iprojects/{project}/locations/{location}/agents/{agent}/generativeSettings\"6\n\x10LlmModelSettings\x12\r\n\x05model\x18\x01 \x01(\t\x12\x13\n\x0bprompt_text\x18\x02 \x01(\tB\xba\x01\n!com.google.cloud.dialogflow.cx.v3B\x17GenerativeSettingsProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -44,6 +44,7 @@ module V3 GenerativeSettings::FallbackSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings").msgclass GenerativeSettings::FallbackSettings::PromptTemplate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate").msgclass GenerativeSettings::KnowledgeConnectorSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings").msgclass + LlmModelSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.LlmModelSettings").msgclass end end end diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generator_pb.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generator_pb.rb index 09b626859735..d058a7f513e2 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generator_pb.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generator_pb.rb @@ -8,11 +8,12 @@ require 'google/api/client_pb' require 'google/api/field_behavior_pb' require 'google/api/resource_pb' +require 'google/cloud/dialogflow/cx/v3/generative_settings_pb' require 'google/protobuf/empty_pb' require 'google/protobuf/field_mask_pb' -descriptor_data = "\n-google/cloud/dialogflow/cx/v3/generator.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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\"\xe7\x04\n\tGenerator\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12?\n\x0bprompt_text\x18\x03 \x01(\x0b\x32%.google.cloud.dialogflow.cx.v3.PhraseB\x03\xe0\x41\x02\x12O\n\x0cplaceholders\x18\x05 \x03(\x0b\x32\x34.google.cloud.dialogflow.cx.v3.Generator.PlaceholderB\x03\xe0\x41\x01\x12P\n\x0fmodel_parameter\x18\x08 \x01(\x0b\x32\x37.google.cloud.dialogflow.cx.v3.Generator.ModelParameter\x1a\'\n\x0bPlaceholder\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x1a\xaa\x01\n\x0eModelParameter\x12\x18\n\x0btemperature\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x1d\n\x10max_decode_steps\x18\x02 \x01(\x05H\x01\x88\x01\x01\x12\x12\n\x05top_p\x18\x03 \x01(\x02H\x02\x88\x01\x01\x12\x12\n\x05top_k\x18\x04 \x01(\x05H\x03\x88\x01\x01\x42\x0e\n\x0c_temperatureB\x13\n\x11_max_decode_stepsB\x08\n\x06_top_pB\x08\n\x06_top_k:w\xea\x41t\n#dialogflow.googleapis.com/Generator\x12Mprojects/{project}/locations/{location}/agents/{agent}/generators/{generator}\"\x1b\n\x06Phrase\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\x92\x01\n\x15ListGeneratorsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#dialogflow.googleapis.com/Generator\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"o\n\x16ListGeneratorsResponse\x12<\n\ngenerators\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.cx.v3.Generator\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"g\n\x13GetGeneratorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#dialogflow.googleapis.com/Generator\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\xae\x01\n\x16\x43reateGeneratorRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#dialogflow.googleapis.com/Generator\x12@\n\tgenerator\x18\x02 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.GeneratorB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"\xa2\x01\n\x16UpdateGeneratorRequest\x12@\n\tgenerator\x18\x01 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.GeneratorB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"b\n\x16\x44\x65leteGeneratorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#dialogflow.googleapis.com/Generator\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\x32\xe9\x08\n\nGenerators\x12\xc7\x01\n\x0eListGenerators\x12\x34.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest\x1a\x35.google.cloud.dialogflow.cx.v3.ListGeneratorsResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v3/{parent=projects/*/locations/*/agents/*}/generators\x12\xb4\x01\n\x0cGetGenerator\x12\x32.google.cloud.dialogflow.cx.v3.GetGeneratorRequest\x1a(.google.cloud.dialogflow.cx.v3.Generator\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\x12\x37/v3/{name=projects/*/locations/*/agents/*/generators/*}\x12\xd1\x01\n\x0f\x43reateGenerator\x12\x35.google.cloud.dialogflow.cx.v3.CreateGeneratorRequest\x1a(.google.cloud.dialogflow.cx.v3.Generator\"]\xda\x41\x10parent,generator\x82\xd3\xe4\x93\x02\x44\"7/v3/{parent=projects/*/locations/*/agents/*}/generators:\tgenerator\x12\xe0\x01\n\x0fUpdateGenerator\x12\x35.google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest\x1a(.google.cloud.dialogflow.cx.v3.Generator\"l\xda\x41\x15generator,update_mask\x82\xd3\xe4\x93\x02N2A/v3/{generator.name=projects/*/locations/*/agents/*/generators/*}:\tgenerator\x12\xa8\x01\n\x0f\x44\x65leteGenerator\x12\x35.google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest\x1a\x16.google.protobuf.Empty\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39*7/v3/{name=projects/*/locations/*/agents/*/generators/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xb1\x01\n!com.google.cloud.dialogflow.cx.v3B\x0eGeneratorProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" +descriptor_data = "\n-google/cloud/dialogflow/cx/v3/generator.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x37google/cloud/dialogflow/cx/v3/generative_settings.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xb4\x05\n\tGenerator\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12?\n\x0bprompt_text\x18\x03 \x01(\x0b\x32%.google.cloud.dialogflow.cx.v3.PhraseB\x03\xe0\x41\x02\x12O\n\x0cplaceholders\x18\x05 \x03(\x0b\x32\x34.google.cloud.dialogflow.cx.v3.Generator.PlaceholderB\x03\xe0\x41\x01\x12K\n\x12llm_model_settings\x18\t \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.LlmModelSettings\x12P\n\x0fmodel_parameter\x18\x08 \x01(\x0b\x32\x37.google.cloud.dialogflow.cx.v3.Generator.ModelParameter\x1a\'\n\x0bPlaceholder\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x1a\xaa\x01\n\x0eModelParameter\x12\x18\n\x0btemperature\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x1d\n\x10max_decode_steps\x18\x02 \x01(\x05H\x01\x88\x01\x01\x12\x12\n\x05top_p\x18\x03 \x01(\x02H\x02\x88\x01\x01\x12\x12\n\x05top_k\x18\x04 \x01(\x05H\x03\x88\x01\x01\x42\x0e\n\x0c_temperatureB\x13\n\x11_max_decode_stepsB\x08\n\x06_top_pB\x08\n\x06_top_k:w\xea\x41t\n#dialogflow.googleapis.com/Generator\x12Mprojects/{project}/locations/{location}/agents/{agent}/generators/{generator}\"\x1b\n\x06Phrase\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\x92\x01\n\x15ListGeneratorsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#dialogflow.googleapis.com/Generator\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"o\n\x16ListGeneratorsResponse\x12<\n\ngenerators\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.cx.v3.Generator\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"g\n\x13GetGeneratorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#dialogflow.googleapis.com/Generator\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\xae\x01\n\x16\x43reateGeneratorRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#dialogflow.googleapis.com/Generator\x12@\n\tgenerator\x18\x02 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.GeneratorB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"\xa2\x01\n\x16UpdateGeneratorRequest\x12@\n\tgenerator\x18\x01 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.GeneratorB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"b\n\x16\x44\x65leteGeneratorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#dialogflow.googleapis.com/Generator\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\x32\xe9\x08\n\nGenerators\x12\xc7\x01\n\x0eListGenerators\x12\x34.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest\x1a\x35.google.cloud.dialogflow.cx.v3.ListGeneratorsResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v3/{parent=projects/*/locations/*/agents/*}/generators\x12\xb4\x01\n\x0cGetGenerator\x12\x32.google.cloud.dialogflow.cx.v3.GetGeneratorRequest\x1a(.google.cloud.dialogflow.cx.v3.Generator\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\x12\x37/v3/{name=projects/*/locations/*/agents/*/generators/*}\x12\xd1\x01\n\x0f\x43reateGenerator\x12\x35.google.cloud.dialogflow.cx.v3.CreateGeneratorRequest\x1a(.google.cloud.dialogflow.cx.v3.Generator\"]\xda\x41\x10parent,generator\x82\xd3\xe4\x93\x02\x44\"7/v3/{parent=projects/*/locations/*/agents/*}/generators:\tgenerator\x12\xe0\x01\n\x0fUpdateGenerator\x12\x35.google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest\x1a(.google.cloud.dialogflow.cx.v3.Generator\"l\xda\x41\x15generator,update_mask\x82\xd3\xe4\x93\x02N2A/v3/{generator.name=projects/*/locations/*/agents/*/generators/*}:\tgenerator\x12\xa8\x01\n\x0f\x44\x65leteGenerator\x12\x35.google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest\x1a\x16.google.protobuf.Empty\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39*7/v3/{name=projects/*/locations/*/agents/*/generators/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xb1\x01\n!com.google.cloud.dialogflow.cx.v3B\x0eGeneratorProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -27,6 +28,7 @@ file = pool.add_serialized_file(serialized) warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" imports = [ + ["google.cloud.dialogflow.cx.v3.LlmModelSettings", "google/cloud/dialogflow/cx/v3/generative_settings.proto"], ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], ] imports.each do |type_name, expected_filename| diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/page_pb.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/page_pb.rb index 9db59f1cfdb6..1ae09710a286 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/page_pb.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/page_pb.rb @@ -16,7 +16,7 @@ require 'google/protobuf/struct_pb' -descriptor_data = "\n(google/cloud/dialogflow/cx/v3/page.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/advanced_settings.proto\x1a\x39google/cloud/dialogflow/cx/v3/data_store_connection.proto\x1a/google/cloud/dialogflow/cx/v3/fulfillment.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xcd\x05\n\x04Page\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x13 \x01(\t\x12\x45\n\x11\x65ntry_fulfillment\x18\x07 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.Fulfillment\x12\x31\n\x04\x66orm\x18\x04 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.Form\x12T\n\x17transition_route_groups\x18\x0b \x03(\tB3\xfa\x41\x30\n.dialogflow.googleapis.com/TransitionRouteGroup\x12I\n\x11transition_routes\x18\t \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.TransitionRoute\x12\x43\n\x0e\x65vent_handlers\x18\n \x03(\x0b\x32+.google.cloud.dialogflow.cx.v3.EventHandler\x12J\n\x11\x61\x64vanced_settings\x18\r \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x12\x64\n\x1cknowledge_connector_settings\x18\x12 \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettingsB\x03\xe0\x41\x01:u\xea\x41r\n\x1e\x64ialogflow.googleapis.com/Page\x12Pprojects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}\"\xef\x04\n\x04\x46orm\x12\x41\n\nparameters\x18\x01 \x03(\x0b\x32-.google.cloud.dialogflow.cx.v3.Form.Parameter\x1a\xa3\x04\n\tParameter\x12\x19\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x08required\x18\x02 \x01(\x08\x12\x41\n\x0b\x65ntity_type\x18\x03 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/EntityType\x12\x0f\n\x07is_list\x18\x04 \x01(\x08\x12V\n\rfill_behavior\x18\x07 \x01(\x0b\x32:.google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehaviorB\x03\xe0\x41\x02\x12-\n\rdefault_value\x18\t \x01(\x0b\x32\x16.google.protobuf.Value\x12\x0e\n\x06redact\x18\x0b \x01(\x08\x12J\n\x11\x61\x64vanced_settings\x18\x0c \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x1a\xb1\x01\n\x0c\x46illBehavior\x12S\n\x1ainitial_prompt_fulfillment\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.FulfillmentB\x03\xe0\x41\x02\x12L\n\x17reprompt_event_handlers\x18\x05 \x03(\x0b\x32+.google.cloud.dialogflow.cx.v3.EventHandler\"\x80\x02\n\x0c\x45ventHandler\x12\x11\n\x04name\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05\x65vent\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12G\n\x13trigger_fulfillment\x18\x05 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.Fulfillment\x12:\n\x0btarget_page\x18\x02 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/PageH\x00\x12:\n\x0btarget_flow\x18\x03 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/FlowH\x00\x42\x08\n\x06target\"\xd3\x02\n\x0fTransitionRoute\x12\x11\n\x04name\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12\x35\n\x06intent\x18\x01 \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/Intent\x12\x11\n\tcondition\x18\x02 \x01(\t\x12G\n\x13trigger_fulfillment\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.Fulfillment\x12:\n\x0btarget_page\x18\x04 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/PageH\x00\x12:\n\x0btarget_flow\x18\x05 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/FlowH\x00\x42\x08\n\x06target\"\x88\x01\n\x10ListPagesRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Page\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"`\n\x11ListPagesResponse\x12\x32\n\x05pages\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.cx.v3.Page\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"]\n\x0eGetPageRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Page\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\x9a\x01\n\x11\x43reatePageRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Page\x12\x36\n\x04page\x18\x02 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.PageB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"\x93\x01\n\x11UpdatePageRequest\x12\x36\n\x04page\x18\x01 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.PageB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"X\n\x11\x44\x65letePageRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Page\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\"\xd1\x02\n\x1aKnowledgeConnectorSettings\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12G\n\x13trigger_fulfillment\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.Fulfillment\x12:\n\x0btarget_page\x18\x04 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/PageH\x00\x12:\n\x0btarget_flow\x18\x05 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/FlowH\x00\x12W\n\x16\x64\x61ta_store_connections\x18\x06 \x03(\x0b\x32\x32.google.cloud.dialogflow.cx.v3.DataStoreConnectionB\x03\xe0\x41\x01\x42\x08\n\x06target2\x94\x08\n\x05Pages\x12\xbb\x01\n\tListPages\x12/.google.cloud.dialogflow.cx.v3.ListPagesRequest\x1a\x30.google.cloud.dialogflow.cx.v3.ListPagesResponse\"K\xda\x41\x06parent\x82\xd3\xe4\x93\x02<\x12:/v3/{parent=projects/*/locations/*/agents/*/flows/*}/pages\x12\xa8\x01\n\x07GetPage\x12-.google.cloud.dialogflow.cx.v3.GetPageRequest\x1a#.google.cloud.dialogflow.cx.v3.Page\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\x12:/v3/{name=projects/*/locations/*/agents/*/flows/*/pages/*}\x12\xbb\x01\n\nCreatePage\x12\x30.google.cloud.dialogflow.cx.v3.CreatePageRequest\x1a#.google.cloud.dialogflow.cx.v3.Page\"V\xda\x41\x0bparent,page\x82\xd3\xe4\x93\x02\x42\":/v3/{parent=projects/*/locations/*/agents/*/flows/*}/pages:\x04page\x12\xc5\x01\n\nUpdatePage\x12\x30.google.cloud.dialogflow.cx.v3.UpdatePageRequest\x1a#.google.cloud.dialogflow.cx.v3.Page\"`\xda\x41\x10page,update_mask\x82\xd3\xe4\x93\x02G2?/v3/{page.name=projects/*/locations/*/agents/*/flows/*/pages/*}:\x04page\x12\xa1\x01\n\nDeletePage\x12\x30.google.cloud.dialogflow.cx.v3.DeletePageRequest\x1a\x16.google.protobuf.Empty\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<*:/v3/{name=projects/*/locations/*/agents/*/flows/*/pages/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xac\x01\n!com.google.cloud.dialogflow.cx.v3B\tPageProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" +descriptor_data = "\n(google/cloud/dialogflow/cx/v3/page.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/advanced_settings.proto\x1a\x39google/cloud/dialogflow/cx/v3/data_store_connection.proto\x1a/google/cloud/dialogflow/cx/v3/fulfillment.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xcd\x05\n\x04Page\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x13 \x01(\t\x12\x45\n\x11\x65ntry_fulfillment\x18\x07 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.Fulfillment\x12\x31\n\x04\x66orm\x18\x04 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.Form\x12T\n\x17transition_route_groups\x18\x0b \x03(\tB3\xfa\x41\x30\n.dialogflow.googleapis.com/TransitionRouteGroup\x12I\n\x11transition_routes\x18\t \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.TransitionRoute\x12\x43\n\x0e\x65vent_handlers\x18\n \x03(\x0b\x32+.google.cloud.dialogflow.cx.v3.EventHandler\x12J\n\x11\x61\x64vanced_settings\x18\r \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x12\x64\n\x1cknowledge_connector_settings\x18\x12 \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettingsB\x03\xe0\x41\x01:u\xea\x41r\n\x1e\x64ialogflow.googleapis.com/Page\x12Pprojects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}\"\xef\x04\n\x04\x46orm\x12\x41\n\nparameters\x18\x01 \x03(\x0b\x32-.google.cloud.dialogflow.cx.v3.Form.Parameter\x1a\xa3\x04\n\tParameter\x12\x19\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x08required\x18\x02 \x01(\x08\x12\x41\n\x0b\x65ntity_type\x18\x03 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/EntityType\x12\x0f\n\x07is_list\x18\x04 \x01(\x08\x12V\n\rfill_behavior\x18\x07 \x01(\x0b\x32:.google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehaviorB\x03\xe0\x41\x02\x12-\n\rdefault_value\x18\t \x01(\x0b\x32\x16.google.protobuf.Value\x12\x0e\n\x06redact\x18\x0b \x01(\x08\x12J\n\x11\x61\x64vanced_settings\x18\x0c \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x1a\xb1\x01\n\x0c\x46illBehavior\x12S\n\x1ainitial_prompt_fulfillment\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.FulfillmentB\x03\xe0\x41\x02\x12L\n\x17reprompt_event_handlers\x18\x05 \x03(\x0b\x32+.google.cloud.dialogflow.cx.v3.EventHandler\"\xc4\x02\n\x0c\x45ventHandler\x12\x11\n\x04name\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05\x65vent\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12G\n\x13trigger_fulfillment\x18\x05 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.Fulfillment\x12:\n\x0btarget_page\x18\x02 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/PageH\x00\x12:\n\x0btarget_flow\x18\x03 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/FlowH\x00\x12\x42\n\x0ftarget_playbook\x18\x07 \x01(\tB\'\xfa\x41$\n\"dialogflow.googleapis.com/PlaybookH\x00\x42\x08\n\x06target\"\xd3\x02\n\x0fTransitionRoute\x12\x11\n\x04name\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12\x35\n\x06intent\x18\x01 \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/Intent\x12\x11\n\tcondition\x18\x02 \x01(\t\x12G\n\x13trigger_fulfillment\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.Fulfillment\x12:\n\x0btarget_page\x18\x04 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/PageH\x00\x12:\n\x0btarget_flow\x18\x05 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/FlowH\x00\x42\x08\n\x06target\"\x88\x01\n\x10ListPagesRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Page\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"`\n\x11ListPagesResponse\x12\x32\n\x05pages\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.cx.v3.Page\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"]\n\x0eGetPageRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Page\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\x9a\x01\n\x11\x43reatePageRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Page\x12\x36\n\x04page\x18\x02 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.PageB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"\x93\x01\n\x11UpdatePageRequest\x12\x36\n\x04page\x18\x01 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.PageB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"X\n\x11\x44\x65letePageRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Page\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\"\xd1\x02\n\x1aKnowledgeConnectorSettings\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12G\n\x13trigger_fulfillment\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.Fulfillment\x12:\n\x0btarget_page\x18\x04 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/PageH\x00\x12:\n\x0btarget_flow\x18\x05 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/FlowH\x00\x12W\n\x16\x64\x61ta_store_connections\x18\x06 \x03(\x0b\x32\x32.google.cloud.dialogflow.cx.v3.DataStoreConnectionB\x03\xe0\x41\x01\x42\x08\n\x06target2\x94\x08\n\x05Pages\x12\xbb\x01\n\tListPages\x12/.google.cloud.dialogflow.cx.v3.ListPagesRequest\x1a\x30.google.cloud.dialogflow.cx.v3.ListPagesResponse\"K\xda\x41\x06parent\x82\xd3\xe4\x93\x02<\x12:/v3/{parent=projects/*/locations/*/agents/*/flows/*}/pages\x12\xa8\x01\n\x07GetPage\x12-.google.cloud.dialogflow.cx.v3.GetPageRequest\x1a#.google.cloud.dialogflow.cx.v3.Page\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\x12:/v3/{name=projects/*/locations/*/agents/*/flows/*/pages/*}\x12\xbb\x01\n\nCreatePage\x12\x30.google.cloud.dialogflow.cx.v3.CreatePageRequest\x1a#.google.cloud.dialogflow.cx.v3.Page\"V\xda\x41\x0bparent,page\x82\xd3\xe4\x93\x02\x42\":/v3/{parent=projects/*/locations/*/agents/*/flows/*}/pages:\x04page\x12\xc5\x01\n\nUpdatePage\x12\x30.google.cloud.dialogflow.cx.v3.UpdatePageRequest\x1a#.google.cloud.dialogflow.cx.v3.Page\"`\xda\x41\x10page,update_mask\x82\xd3\xe4\x93\x02G2?/v3/{page.name=projects/*/locations/*/agents/*/flows/*/pages/*}:\x04page\x12\xa1\x01\n\nDeletePage\x12\x30.google.cloud.dialogflow.cx.v3.DeletePageRequest\x1a\x16.google.protobuf.Empty\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<*:/v3/{name=projects/*/locations/*/agents/*/flows/*/pages/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xac\x01\n!com.google.cloud.dialogflow.cx.v3B\tPageProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/paths.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/paths.rb index d40ec9c4da31..3bae2f305f95 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/paths.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/paths.rb @@ -132,6 +132,48 @@ def page_path project:, location:, agent:, flow:, page: "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/pages/#{page}" end + ## + # Create a fully-qualified Playbook resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param playbook [String] + # + # @return [::String] + def playbook_path project:, location:, agent:, playbook: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}" + end + + ## + # Create a fully-qualified Tool resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param tool [String] + # + # @return [::String] + def tool_path project:, location:, agent:, tool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/tools/#{tool}" + end + ## # Create a fully-qualified TransitionRouteGroup resource string. # diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/parameter_definition_pb.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/parameter_definition_pb.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/parameter_definition_pb.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/parameter_definition_pb.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbook_pb.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbook_pb.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbook_pb.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbook_pb.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbook_services_pb.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbook_services_pb.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbook_services_pb.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbook_services_pb.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/client.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/client.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/client.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/credentials.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/credentials.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/credentials.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/credentials.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/operations.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/operations.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/operations.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/operations.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/paths.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/paths.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/paths.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/paths.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/client.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/client.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/client.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/operations.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/operations.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/operations.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/operations.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/service_stub.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/service_stub.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/service_stub.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/playbooks/rest/service_stub.rb diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/response_message_pb.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/response_message_pb.rb index b81503f904f2..7457aceacf3b 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/response_message_pb.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/response_message_pb.rb @@ -5,10 +5,11 @@ require 'google/protobuf' require 'google/api/field_behavior_pb' +require 'google/cloud/dialogflow/cx/v3/tool_call_pb' require 'google/protobuf/struct_pb' -descriptor_data = "\n4google/cloud/dialogflow/cx/v3/response_message.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xf1\r\n\x0fResponseMessage\x12\x43\n\x04text\x18\x01 \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.ResponseMessage.TextH\x00\x12*\n\x07payload\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x12\x62\n\x14\x63onversation_success\x18\t \x01(\x0b\x32\x42.google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccessH\x00\x12[\n\x11output_audio_text\x18\x08 \x01(\x0b\x32>.google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioTextH\x00\x12]\n\x12live_agent_handoff\x18\n \x01(\x0b\x32?.google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoffH\x00\x12]\n\x0f\x65nd_interaction\x18\x0b \x01(\x0b\x32=.google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteractionB\x03\xe0\x41\x03H\x00\x12N\n\nplay_audio\x18\x0c \x01(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudioH\x00\x12U\n\x0bmixed_audio\x18\r \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudioB\x03\xe0\x41\x03H\x00\x12g\n\x17telephony_transfer_call\x18\x12 \x01(\x0b\x32\x44.google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCallH\x00\x12_\n\x13knowledge_info_card\x18\x14 \x01(\x0b\x32@.google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCardH\x00\x12R\n\rresponse_type\x18\x04 \x01(\x0e\x32;.google.cloud.dialogflow.cx.v3.ResponseMessage.ResponseType\x12\x0f\n\x07\x63hannel\x18\x13 \x01(\t\x1a\x43\n\x04Text\x12\x11\n\x04text\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12(\n\x1b\x61llow_playback_interruption\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03\x1a=\n\x10LiveAgentHandoff\x12)\n\x08metadata\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a@\n\x13\x43onversationSuccess\x12)\n\x08metadata\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a\x65\n\x0fOutputAudioText\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x0e\n\x04ssml\x18\x02 \x01(\tH\x00\x12(\n\x1b\x61llow_playback_interruption\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03\x42\x08\n\x06source\x1a\x10\n\x0e\x45ndInteraction\x1aM\n\tPlayAudio\x12\x16\n\taudio_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12(\n\x1b\x61llow_playback_interruption\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03\x1a\xc1\x01\n\nMixedAudio\x12S\n\x08segments\x18\x01 \x03(\x0b\x32\x41.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment\x1a^\n\x07Segment\x12\x0f\n\x05\x61udio\x18\x01 \x01(\x0cH\x00\x12\r\n\x03uri\x18\x02 \x01(\tH\x00\x12(\n\x1b\x61llow_playback_interruption\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03\x42\t\n\x07\x63ontent\x1a;\n\x15TelephonyTransferCall\x12\x16\n\x0cphone_number\x18\x01 \x01(\tH\x00\x42\n\n\x08\x65ndpoint\x1a\x13\n\x11KnowledgeInfoCard\"i\n\x0cResponseType\x12\x1d\n\x19RESPONSE_TYPE_UNSPECIFIED\x10\x00\x12\x10\n\x0c\x45NTRY_PROMPT\x10\x01\x12\x14\n\x10PARAMETER_PROMPT\x10\x02\x12\x12\n\x0eHANDLER_PROMPT\x10\x03\x42\t\n\x07messageB\xb7\x01\n!com.google.cloud.dialogflow.cx.v3B\x14ResponseMessageProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" +descriptor_data = "\n4google/cloud/dialogflow/cx/v3/response_message.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a-google/cloud/dialogflow/cx/v3/tool_call.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xaf\x0e\n\x0fResponseMessage\x12\x43\n\x04text\x18\x01 \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.ResponseMessage.TextH\x00\x12*\n\x07payload\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x12\x62\n\x14\x63onversation_success\x18\t \x01(\x0b\x32\x42.google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccessH\x00\x12[\n\x11output_audio_text\x18\x08 \x01(\x0b\x32>.google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioTextH\x00\x12]\n\x12live_agent_handoff\x18\n \x01(\x0b\x32?.google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoffH\x00\x12]\n\x0f\x65nd_interaction\x18\x0b \x01(\x0b\x32=.google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteractionB\x03\xe0\x41\x03H\x00\x12N\n\nplay_audio\x18\x0c \x01(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudioH\x00\x12U\n\x0bmixed_audio\x18\r \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudioB\x03\xe0\x41\x03H\x00\x12g\n\x17telephony_transfer_call\x18\x12 \x01(\x0b\x32\x44.google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCallH\x00\x12_\n\x13knowledge_info_card\x18\x14 \x01(\x0b\x32@.google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCardH\x00\x12<\n\ttool_call\x18\x16 \x01(\x0b\x32\'.google.cloud.dialogflow.cx.v3.ToolCallH\x00\x12R\n\rresponse_type\x18\x04 \x01(\x0e\x32;.google.cloud.dialogflow.cx.v3.ResponseMessage.ResponseType\x12\x0f\n\x07\x63hannel\x18\x13 \x01(\t\x1a\x43\n\x04Text\x12\x11\n\x04text\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12(\n\x1b\x61llow_playback_interruption\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03\x1a=\n\x10LiveAgentHandoff\x12)\n\x08metadata\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a@\n\x13\x43onversationSuccess\x12)\n\x08metadata\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a\x65\n\x0fOutputAudioText\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x0e\n\x04ssml\x18\x02 \x01(\tH\x00\x12(\n\x1b\x61llow_playback_interruption\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03\x42\x08\n\x06source\x1a\x10\n\x0e\x45ndInteraction\x1aM\n\tPlayAudio\x12\x16\n\taudio_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12(\n\x1b\x61llow_playback_interruption\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03\x1a\xc1\x01\n\nMixedAudio\x12S\n\x08segments\x18\x01 \x03(\x0b\x32\x41.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment\x1a^\n\x07Segment\x12\x0f\n\x05\x61udio\x18\x01 \x01(\x0cH\x00\x12\r\n\x03uri\x18\x02 \x01(\tH\x00\x12(\n\x1b\x61llow_playback_interruption\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03\x42\t\n\x07\x63ontent\x1a;\n\x15TelephonyTransferCall\x12\x16\n\x0cphone_number\x18\x01 \x01(\tH\x00\x42\n\n\x08\x65ndpoint\x1a\x13\n\x11KnowledgeInfoCard\"i\n\x0cResponseType\x12\x1d\n\x19RESPONSE_TYPE_UNSPECIFIED\x10\x00\x12\x10\n\x0c\x45NTRY_PROMPT\x10\x01\x12\x14\n\x10PARAMETER_PROMPT\x10\x02\x12\x12\n\x0eHANDLER_PROMPT\x10\x03\x42\t\n\x07messageB\xb7\x01\n!com.google.cloud.dialogflow.cx.v3B\x14ResponseMessageProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -24,6 +25,7 @@ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" imports = [ ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ["google.cloud.dialogflow.cx.v3.ToolCall", "google/cloud/dialogflow/cx/v3/tool_call.proto"], ] imports.each do |type_name, expected_filename| import_file = pool.lookup(type_name).file_descriptor diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/rest.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/rest.rb index 08414f0dec05..b1db3c388e62 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/rest.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/rest.rb @@ -29,9 +29,12 @@ require "google/cloud/dialogflow/cx/v3/test_cases/rest" require "google/cloud/dialogflow/cx/v3/webhooks/rest" require "google/cloud/dialogflow/cx/v3/environments/rest" +require "google/cloud/dialogflow/cx/v3/examples/rest" require "google/cloud/dialogflow/cx/v3/experiments/rest" require "google/cloud/dialogflow/cx/v3/generators/rest" +require "google/cloud/dialogflow/cx/v3/playbooks/rest" require "google/cloud/dialogflow/cx/v3/security_settings_service/rest" +require "google/cloud/dialogflow/cx/v3/tools/rest" require "google/cloud/dialogflow/cx/v3/versions/rest" require "google/cloud/dialogflow/cx/v3/bindings_override" require "google/cloud/dialogflow/cx/v3/version" diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/safety_settings_pb.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/safety_settings_pb.rb index 9af8db320caa..5943f64c629f 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/safety_settings_pb.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/safety_settings_pb.rb @@ -7,7 +7,7 @@ require 'google/api/field_behavior_pb' -descriptor_data = "\n3google/cloud/dialogflow/cx/v3/safety_settings.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\"\x97\x01\n\x0eSafetySettings\x12L\n\x0e\x62\x61nned_phrases\x18\x01 \x03(\x0b\x32\x34.google.cloud.dialogflow.cx.v3.SafetySettings.Phrase\x1a\x37\n\x06Phrase\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\x42\xb6\x01\n!com.google.cloud.dialogflow.cx.v3B\x13SafetySettingsProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" +descriptor_data = "\n3google/cloud/dialogflow/cx/v3/safety_settings.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\"\xa0\n\n\x0eSafetySettings\x12t\n$default_banned_phrase_match_strategy\x18\x04 \x01(\x0e\x32\x41.google.cloud.dialogflow.cx.v3.SafetySettings.PhraseMatchStrategyB\x03\xe0\x41\x01\x12L\n\x0e\x62\x61nned_phrases\x18\x01 \x03(\x0b\x32\x34.google.cloud.dialogflow.cx.v3.SafetySettings.Phrase\x12T\n\x0crai_settings\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettingsB\x03\xe0\x41\x01\x12_\n\x14\x64\x65\x66\x61ult_rai_settings\x18\x03 \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettingsB\x06\xe0\x41\x01\xe0\x41\x05\x12k\n\x18prompt_security_settings\x18\x08 \x01(\x0b\x32\x44.google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettingsB\x03\xe0\x41\x01\x1a\x37\n\x06Phrase\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\x1a\xcc\x04\n\x0bRaiSettings\x12g\n\x10\x63\x61tegory_filters\x18\x03 \x03(\x0b\x32H.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilterB\x03\xe0\x41\x01\x1a\xcf\x01\n\x0e\x43\x61tegoryFilter\x12Z\n\x08\x63\x61tegory\x18\x01 \x01(\x0e\x32H.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyCategory\x12\x61\n\x0c\x66ilter_level\x18\x02 \x01(\x0e\x32K.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyFilterLevel\"w\n\x11SafetyFilterLevel\x12#\n\x1fSAFETY_FILTER_LEVEL_UNSPECIFIED\x10\x00\x12\x0e\n\nBLOCK_NONE\x10\x01\x12\r\n\tBLOCK_FEW\x10\x02\x12\x0e\n\nBLOCK_SOME\x10\x03\x12\x0e\n\nBLOCK_MOST\x10\x04\"\x88\x01\n\x0eSafetyCategory\x12\x1f\n\x1bSAFETY_CATEGORY_UNSPECIFIED\x10\x00\x12\x15\n\x11\x44\x41NGEROUS_CONTENT\x10\x01\x12\x0f\n\x0bHATE_SPEECH\x10\x02\x12\x0e\n\nHARASSMENT\x10\x03\x12\x1d\n\x19SEXUALLY_EXPLICIT_CONTENT\x10\x04\x1a=\n\x16PromptSecuritySettings\x12#\n\x16\x65nable_prompt_security\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\"_\n\x13PhraseMatchStrategy\x12%\n!PHRASE_MATCH_STRATEGY_UNSPECIFIED\x10\x00\x12\x11\n\rPARTIAL_MATCH\x10\x01\x12\x0e\n\nWORD_MATCH\x10\x02\x42\xb6\x01\n!com.google.cloud.dialogflow.cx.v3B\x13SafetySettingsProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -40,6 +40,12 @@ module CX module V3 SafetySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings").msgclass SafetySettings::Phrase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings.Phrase").msgclass + SafetySettings::RaiSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings").msgclass + SafetySettings::RaiSettings::CategoryFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter").msgclass + SafetySettings::RaiSettings::SafetyFilterLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyFilterLevel").enummodule + SafetySettings::RaiSettings::SafetyCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyCategory").enummodule + SafetySettings::PromptSecuritySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings").msgclass + SafetySettings::PhraseMatchStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings.PhraseMatchStrategy").enummodule end end end diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_pb.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_pb.rb index 5513a3339209..74b0a540997a 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_pb.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_pb.rb @@ -12,10 +12,12 @@ require 'google/cloud/dialogflow/cx/v3/audio_config_pb' require 'google/cloud/dialogflow/cx/v3/data_store_connection_pb' require 'google/cloud/dialogflow/cx/v3/flow_pb' +require 'google/cloud/dialogflow/cx/v3/generative_settings_pb' require 'google/cloud/dialogflow/cx/v3/intent_pb' require 'google/cloud/dialogflow/cx/v3/page_pb' require 'google/cloud/dialogflow/cx/v3/response_message_pb' require 'google/cloud/dialogflow/cx/v3/session_entity_type_pb' +require 'google/cloud/dialogflow/cx/v3/tool_call_pb' require 'google/protobuf/duration_pb' require 'google/protobuf/field_mask_pb' require 'google/protobuf/struct_pb' @@ -23,7 +25,7 @@ require 'google/type/latlng_pb' -descriptor_data = "\n+google/cloud/dialogflow/cx/v3/session.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/advanced_settings.proto\x1a\x30google/cloud/dialogflow/cx/v3/audio_config.proto\x1a\x39google/cloud/dialogflow/cx/v3/data_store_connection.proto\x1a(google/cloud/dialogflow/cx/v3/flow.proto\x1a*google/cloud/dialogflow/cx/v3/intent.proto\x1a(google/cloud/dialogflow/cx/v3/page.proto\x1a\x34google/cloud/dialogflow/cx/v3/response_message.proto\x1a\x37google/cloud/dialogflow/cx/v3/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\"\xd4\x02\n\x0e\x41nswerFeedback\x12I\n\x06rating\x18\x01 \x01(\x0e\x32\x34.google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingB\x03\xe0\x41\x01\x12V\n\rrating_reason\x18\x02 \x01(\x0b\x32:.google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReasonB\x03\xe0\x41\x01\x12\x1a\n\rcustom_rating\x18\x03 \x01(\tB\x03\xe0\x41\x01\x1a\x41\n\x0cRatingReason\x12\x1a\n\rreason_labels\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x15\n\x08\x66\x65\x65\x64\x62\x61\x63k\x18\x02 \x01(\tB\x03\xe0\x41\x01\"@\n\x06Rating\x12\x16\n\x12RATING_UNSPECIFIED\x10\x00\x12\r\n\tTHUMBS_UP\x10\x01\x12\x0f\n\x0bTHUMBS_DOWN\x10\x02\"\xf6\x01\n\x1bSubmitAnswerFeedbackRequest\x12:\n\x07session\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Session\x12\x18\n\x0bresponse_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12K\n\x0f\x61nswer_feedback\x18\x03 \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.AnswerFeedbackB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\xab\x02\n\x13\x44\x65tectIntentRequest\x12:\n\x07session\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Session\x12\x44\n\x0cquery_params\x18\x02 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.QueryParameters\x12\x43\n\x0bquery_input\x18\x03 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.QueryInputB\x03\xe0\x41\x02\x12M\n\x13output_audio_config\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.OutputAudioConfig\"\x8e\x03\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.cx.v3.QueryResult\x12\x14\n\x0coutput_audio\x18\x04 \x01(\x0c\x12M\n\x13output_audio_config\x18\x05 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.OutputAudioConfig\x12W\n\rresponse_type\x18\x06 \x01(\x0e\x32@.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType\x12\x1a\n\x12\x61llow_cancellation\x18\x07 \x01(\x08\"E\n\x0cResponseType\x12\x1d\n\x19RESPONSE_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PARTIAL\x10\x01\x12\t\n\x05\x46INAL\x10\x02\"\xf1\x02\n\x1cStreamingDetectIntentRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Session\x12\x44\n\x0cquery_params\x18\x02 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.QueryParameters\x12\x43\n\x0bquery_input\x18\x03 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.QueryInputB\x03\xe0\x41\x02\x12M\n\x13output_audio_config\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.OutputAudioConfig\x12\x1f\n\x17\x65nable_partial_response\x18\x05 \x01(\x08\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\"\xb2\x02\n\x1dStreamingDetectIntentResponse\x12W\n\x12recognition_result\x18\x01 \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.StreamingRecognitionResultH\x00\x12U\n\x16\x64\x65tect_intent_response\x18\x02 \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.DetectIntentResponseH\x00\x12U\n\x0e\x64\x65\x62ugging_info\x18\x04 \x01(\x0b\x32=.google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfoB\n\n\x08response\"\xb6\x03\n\x1aStreamingRecognitionResult\x12[\n\x0cmessage_type\x18\x01 \x01(\x0e\x32\x45.google.cloud.dialogflow.cx.v3.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\x11\n\tstability\x18\x06 \x01(\x02\x12G\n\x10speech_word_info\x18\x07 \x03(\x0b\x32-.google.cloud.dialogflow.cx.v3.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\"\xc2\x06\n\x0fQueryParameters\x12\x11\n\ttime_zone\x18\x01 \x01(\t\x12)\n\x0cgeo_location\x18\x02 \x01(\x0b\x32\x13.google.type.LatLng\x12N\n\x14session_entity_types\x18\x03 \x03(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.SessionEntityType\x12(\n\x07payload\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12+\n\nparameters\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x39\n\x0c\x63urrent_page\x18\x06 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Page\x12\x17\n\x0f\x64isable_webhook\x18\x07 \x01(\x08\x12$\n\x1c\x61nalyze_query_text_sentiment\x18\x08 \x01(\x08\x12[\n\x0fwebhook_headers\x18\n \x03(\x0b\x32\x42.google.cloud.dialogflow.cx.v3.QueryParameters.WebhookHeadersEntry\x12=\n\rflow_versions\x18\x0e \x03(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Version\x12\x0f\n\x07\x63hannel\x18\x0f \x01(\t\x12\x33\n\x0bsession_ttl\x18\x10 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x37\n\x11\x65nd_user_metadata\x18\x12 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12G\n\rsearch_config\x18\x14 \x01(\x0b\x32+.google.cloud.dialogflow.cx.v3.SearchConfigB\x03\xe0\x41\x01\x12\x35\n&populate_data_store_connection_signals\x18\x19 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x1a\x35\n\x13WebhookHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x9a\x01\n\x0cSearchConfig\x12\x43\n\x0b\x62oost_specs\x18\x01 \x03(\x0b\x32).google.cloud.dialogflow.cx.v3.BoostSpecsB\x03\xe0\x41\x01\x12\x45\n\x0c\x66ilter_specs\x18\x02 \x03(\x0b\x32*.google.cloud.dialogflow.cx.v3.FilterSpecsB\x03\xe0\x41\x01\"\x9b\x07\n\tBoostSpec\x12_\n\x15\x63ondition_boost_specs\x18\x01 \x03(\x0b\x32;.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpecB\x03\xe0\x41\x01\x1a\xac\x06\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\x12m\n\x12\x62oost_control_spec\x18\x04 \x01(\x0b\x32L.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpecB\x03\xe0\x41\x01\x1a\xfa\x04\n\x10\x42oostControlSpec\x12\x17\n\nfield_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12w\n\x0e\x61ttribute_type\x18\x02 \x01(\x0e\x32Z.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeTypeB\x03\xe0\x41\x01\x12\x7f\n\x12interpolation_type\x18\x03 \x01(\x0e\x32^.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationTypeB\x03\xe0\x41\x01\x12v\n\x0e\x63ontrol_points\x18\x04 \x03(\x0b\x32Y.google.cloud.dialogflow.cx.v3.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\"\x90\x01\n\nBoostSpecs\x12\x45\n\x0b\x64\x61ta_stores\x18\x01 \x03(\tB0\xe0\x41\x01\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12;\n\x04spec\x18\x02 \x03(\x0b\x32(.google.cloud.dialogflow.cx.v3.BoostSpecB\x03\xe0\x41\x01\"i\n\x0b\x46ilterSpecs\x12\x45\n\x0b\x64\x61ta_stores\x18\x01 \x03(\tB0\xe0\x41\x01\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xdb\x02\n\nQueryInput\x12\x38\n\x04text\x18\x02 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.TextInputH\x00\x12<\n\x06intent\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.IntentInputH\x00\x12:\n\x05\x61udio\x18\x05 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.AudioInputH\x00\x12:\n\x05\x65vent\x18\x06 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.EventInputH\x00\x12\x38\n\x04\x64tmf\x18\x07 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.DtmfInputH\x00\x12\x1a\n\rlanguage_code\x18\x04 \x01(\tB\x03\xe0\x41\x02\x42\x07\n\x05input\"\xae\t\n\x0bQueryResult\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12?\n\x0etrigger_intent\x18\x0b \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/IntentH\x00\x12\x14\n\ntranscript\x18\x0c \x01(\tH\x00\x12\x17\n\rtrigger_event\x18\x0e \x01(\tH\x00\x12\x38\n\x04\x64tmf\x18\x17 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.DtmfInputH\x00\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12+\n\nparameters\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\x12I\n\x11response_messages\x18\x04 \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.ResponseMessage\x12\x13\n\x0bwebhook_ids\x18\x19 \x03(\t\x12\x1d\n\x15webhook_display_names\x18\x1a \x03(\t\x12\x34\n\x11webhook_latencies\x18\x1b \x03(\x0b\x32\x19.google.protobuf.Duration\x12\x14\n\x0cwebhook_tags\x18\x1d \x03(\t\x12,\n\x10webhook_statuses\x18\r \x03(\x0b\x32\x12.google.rpc.Status\x12\x31\n\x10webhook_payloads\x18\x06 \x03(\x0b\x32\x17.google.protobuf.Struct\x12\x39\n\x0c\x63urrent_page\x18\x07 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.Page\x12\x39\n\x0c\x63urrent_flow\x18\x1f \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.Flow\x12\x39\n\x06intent\x18\x08 \x01(\x0b\x32%.google.cloud.dialogflow.cx.v3.IntentB\x02\x18\x01\x12\'\n\x1bintent_detection_confidence\x18\t \x01(\x02\x42\x02\x18\x01\x12\x33\n\x05match\x18\x0f \x01(\x0b\x32$.google.cloud.dialogflow.cx.v3.Match\x12\x30\n\x0f\x64iagnostic_info\x18\n \x01(\x0b\x32\x17.google.protobuf.Struct\x12Y\n\x19sentiment_analysis_result\x18\x11 \x01(\x0b\x32\x36.google.cloud.dialogflow.cx.v3.SentimentAnalysisResult\x12J\n\x11\x61\x64vanced_settings\x18\x15 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x12\x1d\n\x15\x61llow_answer_feedback\x18 \x01(\x08\x12\x65\n\x1d\x64\x61ta_store_connection_signals\x18# \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignalsB\x03\xe0\x41\x01\x42\x07\n\x05query\"\x1e\n\tTextInput\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\"G\n\x0bIntentInput\x12\x38\n\x06intent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n dialogflow.googleapis.com/Intent\"a\n\nAudioInput\x12\x44\n\x06\x63onfig\x18\x01 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.InputAudioConfigB\x03\xe0\x41\x02\x12\r\n\x05\x61udio\x18\x02 \x01(\x0c\"\x1b\n\nEventInput\x12\r\n\x05\x65vent\x18\x01 \x01(\t\"1\n\tDtmfInput\x12\x0e\n\x06\x64igits\x18\x01 \x01(\t\x12\x14\n\x0c\x66inish_digit\x18\x02 \x01(\t\"\x98\x03\n\x05Match\x12\x35\n\x06intent\x18\x01 \x01(\x0b\x32%.google.cloud.dialogflow.cx.v3.Intent\x12\r\n\x05\x65vent\x18\x06 \x01(\t\x12+\n\nparameters\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x16\n\x0eresolved_input\x18\x03 \x01(\t\x12\x42\n\nmatch_type\x18\x04 \x01(\x0e\x32..google.cloud.dialogflow.cx.v3.Match.MatchType\x12\x12\n\nconfidence\x18\x05 \x01(\x02\"\xab\x01\n\tMatchType\x12\x1a\n\x16MATCH_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06INTENT\x10\x01\x12\x11\n\rDIRECT_INTENT\x10\x02\x12\x15\n\x11PARAMETER_FILLING\x10\x03\x12\x0c\n\x08NO_MATCH\x10\x04\x12\x0c\n\x08NO_INPUT\x10\x05\x12\t\n\x05\x45VENT\x10\x06\x12\x17\n\x13KNOWLEDGE_CONNECTOR\x10\x08\x12\x0c\n\x08PLAYBOOK\x10\t\"\xfe\x01\n\x12MatchIntentRequest\x12:\n\x07session\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Session\x12\x44\n\x0cquery_params\x18\x02 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.QueryParameters\x12\x43\n\x0bquery_input\x18\x03 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.QueryInputB\x03\xe0\x41\x02\x12!\n\x19persist_parameter_changes\x18\x05 \x01(\x08\"\x90\x02\n\x13MatchIntentResponse\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12?\n\x0etrigger_intent\x18\x02 \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/IntentH\x00\x12\x14\n\ntranscript\x18\x03 \x01(\tH\x00\x12\x17\n\rtrigger_event\x18\x06 \x01(\tH\x00\x12\x35\n\x07matches\x18\x04 \x03(\x0b\x32$.google.cloud.dialogflow.cx.v3.Match\x12\x39\n\x0c\x63urrent_page\x18\x05 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.PageB\x07\n\x05query\"\xeb\x01\n\x14\x46ulfillIntentRequest\x12O\n\x14match_intent_request\x18\x01 \x01(\x0b\x32\x31.google.cloud.dialogflow.cx.v3.MatchIntentRequest\x12\x33\n\x05match\x18\x02 \x01(\x0b\x32$.google.cloud.dialogflow.cx.v3.Match\x12M\n\x13output_audio_config\x18\x03 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.OutputAudioConfig\"\xd3\x01\n\x15\x46ulfillIntentResponse\x12\x13\n\x0bresponse_id\x18\x01 \x01(\t\x12@\n\x0cquery_result\x18\x02 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.QueryResult\x12\x14\n\x0coutput_audio\x18\x03 \x01(\x0c\x12M\n\x13output_audio_config\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.OutputAudioConfig\";\n\x17SentimentAnalysisResult\x12\r\n\x05score\x18\x01 \x01(\x02\x12\x11\n\tmagnitude\x18\x02 \x01(\x02\x32\xfa\r\n\x08Sessions\x12\xa6\x02\n\x0c\x44\x65tectIntent\x12\x32.google.cloud.dialogflow.cx.v3.DetectIntentRequest\x1a\x33.google.cloud.dialogflow.cx.v3.DetectIntentResponse\"\xac\x01\x82\xd3\xe4\x93\x02\xa5\x01\"E/v3/{session=projects/*/locations/*/agents/*/sessions/*}:detectIntent:\x01*ZY\"T/v3/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:detectIntent:\x01*\x12\xd5\x02\n\x1bServerStreamingDetectIntent\x12\x32.google.cloud.dialogflow.cx.v3.DetectIntentRequest\x1a\x33.google.cloud.dialogflow.cx.v3.DetectIntentResponse\"\xca\x01\x82\xd3\xe4\x93\x02\xc3\x01\"T/v3/{session=projects/*/locations/*/agents/*/sessions/*}:serverStreamingDetectIntent:\x01*Zh\"c/v3/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:serverStreamingDetectIntent:\x01*0\x01\x12\x98\x01\n\x15StreamingDetectIntent\x12;.google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest\x1a<.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse\"\x00(\x01\x30\x01\x12\xa1\x02\n\x0bMatchIntent\x12\x31.google.cloud.dialogflow.cx.v3.MatchIntentRequest\x1a\x32.google.cloud.dialogflow.cx.v3.MatchIntentResponse\"\xaa\x01\x82\xd3\xe4\x93\x02\xa3\x01\"D/v3/{session=projects/*/locations/*/agents/*/sessions/*}:matchIntent:\x01*ZX\"S/v3/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:matchIntent:\x01*\x12\xd5\x02\n\rFulfillIntent\x12\x33.google.cloud.dialogflow.cx.v3.FulfillIntentRequest\x1a\x34.google.cloud.dialogflow.cx.v3.FulfillIntentResponse\"\xd8\x01\x82\xd3\xe4\x93\x02\xd1\x01\"[/v3/{match_intent_request.session=projects/*/locations/*/agents/*/sessions/*}:fulfillIntent:\x01*Zo\"j/v3/{match_intent_request.session=projects/*/locations/*/agents/*/environments/*/sessions/*}:fulfillIntent:\x01*\x12\xdb\x01\n\x14SubmitAnswerFeedback\x12:.google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest\x1a-.google.cloud.dialogflow.cx.v3.AnswerFeedback\"X\x82\xd3\xe4\x93\x02R\"M/v3/{session=projects/*/locations/*/agents/*/sessions/*}:submitAnswerFeedback:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xd0\x04\n!com.google.cloud.dialogflow.cx.v3B\x0cSessionProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3\xea\x41\xd4\x01\n!dialogflow.googleapis.com/Session\x12Iprojects/{project}/locations/{location}/agents/{agent}/sessions/{session}\x12\x64projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}\xea\x41\xc5\x01\n(discoveryengine.googleapis.com/DataStore\x12?projects/{project}/locations/{location}/dataStores/{data_store}\x12Xprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}b\x06proto3" +descriptor_data = "\n+google/cloud/dialogflow/cx/v3/session.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/advanced_settings.proto\x1a\x30google/cloud/dialogflow/cx/v3/audio_config.proto\x1a\x39google/cloud/dialogflow/cx/v3/data_store_connection.proto\x1a(google/cloud/dialogflow/cx/v3/flow.proto\x1a\x37google/cloud/dialogflow/cx/v3/generative_settings.proto\x1a*google/cloud/dialogflow/cx/v3/intent.proto\x1a(google/cloud/dialogflow/cx/v3/page.proto\x1a\x34google/cloud/dialogflow/cx/v3/response_message.proto\x1a\x37google/cloud/dialogflow/cx/v3/session_entity_type.proto\x1a-google/cloud/dialogflow/cx/v3/tool_call.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\"\xd4\x02\n\x0e\x41nswerFeedback\x12I\n\x06rating\x18\x01 \x01(\x0e\x32\x34.google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingB\x03\xe0\x41\x01\x12V\n\rrating_reason\x18\x02 \x01(\x0b\x32:.google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReasonB\x03\xe0\x41\x01\x12\x1a\n\rcustom_rating\x18\x03 \x01(\tB\x03\xe0\x41\x01\x1a\x41\n\x0cRatingReason\x12\x1a\n\rreason_labels\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x15\n\x08\x66\x65\x65\x64\x62\x61\x63k\x18\x02 \x01(\tB\x03\xe0\x41\x01\"@\n\x06Rating\x12\x16\n\x12RATING_UNSPECIFIED\x10\x00\x12\r\n\tTHUMBS_UP\x10\x01\x12\x0f\n\x0bTHUMBS_DOWN\x10\x02\"\xf6\x01\n\x1bSubmitAnswerFeedbackRequest\x12:\n\x07session\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Session\x12\x18\n\x0bresponse_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12K\n\x0f\x61nswer_feedback\x18\x03 \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.AnswerFeedbackB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\x80\x03\n\x13\x44\x65tectIntentRequest\x12:\n\x07session\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Session\x12\x44\n\x0cquery_params\x18\x02 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.QueryParameters\x12\x43\n\x0bquery_input\x18\x03 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.QueryInputB\x03\xe0\x41\x02\x12M\n\x13output_audio_config\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.OutputAudioConfig\x12S\n\rresponse_view\x18\t \x01(\x0e\x32\x37.google.cloud.dialogflow.cx.v3.DetectIntentResponseViewB\x03\xe0\x41\x01\"\x8e\x03\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.cx.v3.QueryResult\x12\x14\n\x0coutput_audio\x18\x04 \x01(\x0c\x12M\n\x13output_audio_config\x18\x05 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.OutputAudioConfig\x12W\n\rresponse_type\x18\x06 \x01(\x0e\x32@.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType\x12\x1a\n\x12\x61llow_cancellation\x18\x07 \x01(\x08\"E\n\x0cResponseType\x12\x1d\n\x19RESPONSE_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PARTIAL\x10\x01\x12\t\n\x05\x46INAL\x10\x02\"\xc6\x03\n\x1cStreamingDetectIntentRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Session\x12\x44\n\x0cquery_params\x18\x02 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.QueryParameters\x12\x43\n\x0bquery_input\x18\x03 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.QueryInputB\x03\xe0\x41\x02\x12M\n\x13output_audio_config\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.OutputAudioConfig\x12\x1f\n\x17\x65nable_partial_response\x18\x05 \x01(\x08\x12\x1d\n\x15\x65nable_debugging_info\x18\x08 \x01(\x08\x12S\n\rresponse_view\x18\x10 \x01(\x0e\x32\x37.google.cloud.dialogflow.cx.v3.DetectIntentResponseViewB\x03\xe0\x41\x01\"\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\"\xb2\x02\n\x1dStreamingDetectIntentResponse\x12W\n\x12recognition_result\x18\x01 \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.StreamingRecognitionResultH\x00\x12U\n\x16\x64\x65tect_intent_response\x18\x02 \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.DetectIntentResponseH\x00\x12U\n\x0e\x64\x65\x62ugging_info\x18\x04 \x01(\x0b\x32=.google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfoB\n\n\x08response\"\xb6\x03\n\x1aStreamingRecognitionResult\x12[\n\x0cmessage_type\x18\x01 \x01(\x0e\x32\x45.google.cloud.dialogflow.cx.v3.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\x11\n\tstability\x18\x06 \x01(\x02\x12G\n\x10speech_word_info\x18\x07 \x03(\x0b\x32-.google.cloud.dialogflow.cx.v3.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\"\xf3\x07\n\x0fQueryParameters\x12\x11\n\ttime_zone\x18\x01 \x01(\t\x12)\n\x0cgeo_location\x18\x02 \x01(\x0b\x32\x13.google.type.LatLng\x12N\n\x14session_entity_types\x18\x03 \x03(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.SessionEntityType\x12(\n\x07payload\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12+\n\nparameters\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x17\n\x0fparameter_scope\x18\x0c \x01(\t\x12\x39\n\x0c\x63urrent_page\x18\x06 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Page\x12\x17\n\x0f\x64isable_webhook\x18\x07 \x01(\x08\x12$\n\x1c\x61nalyze_query_text_sentiment\x18\x08 \x01(\x08\x12[\n\x0fwebhook_headers\x18\n \x03(\x0b\x32\x42.google.cloud.dialogflow.cx.v3.QueryParameters.WebhookHeadersEntry\x12=\n\rflow_versions\x18\x0e \x03(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Version\x12\x44\n\x10\x63urrent_playbook\x18\x13 \x01(\tB*\xe0\x41\x01\xfa\x41$\n\"dialogflow.googleapis.com/Playbook\x12P\n\x12llm_model_settings\x18\x15 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.LlmModelSettingsB\x03\xe0\x41\x01\x12\x0f\n\x07\x63hannel\x18\x0f \x01(\t\x12\x33\n\x0bsession_ttl\x18\x10 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x37\n\x11\x65nd_user_metadata\x18\x12 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12G\n\rsearch_config\x18\x14 \x01(\x0b\x32+.google.cloud.dialogflow.cx.v3.SearchConfigB\x03\xe0\x41\x01\x12\x35\n&populate_data_store_connection_signals\x18\x19 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x1a\x35\n\x13WebhookHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x9a\x01\n\x0cSearchConfig\x12\x43\n\x0b\x62oost_specs\x18\x01 \x03(\x0b\x32).google.cloud.dialogflow.cx.v3.BoostSpecsB\x03\xe0\x41\x01\x12\x45\n\x0c\x66ilter_specs\x18\x02 \x03(\x0b\x32*.google.cloud.dialogflow.cx.v3.FilterSpecsB\x03\xe0\x41\x01\"\x9b\x07\n\tBoostSpec\x12_\n\x15\x63ondition_boost_specs\x18\x01 \x03(\x0b\x32;.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpecB\x03\xe0\x41\x01\x1a\xac\x06\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\x12m\n\x12\x62oost_control_spec\x18\x04 \x01(\x0b\x32L.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpecB\x03\xe0\x41\x01\x1a\xfa\x04\n\x10\x42oostControlSpec\x12\x17\n\nfield_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12w\n\x0e\x61ttribute_type\x18\x02 \x01(\x0e\x32Z.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeTypeB\x03\xe0\x41\x01\x12\x7f\n\x12interpolation_type\x18\x03 \x01(\x0e\x32^.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationTypeB\x03\xe0\x41\x01\x12v\n\x0e\x63ontrol_points\x18\x04 \x03(\x0b\x32Y.google.cloud.dialogflow.cx.v3.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\"\x90\x01\n\nBoostSpecs\x12\x45\n\x0b\x64\x61ta_stores\x18\x01 \x03(\tB0\xe0\x41\x01\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12;\n\x04spec\x18\x02 \x03(\x0b\x32(.google.cloud.dialogflow.cx.v3.BoostSpecB\x03\xe0\x41\x01\"i\n\x0b\x46ilterSpecs\x12\x45\n\x0b\x64\x61ta_stores\x18\x01 \x03(\tB0\xe0\x41\x01\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xa6\x03\n\nQueryInput\x12\x38\n\x04text\x18\x02 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.TextInputH\x00\x12<\n\x06intent\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.IntentInputH\x00\x12:\n\x05\x61udio\x18\x05 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.AudioInputH\x00\x12:\n\x05\x65vent\x18\x06 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.EventInputH\x00\x12\x38\n\x04\x64tmf\x18\x07 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.DtmfInputH\x00\x12I\n\x10tool_call_result\x18\x0b \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.ToolCallResultH\x00\x12\x1a\n\rlanguage_code\x18\x04 \x01(\tB\x03\xe0\x41\x02\x42\x07\n\x05input\"\xae\x08\n\x0bQueryResult\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12?\n\x0etrigger_intent\x18\x0b \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/IntentH\x00\x12\x14\n\ntranscript\x18\x0c \x01(\tH\x00\x12\x17\n\rtrigger_event\x18\x0e \x01(\tH\x00\x12\x38\n\x04\x64tmf\x18\x17 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.DtmfInputH\x00\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12+\n\nparameters\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\x12I\n\x11response_messages\x18\x04 \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.ResponseMessage\x12,\n\x10webhook_statuses\x18\r \x03(\x0b\x32\x12.google.rpc.Status\x12\x31\n\x10webhook_payloads\x18\x06 \x03(\x0b\x32\x17.google.protobuf.Struct\x12\x39\n\x0c\x63urrent_page\x18\x07 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.Page\x12\x39\n\x0c\x63urrent_flow\x18\x1f \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.Flow\x12\x39\n\x06intent\x18\x08 \x01(\x0b\x32%.google.cloud.dialogflow.cx.v3.IntentB\x02\x18\x01\x12\'\n\x1bintent_detection_confidence\x18\t \x01(\x02\x42\x02\x18\x01\x12\x33\n\x05match\x18\x0f \x01(\x0b\x32$.google.cloud.dialogflow.cx.v3.Match\x12\x30\n\x0f\x64iagnostic_info\x18\n \x01(\x0b\x32\x17.google.protobuf.Struct\x12Y\n\x19sentiment_analysis_result\x18\x11 \x01(\x0b\x32\x36.google.cloud.dialogflow.cx.v3.SentimentAnalysisResult\x12J\n\x11\x61\x64vanced_settings\x18\x15 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x12\x1d\n\x15\x61llow_answer_feedback\x18 \x01(\x08\x12\x65\n\x1d\x64\x61ta_store_connection_signals\x18# \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignalsB\x03\xe0\x41\x01\x42\x07\n\x05query\"\x1e\n\tTextInput\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\"G\n\x0bIntentInput\x12\x38\n\x06intent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n dialogflow.googleapis.com/Intent\"a\n\nAudioInput\x12\x44\n\x06\x63onfig\x18\x01 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.InputAudioConfigB\x03\xe0\x41\x02\x12\r\n\x05\x61udio\x18\x02 \x01(\x0c\"\x1b\n\nEventInput\x12\r\n\x05\x65vent\x18\x01 \x01(\t\"1\n\tDtmfInput\x12\x0e\n\x06\x64igits\x18\x01 \x01(\t\x12\x14\n\x0c\x66inish_digit\x18\x02 \x01(\t\"\x98\x03\n\x05Match\x12\x35\n\x06intent\x18\x01 \x01(\x0b\x32%.google.cloud.dialogflow.cx.v3.Intent\x12\r\n\x05\x65vent\x18\x06 \x01(\t\x12+\n\nparameters\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x16\n\x0eresolved_input\x18\x03 \x01(\t\x12\x42\n\nmatch_type\x18\x04 \x01(\x0e\x32..google.cloud.dialogflow.cx.v3.Match.MatchType\x12\x12\n\nconfidence\x18\x05 \x01(\x02\"\xab\x01\n\tMatchType\x12\x1a\n\x16MATCH_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06INTENT\x10\x01\x12\x11\n\rDIRECT_INTENT\x10\x02\x12\x15\n\x11PARAMETER_FILLING\x10\x03\x12\x0c\n\x08NO_MATCH\x10\x04\x12\x0c\n\x08NO_INPUT\x10\x05\x12\t\n\x05\x45VENT\x10\x06\x12\x17\n\x13KNOWLEDGE_CONNECTOR\x10\x08\x12\x0c\n\x08PLAYBOOK\x10\t\"\xfe\x01\n\x12MatchIntentRequest\x12:\n\x07session\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Session\x12\x44\n\x0cquery_params\x18\x02 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.QueryParameters\x12\x43\n\x0bquery_input\x18\x03 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.QueryInputB\x03\xe0\x41\x02\x12!\n\x19persist_parameter_changes\x18\x05 \x01(\x08\"\x90\x02\n\x13MatchIntentResponse\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12?\n\x0etrigger_intent\x18\x02 \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/IntentH\x00\x12\x14\n\ntranscript\x18\x03 \x01(\tH\x00\x12\x17\n\rtrigger_event\x18\x06 \x01(\tH\x00\x12\x35\n\x07matches\x18\x04 \x03(\x0b\x32$.google.cloud.dialogflow.cx.v3.Match\x12\x39\n\x0c\x63urrent_page\x18\x05 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.PageB\x07\n\x05query\"\xeb\x01\n\x14\x46ulfillIntentRequest\x12O\n\x14match_intent_request\x18\x01 \x01(\x0b\x32\x31.google.cloud.dialogflow.cx.v3.MatchIntentRequest\x12\x33\n\x05match\x18\x02 \x01(\x0b\x32$.google.cloud.dialogflow.cx.v3.Match\x12M\n\x13output_audio_config\x18\x03 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.OutputAudioConfig\"\xd3\x01\n\x15\x46ulfillIntentResponse\x12\x13\n\x0bresponse_id\x18\x01 \x01(\t\x12@\n\x0cquery_result\x18\x02 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.QueryResult\x12\x14\n\x0coutput_audio\x18\x03 \x01(\x0c\x12M\n\x13output_audio_config\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.OutputAudioConfig\";\n\x17SentimentAnalysisResult\x12\r\n\x05score\x18\x01 \x01(\x02\x12\x11\n\tmagnitude\x18\x02 \x01(\x02*\xbd\x01\n\x18\x44\x65tectIntentResponseView\x12+\n\'DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED\x10\x00\x12$\n DETECT_INTENT_RESPONSE_VIEW_FULL\x10\x01\x12%\n!DETECT_INTENT_RESPONSE_VIEW_BASIC\x10\x02\x12\'\n#DETECT_INTENT_RESPONSE_VIEW_DEFAULT\x10\x03\x32\xfa\r\n\x08Sessions\x12\xa6\x02\n\x0c\x44\x65tectIntent\x12\x32.google.cloud.dialogflow.cx.v3.DetectIntentRequest\x1a\x33.google.cloud.dialogflow.cx.v3.DetectIntentResponse\"\xac\x01\x82\xd3\xe4\x93\x02\xa5\x01\"E/v3/{session=projects/*/locations/*/agents/*/sessions/*}:detectIntent:\x01*ZY\"T/v3/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:detectIntent:\x01*\x12\xd5\x02\n\x1bServerStreamingDetectIntent\x12\x32.google.cloud.dialogflow.cx.v3.DetectIntentRequest\x1a\x33.google.cloud.dialogflow.cx.v3.DetectIntentResponse\"\xca\x01\x82\xd3\xe4\x93\x02\xc3\x01\"T/v3/{session=projects/*/locations/*/agents/*/sessions/*}:serverStreamingDetectIntent:\x01*Zh\"c/v3/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:serverStreamingDetectIntent:\x01*0\x01\x12\x98\x01\n\x15StreamingDetectIntent\x12;.google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest\x1a<.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse\"\x00(\x01\x30\x01\x12\xa1\x02\n\x0bMatchIntent\x12\x31.google.cloud.dialogflow.cx.v3.MatchIntentRequest\x1a\x32.google.cloud.dialogflow.cx.v3.MatchIntentResponse\"\xaa\x01\x82\xd3\xe4\x93\x02\xa3\x01\"D/v3/{session=projects/*/locations/*/agents/*/sessions/*}:matchIntent:\x01*ZX\"S/v3/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:matchIntent:\x01*\x12\xd5\x02\n\rFulfillIntent\x12\x33.google.cloud.dialogflow.cx.v3.FulfillIntentRequest\x1a\x34.google.cloud.dialogflow.cx.v3.FulfillIntentResponse\"\xd8\x01\x82\xd3\xe4\x93\x02\xd1\x01\"[/v3/{match_intent_request.session=projects/*/locations/*/agents/*/sessions/*}:fulfillIntent:\x01*Zo\"j/v3/{match_intent_request.session=projects/*/locations/*/agents/*/environments/*/sessions/*}:fulfillIntent:\x01*\x12\xdb\x01\n\x14SubmitAnswerFeedback\x12:.google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest\x1a-.google.cloud.dialogflow.cx.v3.AnswerFeedback\"X\x82\xd3\xe4\x93\x02R\"M/v3/{session=projects/*/locations/*/agents/*/sessions/*}:submitAnswerFeedback:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xd0\x04\n!com.google.cloud.dialogflow.cx.v3B\x0cSessionProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3\xea\x41\xd4\x01\n!dialogflow.googleapis.com/Session\x12Iprojects/{project}/locations/{location}/agents/{agent}/sessions/{session}\x12\x64projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}\xea\x41\xc5\x01\n(discoveryengine.googleapis.com/DataStore\x12?projects/{project}/locations/{location}/dataStores/{data_store}\x12Xprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -44,6 +46,8 @@ ["google.type.LatLng", "google/type/latlng.proto"], ["google.cloud.dialogflow.cx.v3.SessionEntityType", "google/cloud/dialogflow/cx/v3/session_entity_type.proto"], ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ["google.cloud.dialogflow.cx.v3.LlmModelSettings", "google/cloud/dialogflow/cx/v3/generative_settings.proto"], + ["google.cloud.dialogflow.cx.v3.ToolCallResult", "google/cloud/dialogflow/cx/v3/tool_call.proto"], ["google.cloud.dialogflow.cx.v3.ResponseMessage", "google/cloud/dialogflow/cx/v3/response_message.proto"], ["google.rpc.Status", "google/rpc/status.proto"], ["google.cloud.dialogflow.cx.v3.Page", "google/cloud/dialogflow/cx/v3/page.proto"], @@ -103,6 +107,7 @@ module V3 FulfillIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.FulfillIntentRequest").msgclass FulfillIntentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.FulfillIntentResponse").msgclass SentimentAnalysisResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SentimentAnalysisResult").msgclass + DetectIntentResponseView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DetectIntentResponseView").enummodule end end end diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb index 743a18002900..e26b8b008d32 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb @@ -237,7 +237,7 @@ def logger # @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) + # @overload detect_intent(session: nil, query_params: nil, query_input: nil, output_audio_config: nil, response_view: 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). @@ -266,6 +266,10 @@ def logger # Required. The input specification. # @param output_audio_config [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig, ::Hash] # Instructs the speech synthesizer how to generate the output audio. + # @param response_view [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponseView] + # Optional. Specifies which fields in the + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} to return. If not + # set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse] @@ -348,7 +352,7 @@ def detect_intent request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # - # @overload server_streaming_detect_intent(session: nil, query_params: nil, query_input: nil, output_audio_config: nil) + # @overload server_streaming_detect_intent(session: nil, query_params: nil, query_input: nil, output_audio_config: nil, response_view: nil) # Pass arguments to `server_streaming_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). @@ -377,6 +381,10 @@ def detect_intent request, options = nil # Required. The input specification. # @param output_audio_config [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig, ::Hash] # Instructs the speech synthesizer how to generate the output audio. + # @param response_view [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponseView] + # Optional. Specifies which fields in the + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} to return. If not + # set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Enumerable<::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse>] diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb index 5bdff70737ba..391a17d42a9e 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb @@ -135,6 +135,27 @@ def page_path project:, location:, agent:, flow:, page: "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/pages/#{page}" end + ## + # Create a fully-qualified Playbook resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param playbook [String] + # + # @return [::String] + def playbook_path project:, location:, agent:, playbook: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}" + end + ## # Create a fully-qualified Session resource string. # @@ -237,6 +258,27 @@ def session_entity_type_path **args resource.call(**args) end + ## + # Create a fully-qualified Tool resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param tool [String] + # + # @return [::String] + def tool_path project:, location:, agent:, tool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/tools/#{tool}" + end + ## # Create a fully-qualified Version resource string. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb index f312dae7ef6c..4a8650f94902 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb @@ -229,7 +229,7 @@ def logger # @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) + # @overload detect_intent(session: nil, query_params: nil, query_input: nil, output_audio_config: nil, response_view: 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). @@ -258,6 +258,10 @@ def logger # Required. The input specification. # @param output_audio_config [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig, ::Hash] # Instructs the speech synthesizer how to generate the output audio. + # @param response_view [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponseView] + # Optional. Specifies which fields in the + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} to return. If not + # set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse] # @yieldparam operation [::Gapic::Rest::TransportOperation] @@ -333,7 +337,7 @@ def detect_intent request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # - # @overload server_streaming_detect_intent(session: nil, query_params: nil, query_input: nil, output_audio_config: nil) + # @overload server_streaming_detect_intent(session: nil, query_params: nil, query_input: nil, output_audio_config: nil, response_view: nil) # Pass arguments to `server_streaming_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). @@ -362,6 +366,10 @@ def detect_intent request, options = nil # Required. The input specification. # @param output_audio_config [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig, ::Hash] # Instructs the speech synthesizer how to generate the output audio. + # @param response_view [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponseView] + # Optional. Specifies which fields in the + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} to return. If not + # set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. # @return [::Enumerable<::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb index 1dee68b10c84..ea97dd31dc3f 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb @@ -172,6 +172,27 @@ def page_path project:, location:, agent:, flow:, page: "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/pages/#{page}" end + ## + # Create a fully-qualified Playbook resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param playbook [String] + # + # @return [::String] + def playbook_path project:, location:, agent:, playbook: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}" + end + ## # Create a fully-qualified TestCase resource string. # @@ -216,6 +237,27 @@ def test_case_result_path project:, location:, agent:, test_case:, result: "projects/#{project}/locations/#{location}/agents/#{agent}/testCases/#{test_case}/results/#{result}" end + ## + # Create a fully-qualified Tool resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param tool [String] + # + # @return [::String] + def tool_path project:, location:, agent:, tool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/tools/#{tool}" + end + ## # Create a fully-qualified TransitionRouteGroup resource string. # diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_call_pb.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_call_pb.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_call_pb.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_call_pb.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_pb.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_pb.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_pb.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_pb.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_services_pb.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_services_pb.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_services_pb.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tool_services_pb.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/client.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/client.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/client.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/credentials.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/credentials.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/credentials.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/credentials.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/paths.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/paths.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/paths.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/paths.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest/client.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest/client.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest/client.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest/service_stub.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest/service_stub.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest/service_stub.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/tools/rest/service_stub.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/trace_pb.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/trace_pb.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/trace_pb.rb rename to google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/trace_pb.rb diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/paths.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/paths.rb index cac3e32eea70..73491cbee2bc 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/paths.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/paths.rb @@ -130,6 +130,27 @@ def page_path project:, location:, agent:, flow:, page: "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/pages/#{page}" end + ## + # Create a fully-qualified Tool resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agents/{agent}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param agent [String] + # @param tool [String] + # + # @return [::String] + def tool_path project:, location:, agent:, tool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agents/#{agent}/tools/#{tool}" + end + ## # Create a fully-qualified TransitionRouteGroup resource string. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb index d16eb5cadb9c..35fae2f01958 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb @@ -15,7 +15,7 @@ require 'google/protobuf/struct_pb' -descriptor_data = "\n+google/cloud/dialogflow/cx/v3/webhook.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x34google/cloud/dialogflow/cx/v3/response_message.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xce\x0e\n\x07Webhook\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12W\n\x13generic_web_service\x18\x04 \x01(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.Webhook.GenericWebServiceH\x00\x12Z\n\x11service_directory\x18\x07 \x01(\x0b\x32=.google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfigH\x00\x12*\n\x07timeout\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x10\n\x08\x64isabled\x18\x05 \x01(\x08\x1a\xf4\t\n\x11GenericWebService\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x08username\x18\x02 \x01(\tB\x02\x18\x01\x12\x14\n\x08password\x18\x03 \x01(\tB\x02\x18\x01\x12\x65\n\x0frequest_headers\x18\x04 \x03(\x0b\x32L.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.RequestHeadersEntry\x12\x1d\n\x10\x61llowed_ca_certs\x18\x05 \x03(\x0c\x42\x03\xe0\x41\x01\x12_\n\x0coauth_config\x18\x0b \x01(\x0b\x32\x44.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfigB\x03\xe0\x41\x01\x12j\n\x12service_agent_auth\x18\x0c \x01(\x0e\x32I.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAgentAuthB\x03\xe0\x41\x01\x12_\n\x0cwebhook_type\x18\x06 \x01(\x0e\x32\x44.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookTypeB\x03\xe0\x41\x01\x12]\n\x0bhttp_method\x18\x07 \x01(\x0e\x32\x43.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethodB\x03\xe0\x41\x01\x12\x19\n\x0crequest_body\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12n\n\x11parameter_mapping\x18\t \x03(\x0b\x32N.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ParameterMappingEntryB\x03\xe0\x41\x01\x1as\n\x0bOAuthConfig\x12\x16\n\tclient_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rclient_secret\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0etoken_endpoint\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06scopes\x18\x04 \x03(\tB\x03\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\x1a\x37\n\x15ParameterMappingEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"`\n\x10ServiceAgentAuth\x12\"\n\x1eSERVICE_AGENT_AUTH_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x0c\n\x08ID_TOKEN\x10\x02\x12\x10\n\x0c\x41\x43\x43\x45SS_TOKEN\x10\x03\"G\n\x0bWebhookType\x12\x1c\n\x18WEBHOOK_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x0c\n\x08\x46LEXIBLE\x10\x02\"s\n\nHttpMethod\x12\x1b\n\x17HTTP_METHOD_UNSPECIFIED\x10\x00\x12\x08\n\x04POST\x10\x01\x12\x07\n\x03GET\x10\x02\x12\x08\n\x04HEAD\x10\x03\x12\x07\n\x03PUT\x10\x04\x12\n\n\x06\x44\x45LETE\x10\x05\x12\t\n\x05PATCH\x10\x06\x12\x0b\n\x07OPTIONS\x10\x07\x1a\xb1\x01\n\x16ServiceDirectoryConfig\x12@\n\x07service\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\x12U\n\x13generic_web_service\x18\x02 \x01(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService:q\xea\x41n\n!dialogflow.googleapis.com/Webhook\x12Iprojects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}B\t\n\x07webhook\"w\n\x13ListWebhooksRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Webhook\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"i\n\x14ListWebhooksResponse\x12\x38\n\x08webhooks\x18\x01 \x03(\x0b\x32&.google.cloud.dialogflow.cx.v3.Webhook\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x11GetWebhookRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Webhook\"\x8f\x01\n\x14\x43reateWebhookRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Webhook\x12<\n\x07webhook\x18\x02 \x01(\x0b\x32&.google.cloud.dialogflow.cx.v3.WebhookB\x03\xe0\x41\x02\"\x85\x01\n\x14UpdateWebhookRequest\x12<\n\x07webhook\x18\x01 \x01(\x0b\x32&.google.cloud.dialogflow.cx.v3.WebhookB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"^\n\x14\x44\x65leteWebhookRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Webhook\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\"\xc5\n\n\x0eWebhookRequest\x12!\n\x19\x64\x65tect_intent_response_id\x18\x01 \x01(\t\x12\x0e\n\x04text\x18\n \x01(\tH\x00\x12?\n\x0etrigger_intent\x18\x0b \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/IntentH\x00\x12\x14\n\ntranscript\x18\x0c \x01(\tH\x00\x12\x17\n\rtrigger_event\x18\x0e \x01(\tH\x00\x12\x15\n\x0b\x64tmf_digits\x18\x11 \x01(\tH\x00\x12\x15\n\rlanguage_code\x18\x0f \x01(\t\x12W\n\x10\x66ulfillment_info\x18\x06 \x01(\x0b\x32=.google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo\x12M\n\x0bintent_info\x18\x03 \x01(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo\x12:\n\tpage_info\x18\x04 \x01(\x0b\x32\'.google.cloud.dialogflow.cx.v3.PageInfo\x12@\n\x0csession_info\x18\x05 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.SessionInfo\x12@\n\x08messages\x18\x07 \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.ResponseMessage\x12(\n\x07payload\x18\x08 \x01(\x0b\x32\x17.google.protobuf.Struct\x12h\n\x19sentiment_analysis_result\x18\t \x01(\x0b\x32\x45.google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult\x12\x42\n\rlanguage_info\x18\x12 \x01(\x0b\x32+.google.cloud.dialogflow.cx.v3.LanguageInfo\x1a\x1e\n\x0f\x46ulfillmentInfo\x12\x0b\n\x03tag\x18\x01 \x01(\t\x1a\xbb\x03\n\nIntentInfo\x12\x42\n\x13last_matched_intent\x18\x01 \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/Intent\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\\\n\nparameters\x18\x02 \x03(\x0b\x32H.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.ParametersEntry\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x1a^\n\x14IntentParameterValue\x12\x16\n\x0eoriginal_value\x18\x01 \x01(\t\x12.\n\x0eresolved_value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value\x1a\x80\x01\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\\\n\x05value\x18\x02 \x01(\x0b\x32M.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue:\x02\x38\x01\x1a;\n\x17SentimentAnalysisResult\x12\r\n\x05score\x18\x01 \x01(\x02\x12\x11\n\tmagnitude\x18\x02 \x01(\x02\x42\x07\n\x05query\"\xaf\x05\n\x0fWebhookResponse\x12`\n\x14\x66ulfillment_response\x18\x01 \x01(\x0b\x32\x42.google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse\x12:\n\tpage_info\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.cx.v3.PageInfo\x12@\n\x0csession_info\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.SessionInfo\x12(\n\x07payload\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12:\n\x0btarget_page\x18\x05 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/PageH\x00\x12:\n\x0btarget_flow\x18\x06 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/FlowH\x00\x1a\x8b\x02\n\x13\x46ulfillmentResponse\x12@\n\x08messages\x18\x01 \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.ResponseMessage\x12h\n\x0emerge_behavior\x18\x02 \x01(\x0e\x32P.google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.MergeBehavior\"H\n\rMergeBehavior\x12\x1e\n\x1aMERGE_BEHAVIOR_UNSPECIFIED\x10\x00\x12\n\n\x06\x41PPEND\x10\x01\x12\x0b\n\x07REPLACE\x10\x02\x42\x0c\n\ntransition\"\xb3\x04\n\x08PageInfo\x12\x39\n\x0c\x63urrent_page\x18\x01 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Page\x12\x14\n\x0c\x64isplay_name\x18\x04 \x01(\t\x12\x43\n\tform_info\x18\x03 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo\x1a\x90\x03\n\x08\x46ormInfo\x12V\n\x0eparameter_info\x18\x02 \x03(\x0b\x32>.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo\x1a\xab\x02\n\rParameterInfo\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x10\n\x08required\x18\x02 \x01(\x08\x12\\\n\x05state\x18\x03 \x01(\x0e\x32M.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.ParameterState\x12%\n\x05value\x18\x04 \x01(\x0b\x32\x16.google.protobuf.Value\x12\x16\n\x0ejust_collected\x18\x05 \x01(\x08\"U\n\x0eParameterState\x12\x1f\n\x1bPARAMETER_STATE_UNSPECIFIED\x10\x00\x12\t\n\x05\x45MPTY\x10\x01\x12\x0b\n\x07INVALID\x10\x02\x12\n\n\x06\x46ILLED\x10\x03\"\xe1\x01\n\x0bSessionInfo\x12\x37\n\x07session\x18\x01 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Session\x12N\n\nparameters\x18\x02 \x03(\x0b\x32:.google.cloud.dialogflow.cx.v3.SessionInfo.ParametersEntry\x1aI\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"e\n\x0cLanguageInfo\x12\x1b\n\x13input_language_code\x18\x01 \x01(\t\x12\x1e\n\x16resolved_language_code\x18\x02 \x01(\t\x12\x18\n\x10\x63onfidence_score\x18\x03 \x01(\x02\x32\xb7\x08\n\x08Webhooks\x12\xbf\x01\n\x0cListWebhooks\x12\x32.google.cloud.dialogflow.cx.v3.ListWebhooksRequest\x1a\x33.google.cloud.dialogflow.cx.v3.ListWebhooksResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v3/{parent=projects/*/locations/*/agents/*}/webhooks\x12\xac\x01\n\nGetWebhook\x12\x30.google.cloud.dialogflow.cx.v3.GetWebhookRequest\x1a&.google.cloud.dialogflow.cx.v3.Webhook\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v3/{name=projects/*/locations/*/agents/*/webhooks/*}\x12\xc5\x01\n\rCreateWebhook\x12\x33.google.cloud.dialogflow.cx.v3.CreateWebhookRequest\x1a&.google.cloud.dialogflow.cx.v3.Webhook\"W\xda\x41\x0eparent,webhook\x82\xd3\xe4\x93\x02@\"5/v3/{parent=projects/*/locations/*/agents/*}/webhooks:\x07webhook\x12\xd2\x01\n\rUpdateWebhook\x12\x33.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest\x1a&.google.cloud.dialogflow.cx.v3.Webhook\"d\xda\x41\x13webhook,update_mask\x82\xd3\xe4\x93\x02H2=/v3/{webhook.name=projects/*/locations/*/agents/*/webhooks/*}:\x07webhook\x12\xa2\x01\n\rDeleteWebhook\x12\x33.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest\x1a\x16.google.protobuf.Empty\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37*5/v3/{name=projects/*/locations/*/agents/*/webhooks/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xae\x02\n!com.google.cloud.dialogflow.cx.v3B\x0cWebhookProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3\xea\x41|\n\'servicedirectory.googleapis.com/Service\x12Qprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}b\x06proto3" +descriptor_data = "\n+google/cloud/dialogflow/cx/v3/webhook.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x34google/cloud/dialogflow/cx/v3/response_message.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xdc\x14\n\x07Webhook\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12W\n\x13generic_web_service\x18\x04 \x01(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.Webhook.GenericWebServiceH\x00\x12Z\n\x11service_directory\x18\x07 \x01(\x0b\x32=.google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfigH\x00\x12*\n\x07timeout\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x10\n\x08\x64isabled\x18\x05 \x01(\x08\x1a\x82\x10\n\x11GenericWebService\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x08username\x18\x02 \x01(\tB\x02\x18\x01\x12\x14\n\x08password\x18\x03 \x01(\tB\x02\x18\x01\x12`\n$secret_version_for_username_password\x18\x13 \x01(\tB2\xe0\x41\x01\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x65\n\x0frequest_headers\x18\x04 \x03(\x0b\x32L.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.RequestHeadersEntry\x12\x8f\x01\n#secret_versions_for_request_headers\x18\x14 \x03(\x0b\x32].google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionsForRequestHeadersEntryB\x03\xe0\x41\x01\x12\x1d\n\x10\x61llowed_ca_certs\x18\x05 \x03(\x0c\x42\x03\xe0\x41\x01\x12_\n\x0coauth_config\x18\x0b \x01(\x0b\x32\x44.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfigB\x03\xe0\x41\x01\x12j\n\x12service_agent_auth\x18\x0c \x01(\x0e\x32I.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAgentAuthB\x03\xe0\x41\x01\x12{\n\x1bservice_account_auth_config\x18\x12 \x01(\x0b\x32Q.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfigB\x03\xe0\x41\x01\x12_\n\x0cwebhook_type\x18\x06 \x01(\x0e\x32\x44.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookTypeB\x03\xe0\x41\x01\x12]\n\x0bhttp_method\x18\x07 \x01(\x0e\x32\x43.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethodB\x03\xe0\x41\x01\x12\x19\n\x0crequest_body\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12n\n\x11parameter_mapping\x18\t \x03(\x0b\x32N.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ParameterMappingEntryB\x03\xe0\x41\x01\x1a\x66\n\x18SecretVersionHeaderValue\x12J\n\x0esecret_version\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x1a\xd1\x01\n\x0bOAuthConfig\x12\x16\n\tclient_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rclient_secret\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\\\n secret_version_for_client_secret\x18\x05 \x01(\tB2\xe0\x41\x01\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x1b\n\x0etoken_endpoint\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06scopes\x18\x04 \x03(\tB\x03\xe0\x41\x01\x1a\x38\n\x18ServiceAccountAuthConfig\x12\x1c\n\x0fservice_account\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a\x35\n\x13RequestHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x99\x01\n$SecretVersionsForRequestHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12`\n\x05value\x18\x02 \x01(\x0b\x32Q.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue:\x02\x38\x01\x1a\x37\n\x15ParameterMappingEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"`\n\x10ServiceAgentAuth\x12\"\n\x1eSERVICE_AGENT_AUTH_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x0c\n\x08ID_TOKEN\x10\x02\x12\x10\n\x0c\x41\x43\x43\x45SS_TOKEN\x10\x03\"G\n\x0bWebhookType\x12\x1c\n\x18WEBHOOK_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x0c\n\x08\x46LEXIBLE\x10\x02\"s\n\nHttpMethod\x12\x1b\n\x17HTTP_METHOD_UNSPECIFIED\x10\x00\x12\x08\n\x04POST\x10\x01\x12\x07\n\x03GET\x10\x02\x12\x08\n\x04HEAD\x10\x03\x12\x07\n\x03PUT\x10\x04\x12\n\n\x06\x44\x45LETE\x10\x05\x12\t\n\x05PATCH\x10\x06\x12\x0b\n\x07OPTIONS\x10\x07\x1a\xb1\x01\n\x16ServiceDirectoryConfig\x12@\n\x07service\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\x12U\n\x13generic_web_service\x18\x02 \x01(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService:q\xea\x41n\n!dialogflow.googleapis.com/Webhook\x12Iprojects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}B\t\n\x07webhook\"w\n\x13ListWebhooksRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Webhook\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"i\n\x14ListWebhooksResponse\x12\x38\n\x08webhooks\x18\x01 \x03(\x0b\x32&.google.cloud.dialogflow.cx.v3.Webhook\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x11GetWebhookRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Webhook\"\x8f\x01\n\x14\x43reateWebhookRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Webhook\x12<\n\x07webhook\x18\x02 \x01(\x0b\x32&.google.cloud.dialogflow.cx.v3.WebhookB\x03\xe0\x41\x02\"\x85\x01\n\x14UpdateWebhookRequest\x12<\n\x07webhook\x18\x01 \x01(\x0b\x32&.google.cloud.dialogflow.cx.v3.WebhookB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"^\n\x14\x44\x65leteWebhookRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Webhook\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\"\xc5\n\n\x0eWebhookRequest\x12!\n\x19\x64\x65tect_intent_response_id\x18\x01 \x01(\t\x12\x0e\n\x04text\x18\n \x01(\tH\x00\x12?\n\x0etrigger_intent\x18\x0b \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/IntentH\x00\x12\x14\n\ntranscript\x18\x0c \x01(\tH\x00\x12\x17\n\rtrigger_event\x18\x0e \x01(\tH\x00\x12\x15\n\x0b\x64tmf_digits\x18\x11 \x01(\tH\x00\x12\x15\n\rlanguage_code\x18\x0f \x01(\t\x12W\n\x10\x66ulfillment_info\x18\x06 \x01(\x0b\x32=.google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo\x12M\n\x0bintent_info\x18\x03 \x01(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo\x12:\n\tpage_info\x18\x04 \x01(\x0b\x32\'.google.cloud.dialogflow.cx.v3.PageInfo\x12@\n\x0csession_info\x18\x05 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.SessionInfo\x12@\n\x08messages\x18\x07 \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.ResponseMessage\x12(\n\x07payload\x18\x08 \x01(\x0b\x32\x17.google.protobuf.Struct\x12h\n\x19sentiment_analysis_result\x18\t \x01(\x0b\x32\x45.google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult\x12\x42\n\rlanguage_info\x18\x12 \x01(\x0b\x32+.google.cloud.dialogflow.cx.v3.LanguageInfo\x1a\x1e\n\x0f\x46ulfillmentInfo\x12\x0b\n\x03tag\x18\x01 \x01(\t\x1a\xbb\x03\n\nIntentInfo\x12\x42\n\x13last_matched_intent\x18\x01 \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/Intent\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\\\n\nparameters\x18\x02 \x03(\x0b\x32H.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.ParametersEntry\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x1a^\n\x14IntentParameterValue\x12\x16\n\x0eoriginal_value\x18\x01 \x01(\t\x12.\n\x0eresolved_value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value\x1a\x80\x01\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\\\n\x05value\x18\x02 \x01(\x0b\x32M.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue:\x02\x38\x01\x1a;\n\x17SentimentAnalysisResult\x12\r\n\x05score\x18\x01 \x01(\x02\x12\x11\n\tmagnitude\x18\x02 \x01(\x02\x42\x07\n\x05query\"\xaf\x05\n\x0fWebhookResponse\x12`\n\x14\x66ulfillment_response\x18\x01 \x01(\x0b\x32\x42.google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse\x12:\n\tpage_info\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.cx.v3.PageInfo\x12@\n\x0csession_info\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.SessionInfo\x12(\n\x07payload\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12:\n\x0btarget_page\x18\x05 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/PageH\x00\x12:\n\x0btarget_flow\x18\x06 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/FlowH\x00\x1a\x8b\x02\n\x13\x46ulfillmentResponse\x12@\n\x08messages\x18\x01 \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.ResponseMessage\x12h\n\x0emerge_behavior\x18\x02 \x01(\x0e\x32P.google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.MergeBehavior\"H\n\rMergeBehavior\x12\x1e\n\x1aMERGE_BEHAVIOR_UNSPECIFIED\x10\x00\x12\n\n\x06\x41PPEND\x10\x01\x12\x0b\n\x07REPLACE\x10\x02\x42\x0c\n\ntransition\"\xb3\x04\n\x08PageInfo\x12\x39\n\x0c\x63urrent_page\x18\x01 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Page\x12\x14\n\x0c\x64isplay_name\x18\x04 \x01(\t\x12\x43\n\tform_info\x18\x03 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo\x1a\x90\x03\n\x08\x46ormInfo\x12V\n\x0eparameter_info\x18\x02 \x03(\x0b\x32>.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo\x1a\xab\x02\n\rParameterInfo\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x10\n\x08required\x18\x02 \x01(\x08\x12\\\n\x05state\x18\x03 \x01(\x0e\x32M.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.ParameterState\x12%\n\x05value\x18\x04 \x01(\x0b\x32\x16.google.protobuf.Value\x12\x16\n\x0ejust_collected\x18\x05 \x01(\x08\"U\n\x0eParameterState\x12\x1f\n\x1bPARAMETER_STATE_UNSPECIFIED\x10\x00\x12\t\n\x05\x45MPTY\x10\x01\x12\x0b\n\x07INVALID\x10\x02\x12\n\n\x06\x46ILLED\x10\x03\"\xe1\x01\n\x0bSessionInfo\x12\x37\n\x07session\x18\x01 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Session\x12N\n\nparameters\x18\x02 \x03(\x0b\x32:.google.cloud.dialogflow.cx.v3.SessionInfo.ParametersEntry\x1aI\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"e\n\x0cLanguageInfo\x12\x1b\n\x13input_language_code\x18\x01 \x01(\t\x12\x1e\n\x16resolved_language_code\x18\x02 \x01(\t\x12\x18\n\x10\x63onfidence_score\x18\x03 \x01(\x02\x32\xb7\x08\n\x08Webhooks\x12\xbf\x01\n\x0cListWebhooks\x12\x32.google.cloud.dialogflow.cx.v3.ListWebhooksRequest\x1a\x33.google.cloud.dialogflow.cx.v3.ListWebhooksResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v3/{parent=projects/*/locations/*/agents/*}/webhooks\x12\xac\x01\n\nGetWebhook\x12\x30.google.cloud.dialogflow.cx.v3.GetWebhookRequest\x1a&.google.cloud.dialogflow.cx.v3.Webhook\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v3/{name=projects/*/locations/*/agents/*/webhooks/*}\x12\xc5\x01\n\rCreateWebhook\x12\x33.google.cloud.dialogflow.cx.v3.CreateWebhookRequest\x1a&.google.cloud.dialogflow.cx.v3.Webhook\"W\xda\x41\x0eparent,webhook\x82\xd3\xe4\x93\x02@\"5/v3/{parent=projects/*/locations/*/agents/*}/webhooks:\x07webhook\x12\xd2\x01\n\rUpdateWebhook\x12\x33.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest\x1a&.google.cloud.dialogflow.cx.v3.Webhook\"d\xda\x41\x13webhook,update_mask\x82\xd3\xe4\x93\x02H2=/v3/{webhook.name=projects/*/locations/*/agents/*/webhooks/*}:\x07webhook\x12\xa2\x01\n\rDeleteWebhook\x12\x33.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest\x1a\x16.google.protobuf.Empty\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37*5/v3/{name=projects/*/locations/*/agents/*/webhooks/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xae\x02\n!com.google.cloud.dialogflow.cx.v3B\x0cWebhookProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3\xea\x41|\n\'servicedirectory.googleapis.com/Service\x12Qprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -52,7 +52,9 @@ module CX module V3 Webhook = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook").msgclass Webhook::GenericWebService = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService").msgclass + Webhook::GenericWebService::SecretVersionHeaderValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue").msgclass Webhook::GenericWebService::OAuthConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig").msgclass + Webhook::GenericWebService::ServiceAccountAuthConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig").msgclass Webhook::GenericWebService::ServiceAgentAuth = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAgentAuth").enummodule Webhook::GenericWebService::WebhookType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookType").enummodule Webhook::GenericWebService::HttpMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethod").enummodule diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/paths.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/paths.rb index 024c08271e24..f0765e01ffbb 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/paths.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/paths.rb @@ -44,6 +44,25 @@ def agent_path project:, location:, agent: "projects/#{project}/locations/#{location}/agents/#{agent}" 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. # diff --git a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb index 6aab820e25d9..8d7ce461ec9b 100644 --- a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb +++ b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb @@ -89,10 +89,27 @@ class SpeechToTextSettings # Speech recognition related settings. # @!attribute [rw] start_flow # @return [::String] - # Immutable. Name of the start flow in this agent. A start flow will be - # automatically created when the agent is created, and can only be deleted by - # deleting the agent. Format: + # Name of the start flow in this agent. A start flow will be automatically + # created when the agent is created, and can only be deleted by deleting + # the agent. + # Format: # `projects//locations//agents//flows/`. + # Currently only the default start flow with id + # "00000000-0000-0000-0000-000000000000" is allowed. + # + # Note: The following fields are mutually exclusive: `start_flow`, `start_playbook`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] start_playbook + # @return [::String] + # Name of the start playbook in this agent. A start playbook will be + # automatically created when the agent is created, and can only be deleted + # by deleting the agent. + # Format: + # `projects//locations//agents//playbooks/`. + # Currently only the + # default playbook with id + # "00000000-0000-0000-0000-000000000000" is allowed. + # + # Note: The following fields are mutually exclusive: `start_playbook`, `start_flow`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] security_settings # @return [::String] # Name of the diff --git a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb index 67d2bf54b49c..864102959bfd 100644 --- a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb +++ b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb @@ -270,6 +270,7 @@ module AudioEncoding AUDIO_ENCODING_UNSPECIFIED = 0 # Uncompressed 16-bit signed little-endian samples (Linear PCM). + # LINT: LEGACY_NAMES AUDIO_ENCODING_LINEAR_16 = 1 # [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio @@ -371,12 +372,14 @@ module OutputAudioEncoding # Uncompressed 16-bit signed little-endian samples (Linear PCM). # Audio content returned as LINEAR16 also contains a WAV header. + # LINT: LEGACY_NAMES OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1 # MP3 audio at 32kbps. OUTPUT_AUDIO_ENCODING_MP3 = 2 # MP3 audio at 64kbps. + # LINT: LEGACY_NAMES OUTPUT_AUDIO_ENCODING_MP3_64_KBPS = 4 # Opus encoded audio wrapped in an ogg container. The result will be a diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/code_block.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/code_block.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/code_block.rb rename to google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/code_block.rb diff --git a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/data_store_connection.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/data_store_connection.rb index 3509850552fb..efb7072e93bf 100644 --- a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/data_store_connection.rb +++ b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/data_store_connection.rb @@ -107,6 +107,9 @@ class RewriterModelCallSignals # @!attribute [rw] text # @return [::String] # Text included in the prompt. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Struct] + # Metadata associated with the document. class SearchSnippet include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/environment.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/environment.rb index 2442dc4de117..a56afc70811b 100644 --- a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/environment.rb +++ b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/environment.rb @@ -65,11 +65,13 @@ class Environment # Configuration for the version. # @!attribute [rw] version # @return [::String] - # Required. Both flow and playbook versions are supported. + # Required. Flow, playbook and tool versions are supported. # Format for flow version: # projects//locations//agents//flows//versions/. # Format for playbook version: # projects//locations//agents//playbooks//versions/. + # Format for tool version: + # projects//locations//agents//tools//versions/. class VersionConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/example.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/example.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/example.rb rename to google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/example.rb diff --git a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb index 6ef9a43acfcd..9e1b2ab0fbf2 100644 --- a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb +++ b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb @@ -153,6 +153,12 @@ module ModelTrainingMode # @!attribute [rw] knowledge_connector_settings # @return [::Google::Cloud::Dialogflow::CX::V3::KnowledgeConnectorSettings] # Optional. Knowledge connector configuration. + # @!attribute [rw] input_parameter_definitions + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ParameterDefinition>] + # Optional. Defined structured input parameters for this flow. + # @!attribute [rw] output_parameter_definitions + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ParameterDefinition>] + # Optional. Defined structured output parameters for this flow. # @!attribute [rw] multi_language_settings # @return [::Google::Cloud::Dialogflow::CX::V3::Flow::MultiLanguageSettings] # Optional. Multi-lingual agent settings for this flow. diff --git a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generative_settings.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generative_settings.rb index 2e808da02f72..1dbb51ea4095 100644 --- a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generative_settings.rb +++ b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generative_settings.rb @@ -39,6 +39,9 @@ module V3 # @!attribute [rw] language_code # @return [::String] # Language for this settings. + # @!attribute [rw] llm_model_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::LlmModelSettings] + # LLM model settings. class GenerativeSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -106,6 +109,18 @@ class KnowledgeConnectorSettings extend ::Google::Protobuf::MessageExts::ClassMethods end end + + # Settings for LLM models. + # @!attribute [rw] model + # @return [::String] + # The selected LLM model. + # @!attribute [rw] prompt_text + # @return [::String] + # The custom prompt to use. + class LlmModelSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end end end end diff --git a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generator.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generator.rb index 1d9fc6cc3250..55706c21fb3d 100644 --- a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generator.rb +++ b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generator.rb @@ -46,6 +46,9 @@ module V3 # @!attribute [rw] placeholders # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Generator::Placeholder>] # Optional. List of custom placeholders in the prompt text. + # @!attribute [rw] llm_model_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::LlmModelSettings] + # The LLM model settings. # @!attribute [rw] model_parameter # @return [::Google::Cloud::Dialogflow::CX::V3::Generator::ModelParameter] # Parameters passed to the LLM to configure its behavior. diff --git a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/page.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/page.rb index 2a39c3db4ee5..cffcaf016786 100644 --- a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/page.rb +++ b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/page.rb @@ -258,14 +258,21 @@ class FillBehavior # Format: # `projects//locations//agents//flows//pages/`. # - # Note: The following fields are mutually exclusive: `target_page`, `target_flow`. 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: `target_page`, `target_flow`, `target_playbook`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] target_flow # @return [::String] # The target flow to transition to. # Format: # `projects//locations//agents//flows/`. # - # Note: The following fields are mutually exclusive: `target_flow`, `target_page`. 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: `target_flow`, `target_page`, `target_playbook`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] target_playbook + # @return [::String] + # The target playbook to transition to. + # Format: + # `projects//locations//agents//playbooks/`. + # + # Note: The following fields are mutually exclusive: `target_playbook`, `target_page`, `target_flow`. If a field in that set is populated, all other fields in the set will automatically be cleared. class EventHandler include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/parameter_definition.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/parameter_definition.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/parameter_definition.rb rename to google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/parameter_definition.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/playbook.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/playbook.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/playbook.rb rename to google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/playbook.rb diff --git a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb index cd1764133b14..0b729739b30a 100644 --- a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb +++ b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb @@ -43,28 +43,28 @@ module V3 # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::Text] # Returns a text response. # - # Note: The following fields are mutually exclusive: `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`. 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: `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. 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] # Returns a response containing a custom, platform-specific payload. # - # Note: The following fields are mutually exclusive: `payload`, `text`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`. 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: `payload`, `text`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] conversation_success # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::ConversationSuccess] # Indicates that the conversation succeeded. # - # Note: The following fields are mutually exclusive: `conversation_success`, `text`, `payload`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`. 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: `conversation_success`, `text`, `payload`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] output_audio_text # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::OutputAudioText] # A text or ssml response that is preferentially used for TTS output audio # synthesis, as described in the comment on the ResponseMessage message. # - # Note: The following fields are mutually exclusive: `output_audio_text`, `text`, `payload`, `conversation_success`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`. 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: `output_audio_text`, `text`, `payload`, `conversation_success`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] live_agent_handoff # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::LiveAgentHandoff] # Hands off conversation to a human agent. # - # Note: The following fields are mutually exclusive: `live_agent_handoff`, `text`, `payload`, `conversation_success`, `output_audio_text`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`. 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: `live_agent_handoff`, `text`, `payload`, `conversation_success`, `output_audio_text`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [r] end_interaction # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::EndInteraction] # Output only. A signal that indicates the interaction with the Dialogflow @@ -74,7 +74,7 @@ module V3 # # It's guaranteed that there is at most one such message in each response. # - # Note: The following fields are mutually exclusive: `end_interaction`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`. 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: `end_interaction`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] play_audio # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::PlayAudio] # Signal that the client should play an audio clip hosted at a @@ -83,7 +83,7 @@ module V3 # However, Dialogflow itself does not try to read or process the URI in any # way. # - # Note: The following fields are mutually exclusive: `play_audio`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`. 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: `play_audio`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [r] mixed_audio # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::MixedAudio] # Output only. An audio response message composed of both the synthesized @@ -92,19 +92,25 @@ module V3 # This message is generated by Dialogflow only and not supposed to be # defined by the user. # - # Note: The following fields are mutually exclusive: `mixed_audio`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `telephony_transfer_call`, `knowledge_info_card`. 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: `mixed_audio`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] telephony_transfer_call # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::TelephonyTransferCall] # A signal that the client should transfer the phone call connected to # this agent to a third-party endpoint. # - # Note: The following fields are mutually exclusive: `telephony_transfer_call`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `knowledge_info_card`. 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: `telephony_transfer_call`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] knowledge_info_card # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::KnowledgeInfoCard] # Represents info card for knowledge answers, to be better rendered in # Dialogflow Messenger. # - # Note: The following fields are mutually exclusive: `knowledge_info_card`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`. 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: `knowledge_info_card`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] tool_call + # @return [::Google::Cloud::Dialogflow::CX::V3::ToolCall] + # Returns the definition of a tool call that should be executed by the + # client. + # + # Note: The following fields are mutually exclusive: `tool_call`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] response_type # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::ResponseType] # Response type. diff --git a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/safety_settings.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/safety_settings.rb index 2aa7c76603df..e4a1f13916af 100644 --- a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/safety_settings.rb +++ b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/safety_settings.rb @@ -23,9 +23,23 @@ module Dialogflow module CX module V3 # Settings for Generative Safety. + # @!attribute [rw] default_banned_phrase_match_strategy + # @return [::Google::Cloud::Dialogflow::CX::V3::SafetySettings::PhraseMatchStrategy] + # Optional. Default phrase match strategy for banned phrases. # @!attribute [rw] banned_phrases # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::SafetySettings::Phrase>] # Banned phrases for generated text. + # @!attribute [rw] rai_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::SafetySettings::RaiSettings] + # Optional. Settings for Responsible AI checks. + # @!attribute [rw] default_rai_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::SafetySettings::RaiSettings] + # Optional. Immutable. Default RAI settings to be annotated on the agent, so + # that users will be able to restore their RAI configurations to the default + # settings. Read-only field for the API proto only. + # @!attribute [rw] prompt_security_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::SafetySettings::PromptSecuritySettings] + # Optional. Settings for prompt security checks. class SafetySettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -41,6 +55,86 @@ class Phrase include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + + # Settings for Responsible AI. + # @!attribute [rw] category_filters + # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::SafetySettings::RaiSettings::CategoryFilter>] + # Optional. RAI blocking configurations. + class RaiSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration of the sensitivity level for blocking an RAI category. + # @!attribute [rw] category + # @return [::Google::Cloud::Dialogflow::CX::V3::SafetySettings::RaiSettings::SafetyCategory] + # RAI category to configure. + # @!attribute [rw] filter_level + # @return [::Google::Cloud::Dialogflow::CX::V3::SafetySettings::RaiSettings::SafetyFilterLevel] + # Blocking sensitivity level to configure for the RAI category. + class CategoryFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Sensitivity level for RAI categories. + module SafetyFilterLevel + # Unspecified -- uses default sensitivity levels. + SAFETY_FILTER_LEVEL_UNSPECIFIED = 0 + + # Block no text -- effectively disables the category. + BLOCK_NONE = 1 + + # Block a few suspicious texts. + BLOCK_FEW = 2 + + # Block some suspicious texts. + BLOCK_SOME = 3 + + # Block most suspicious texts. + BLOCK_MOST = 4 + end + + # RAI categories to configure. + module SafetyCategory + # Unspecified. + SAFETY_CATEGORY_UNSPECIFIED = 0 + + # Dangerous content. + DANGEROUS_CONTENT = 1 + + # Hate speech. + HATE_SPEECH = 2 + + # Harassment. + HARASSMENT = 3 + + # Sexually explicit content. + SEXUALLY_EXPLICIT_CONTENT = 4 + end + end + + # Settings for prompt security checks. + # @!attribute [rw] enable_prompt_security + # @return [::Boolean] + # Optional. Enable prompt security checks. + class PromptSecuritySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Strategy for matching phrases. + module PhraseMatchStrategy + # Unspecified, defaults to PARTIAL_MATCH. + PHRASE_MATCH_STRATEGY_UNSPECIFIED = 0 + + # Text that contains the phrase as a substring will be matched, e.g. "foo" + # will match "afoobar". + PARTIAL_MATCH = 1 + + # Text that contains the tokenized words of the phrase will be matched, + # e.g. "foo" will match "a foo bar" and "foo bar", but not "foobar". + WORD_MATCH = 2 + end end end end diff --git a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb index a57328e4b7b6..d09fe5765762 100644 --- a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb +++ b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb @@ -231,6 +231,9 @@ class SecuritySettings # @!attribute [rw] audio_export_pattern # @return [::String] # Filename pattern for exported audio. + # \\{conversation} and \\{timestamp} are placeholders that will be replaced + # with the conversation ID and epoch micros of the conversation. + # For example, "\\{conversation}/recording_\\{timestamp}.mulaw". # @!attribute [rw] enable_audio_redaction # @return [::Boolean] # Enable audio redaction if it is true. diff --git a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/session.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/session.rb index d810429ad375..01c69883951d 100644 --- a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +++ b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/session.rb @@ -116,6 +116,11 @@ class SubmitAnswerFeedbackRequest # @!attribute [rw] output_audio_config # @return [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig] # Instructs the speech synthesizer how to generate the output audio. + # @!attribute [rw] response_view + # @return [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponseView] + # Optional. Specifies which fields in the + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} to return. If not + # set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. class DetectIntentRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -243,6 +248,11 @@ module ResponseType # @!attribute [rw] enable_debugging_info # @return [::Boolean] # If true, `StreamingDetectIntentResponse.debugging_info` will get populated. + # @!attribute [rw] response_view + # @return [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponseView] + # Optional. Specifies which fields in the + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} to return. If not + # set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. class StreamingDetectIntentRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -519,6 +529,14 @@ module MessageType # * 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] parameter_scope + # @return [::String] + # Scope for the parameters. If not specified, parameters will be treated as + # session parameters. Parameters with custom scope will not be put into + # {::Google::Cloud::Dialogflow::CX::V3::SessionInfo#parameters session parameters}. + # + # You can reference the parameters with custom scope in the agent with the + # following format: $parameter-scope.params.parameter-id. # @!attribute [rw] current_page # @return [::String] # The unique identifier of the {::Google::Cloud::Dialogflow::CX::V3::Page page} to @@ -561,6 +579,18 @@ module MessageType # flow X will go through version 1 regardless of the version configuration in # the environment. Each flow can have at most one version specified in this # list. + # @!attribute [rw] current_playbook + # @return [::String] + # Optional. The unique identifier of the + # {::Google::Cloud::Dialogflow::CX::V3::Playbook playbook} to start or continue the + # session with. If `current_playbook` is specified, the previous state of the + # session will be ignored by Dialogflow. + # + # Format: + # `projects//locations//agents//playbooks/`. + # @!attribute [rw] llm_model_settings + # @return [::Google::Cloud::Dialogflow::CX::V3::LlmModelSettings] + # Optional. Use the specified LLM model settings for processing the request. # @!attribute [rw] channel # @return [::String] # The channel which this query is for. @@ -829,27 +859,32 @@ class FilterSpecs # @return [::Google::Cloud::Dialogflow::CX::V3::TextInput] # The natural language text to be processed. # - # Note: The following fields are mutually exclusive: `text`, `intent`, `audio`, `event`, `dtmf`. 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: `text`, `intent`, `audio`, `event`, `dtmf`, `tool_call_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] intent # @return [::Google::Cloud::Dialogflow::CX::V3::IntentInput] # The intent to be triggered. # - # Note: The following fields are mutually exclusive: `intent`, `text`, `audio`, `event`, `dtmf`. 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: `intent`, `text`, `audio`, `event`, `dtmf`, `tool_call_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] audio # @return [::Google::Cloud::Dialogflow::CX::V3::AudioInput] # The natural language speech audio to be processed. # - # Note: The following fields are mutually exclusive: `audio`, `text`, `intent`, `event`, `dtmf`. 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: `audio`, `text`, `intent`, `event`, `dtmf`, `tool_call_result`. 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::CX::V3::EventInput] # The event to be triggered. # - # Note: The following fields are mutually exclusive: `event`, `text`, `intent`, `audio`, `dtmf`. 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: `event`, `text`, `intent`, `audio`, `dtmf`, `tool_call_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] dtmf # @return [::Google::Cloud::Dialogflow::CX::V3::DtmfInput] # The DTMF event to be handled. # - # Note: The following fields are mutually exclusive: `dtmf`, `text`, `intent`, `audio`, `event`. 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: `dtmf`, `text`, `intent`, `audio`, `event`, `tool_call_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] tool_call_result + # @return [::Google::Cloud::Dialogflow::CX::V3::ToolCallResult] + # The results of a tool executed by the client. + # + # Note: The following fields are mutually exclusive: `tool_call_result`, `text`, `intent`, `audio`, `event`, `dtmf`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] language_code # @return [::String] # Required. The language of the input. See [Language @@ -923,18 +958,6 @@ class QueryInput # The list of rich messages returned to the client. Responses vary from # simple text messages to more sophisticated, structured payloads used # to drive complex logic. - # @!attribute [rw] webhook_ids - # @return [::Array<::String>] - # The list of webhook ids in the order of call sequence. - # @!attribute [rw] webhook_display_names - # @return [::Array<::String>] - # The list of webhook display names in the order of call sequence. - # @!attribute [rw] webhook_latencies - # @return [::Array<::Google::Protobuf::Duration>] - # The list of webhook latencies in the order of call sequence. - # @!attribute [rw] webhook_tags - # @return [::Array<::String>] - # The list of webhook tags in the order of call sequence. # @!attribute [rw] webhook_statuses # @return [::Array<::Google::Rpc::Status>] # The list of webhook call status in the order of call sequence. @@ -1161,7 +1184,8 @@ module MatchType # The query was matched to a Knowledge Connector answer. KNOWLEDGE_CONNECTOR = 8 - # The query was handled by a [`Playbook`][Playbook]. + # The query was handled by a + # {::Google::Cloud::Dialogflow::CX::V3::Playbook `Playbook`}. PLAYBOOK = 9 end end @@ -1297,6 +1321,26 @@ class SentimentAnalysisResult include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + + # The response view specifies which fields in the + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} to return. + module DetectIntentResponseView + # Not specified. `DETECT_INTENT_RESPONSE_VIEW_DEFAULT` will be used. + DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED = 0 + + # Full response view includes all fields. + DETECT_INTENT_RESPONSE_VIEW_FULL = 1 + + # Basic response view omits the following fields: + # - + # {::Google::Cloud::Dialogflow::CX::V3::QueryResult#diagnostic_info QueryResult.diagnostic_info} + DETECT_INTENT_RESPONSE_VIEW_BASIC = 2 + + # Default response view omits the following fields: + # - + # [QueryResult.trace_blocks][google.cloud.dialogflow.cx.v3.QueryResult.trace_blocks] + DETECT_INTENT_RESPONSE_VIEW_DEFAULT = 3 + end end end end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/tool.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/tool.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/tool.rb rename to google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/tool.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/tool_call.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/tool_call.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/tool_call.rb rename to google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/tool_call.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/trace.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/trace.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/trace.rb rename to google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/trace.rb diff --git a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb index ae304b319943..44d4e2e27480 100644 --- a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb +++ b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb @@ -74,9 +74,22 @@ class Webhook # @deprecated This field is deprecated and may be removed in the next major version update. # @return [::String] # The password for HTTP Basic authentication. + # @!attribute [rw] secret_version_for_username_password + # @return [::String] + # Optional. The SecretManager secret version resource storing the + # username:password pair for HTTP Basic authentication. Format: + # `projects/{project}/secrets/{secret}/versions/{version}` # @!attribute [rw] request_headers # @return [::Google::Protobuf::Map{::String => ::String}] # The HTTP request headers to send together with webhook requests. + # @!attribute [rw] secret_versions_for_request_headers + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService::SecretVersionHeaderValue}] + # Optional. The HTTP request headers to send together with webhook + # requests. Header values are stored in SecretManager secret versions. + # + # When the same header name is specified in both `request_headers` and + # `secret_versions_for_request_headers`, the value in + # `secret_versions_for_request_headers` will be used. # @!attribute [rw] allowed_ca_certs # @return [::Array<::String>] # Optional. Specifies a list of allowed custom CA certificates (in DER @@ -102,6 +115,9 @@ class Webhook # service # agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). # The generated token is sent in the Authorization header. + # @!attribute [rw] service_account_auth_config + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService::ServiceAccountAuthConfig] + # Optional. Configuration for service account authentication. # @!attribute [rw] webhook_type # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService::WebhookType] # Optional. Type of the webhook. @@ -123,6 +139,17 @@ class GenericWebService include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods + # Represents the value of an HTTP header stored in a SecretManager secret + # version. + # @!attribute [rw] secret_version + # @return [::String] + # Required. The SecretManager secret version resource storing the header + # value. Format: `projects/{project}/secrets/{secret}/versions/{version}` + class SecretVersionHeaderValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Represents configuration of OAuth client credential flow for 3rd party # API authentication. # @!attribute [rw] client_id @@ -131,6 +158,12 @@ class GenericWebService # @!attribute [rw] client_secret # @return [::String] # Optional. The client secret provided by the 3rd party platform. + # @!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 provided by the 3rd party platform to @@ -143,6 +176,23 @@ class OAuthConfig extend ::Google::Protobuf::MessageExts::ClassMethods end + # Configuration for authentication using a service account. + # @!attribute [rw] service_account + # @return [::String] + # Required. The email address of the service account used to authenticate + # the webhook call. Dialogflow uses this service account to exchange an + # access token and the access token is then sent in the `Authorization` + # header of the webhook request. + # + # The service account must have the + # `roles/iam.serviceAccountTokenCreator` role granted to the + # [Dialogflow service + # agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + class ServiceAccountAuthConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # @!attribute [rw] key # @return [::String] # @!attribute [rw] value @@ -152,6 +202,15 @@ class RequestHeadersEntry extend ::Google::Protobuf::MessageExts::ClassMethods end + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService::SecretVersionHeaderValue] + class SecretVersionsForRequestHeadersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # @!attribute [rw] key # @return [::String] # @!attribute [rw] value diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/create_example.rb b/google-cloud-dialogflow-cx-v3/snippets/examples/create_example.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/create_example.rb rename to google-cloud-dialogflow-cx-v3/snippets/examples/create_example.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/delete_example.rb b/google-cloud-dialogflow-cx-v3/snippets/examples/delete_example.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/delete_example.rb rename to google-cloud-dialogflow-cx-v3/snippets/examples/delete_example.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/get_example.rb b/google-cloud-dialogflow-cx-v3/snippets/examples/get_example.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/get_example.rb rename to google-cloud-dialogflow-cx-v3/snippets/examples/get_example.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/list_examples.rb b/google-cloud-dialogflow-cx-v3/snippets/examples/list_examples.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/list_examples.rb rename to google-cloud-dialogflow-cx-v3/snippets/examples/list_examples.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/update_example.rb b/google-cloud-dialogflow-cx-v3/snippets/examples/update_example.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/examples/update_example.rb rename to google-cloud-dialogflow-cx-v3/snippets/examples/update_example.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/create_playbook.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/create_playbook.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/create_playbook.rb rename to google-cloud-dialogflow-cx-v3/snippets/playbooks/create_playbook.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/create_playbook_version.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/create_playbook_version.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/create_playbook_version.rb rename to google-cloud-dialogflow-cx-v3/snippets/playbooks/create_playbook_version.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/delete_playbook.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/delete_playbook.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/delete_playbook.rb rename to google-cloud-dialogflow-cx-v3/snippets/playbooks/delete_playbook.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/delete_playbook_version.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/delete_playbook_version.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/delete_playbook_version.rb rename to google-cloud-dialogflow-cx-v3/snippets/playbooks/delete_playbook_version.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/export_playbook.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/export_playbook.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/export_playbook.rb rename to google-cloud-dialogflow-cx-v3/snippets/playbooks/export_playbook.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/get_playbook.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/get_playbook.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/get_playbook.rb rename to google-cloud-dialogflow-cx-v3/snippets/playbooks/get_playbook.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/get_playbook_version.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/get_playbook_version.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/get_playbook_version.rb rename to google-cloud-dialogflow-cx-v3/snippets/playbooks/get_playbook_version.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/import_playbook.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/import_playbook.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/import_playbook.rb rename to google-cloud-dialogflow-cx-v3/snippets/playbooks/import_playbook.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/list_playbook_versions.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/list_playbook_versions.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/list_playbook_versions.rb rename to google-cloud-dialogflow-cx-v3/snippets/playbooks/list_playbook_versions.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/list_playbooks.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/list_playbooks.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/list_playbooks.rb rename to google-cloud-dialogflow-cx-v3/snippets/playbooks/list_playbooks.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/restore_playbook_version.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/restore_playbook_version.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/restore_playbook_version.rb rename to google-cloud-dialogflow-cx-v3/snippets/playbooks/restore_playbook_version.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/update_playbook.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/update_playbook.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/playbooks/update_playbook.rb rename to google-cloud-dialogflow-cx-v3/snippets/playbooks/update_playbook.rb diff --git a/google-cloud-dialogflow-cx-v3/snippets/snippet_metadata_google.cloud.dialogflow.cx.v3.json b/google-cloud-dialogflow-cx-v3/snippets/snippet_metadata_google.cloud.dialogflow.cx.v3.json index 80689547016b..faec8674c364 100644 --- a/google-cloud-dialogflow-cx-v3/snippets/snippet_metadata_google.cloud.dialogflow.cx.v3.json +++ b/google-cloud-dialogflow-cx-v3/snippets/snippet_metadata_google.cloud.dialogflow.cx.v3.json @@ -3451,6 +3451,206 @@ } ] }, + { + "region_tag": "dialogflow_v3_generated_Examples_CreateExample_sync", + "title": "Snippet for the create_example call in the Examples service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Examples::Client#create_example.", + "file": "examples/create_example.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_example", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client#create_example", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreateExampleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Example", + "client": { + "short_name": "Examples::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client" + }, + "method": { + "short_name": "CreateExample", + "full_name": "google.cloud.dialogflow.cx.v3.Examples.CreateExample", + "service": { + "short_name": "Examples", + "full_name": "google.cloud.dialogflow.cx.v3.Examples" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Examples_DeleteExample_sync", + "title": "Snippet for the delete_example call in the Examples service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Examples::Client#delete_example.", + "file": "examples/delete_example.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_example", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client#delete_example", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteExampleRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Examples::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client" + }, + "method": { + "short_name": "DeleteExample", + "full_name": "google.cloud.dialogflow.cx.v3.Examples.DeleteExample", + "service": { + "short_name": "Examples", + "full_name": "google.cloud.dialogflow.cx.v3.Examples" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Examples_ListExamples_sync", + "title": "Snippet for the list_examples call in the Examples service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Examples::Client#list_examples.", + "file": "examples/list_examples.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_examples", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client#list_examples", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListExamplesResponse", + "client": { + "short_name": "Examples::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client" + }, + "method": { + "short_name": "ListExamples", + "full_name": "google.cloud.dialogflow.cx.v3.Examples.ListExamples", + "service": { + "short_name": "Examples", + "full_name": "google.cloud.dialogflow.cx.v3.Examples" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Examples_GetExample_sync", + "title": "Snippet for the get_example call in the Examples service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Examples::Client#get_example.", + "file": "examples/get_example.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_example", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client#get_example", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetExampleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Example", + "client": { + "short_name": "Examples::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client" + }, + "method": { + "short_name": "GetExample", + "full_name": "google.cloud.dialogflow.cx.v3.Examples.GetExample", + "service": { + "short_name": "Examples", + "full_name": "google.cloud.dialogflow.cx.v3.Examples" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Examples_UpdateExample_sync", + "title": "Snippet for the update_example call in the Examples service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Examples::Client#update_example.", + "file": "examples/update_example.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_example", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client#update_example", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateExampleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Example", + "client": { + "short_name": "Examples::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client" + }, + "method": { + "short_name": "UpdateExample", + "full_name": "google.cloud.dialogflow.cx.v3.Examples.UpdateExample", + "service": { + "short_name": "Examples", + "full_name": "google.cloud.dialogflow.cx.v3.Examples" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, { "region_tag": "dialogflow_v3_generated_Experiments_ListExperiments_sync", "title": "Snippet for the list_experiments call in the Experiments service", @@ -3932,32 +4132,32 @@ ] }, { - "region_tag": "dialogflow_v3_generated_SecuritySettingsService_CreateSecuritySettings_sync", - "title": "Snippet for the create_security_settings call in the SecuritySettingsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#create_security_settings.", - "file": "security_settings_service/create_security_settings.rb", + "region_tag": "dialogflow_v3_generated_Playbooks_CreatePlaybook_sync", + "title": "Snippet for the create_playbook call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#create_playbook.", + "file": "playbooks/create_playbook.rb", "language": "RUBY", "client_method": { - "short_name": "create_security_settings", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#create_security_settings", + "short_name": "create_playbook", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#create_playbook", "async": false, "parameters": [ { - "type": "::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest", + "type": "::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookRequest", "name": "request" } ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettings", + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Playbook", "client": { - "short_name": "SecuritySettingsService::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client" + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" }, "method": { - "short_name": "CreateSecuritySettings", - "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService.CreateSecuritySettings", + "short_name": "CreatePlaybook", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.CreatePlaybook", "service": { - "short_name": "SecuritySettingsService", - "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService" + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" } } }, @@ -3972,32 +4172,32 @@ ] }, { - "region_tag": "dialogflow_v3_generated_SecuritySettingsService_GetSecuritySettings_sync", - "title": "Snippet for the get_security_settings call in the SecuritySettingsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#get_security_settings.", - "file": "security_settings_service/get_security_settings.rb", + "region_tag": "dialogflow_v3_generated_Playbooks_DeletePlaybook_sync", + "title": "Snippet for the delete_playbook call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#delete_playbook.", + "file": "playbooks/delete_playbook.rb", "language": "RUBY", "client_method": { - "short_name": "get_security_settings", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#get_security_settings", + "short_name": "delete_playbook", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#delete_playbook", "async": false, "parameters": [ { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest", + "type": "::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookRequest", "name": "request" } ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettings", + "result_type": "::Google::Protobuf::Empty", "client": { - "short_name": "SecuritySettingsService::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client" + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" }, "method": { - "short_name": "GetSecuritySettings", - "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService.GetSecuritySettings", + "short_name": "DeletePlaybook", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.DeletePlaybook", "service": { - "short_name": "SecuritySettingsService", - "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService" + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" } } }, @@ -4012,32 +4212,72 @@ ] }, { - "region_tag": "dialogflow_v3_generated_SecuritySettingsService_UpdateSecuritySettings_sync", - "title": "Snippet for the update_security_settings call in the SecuritySettingsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#update_security_settings.", - "file": "security_settings_service/update_security_settings.rb", + "region_tag": "dialogflow_v3_generated_Playbooks_ListPlaybooks_sync", + "title": "Snippet for the list_playbooks call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#list_playbooks.", + "file": "playbooks/list_playbooks.rb", "language": "RUBY", "client_method": { - "short_name": "update_security_settings", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#update_security_settings", + "short_name": "list_playbooks", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#list_playbooks", "async": false, "parameters": [ { - "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest", + "type": "::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksRequest", "name": "request" } ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettings", + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksResponse", "client": { - "short_name": "SecuritySettingsService::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client" + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" }, "method": { - "short_name": "UpdateSecuritySettings", - "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService.UpdateSecuritySettings", + "short_name": "ListPlaybooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.ListPlaybooks", "service": { - "short_name": "SecuritySettingsService", - "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService" + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Playbooks_GetPlaybook_sync", + "title": "Snippet for the get_playbook call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#get_playbook.", + "file": "playbooks/get_playbook.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_playbook", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#get_playbook", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetPlaybookRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Playbook", + "client": { + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" + }, + "method": { + "short_name": "GetPlaybook", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.GetPlaybook", + "service": { + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" } } }, @@ -4052,32 +4292,32 @@ ] }, { - "region_tag": "dialogflow_v3_generated_SecuritySettingsService_ListSecuritySettings_sync", - "title": "Snippet for the list_security_settings call in the SecuritySettingsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#list_security_settings.", - "file": "security_settings_service/list_security_settings.rb", + "region_tag": "dialogflow_v3_generated_Playbooks_ExportPlaybook_sync", + "title": "Snippet for the export_playbook call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#export_playbook.", + "file": "playbooks/export_playbook.rb", "language": "RUBY", "client_method": { - "short_name": "list_security_settings", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#list_security_settings", + "short_name": "export_playbook", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#export_playbook", "async": false, "parameters": [ { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest", + "type": "::Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest", "name": "request" } ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsResponse", + "result_type": "::Google::Longrunning::Operation", "client": { - "short_name": "SecuritySettingsService::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client" + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" }, "method": { - "short_name": "ListSecuritySettings", - "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService.ListSecuritySettings", + "short_name": "ExportPlaybook", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.ExportPlaybook", "service": { - "short_name": "SecuritySettingsService", - "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService" + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" } } }, @@ -4086,38 +4326,878 @@ "segments": [ { "start": 20, - "end": 50, + "end": 53, "type": "FULL" } ] }, { - "region_tag": "dialogflow_v3_generated_SecuritySettingsService_DeleteSecuritySettings_sync", - "title": "Snippet for the delete_security_settings call in the SecuritySettingsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#delete_security_settings.", - "file": "security_settings_service/delete_security_settings.rb", + "region_tag": "dialogflow_v3_generated_Playbooks_ImportPlaybook_sync", + "title": "Snippet for the import_playbook call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#import_playbook.", + "file": "playbooks/import_playbook.rb", "language": "RUBY", "client_method": { - "short_name": "delete_security_settings", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#delete_security_settings", + "short_name": "import_playbook", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#import_playbook", "async": false, "parameters": [ { - "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest", + "type": "::Google::Cloud::Dialogflow::CX::V3::ImportPlaybookRequest", "name": "request" } ], - "result_type": "::Google::Protobuf::Empty", + "result_type": "::Google::Longrunning::Operation", "client": { - "short_name": "SecuritySettingsService::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client" + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" }, "method": { - "short_name": "DeleteSecuritySettings", - "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService.DeleteSecuritySettings", + "short_name": "ImportPlaybook", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.ImportPlaybook", "service": { - "short_name": "SecuritySettingsService", - "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService" + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Playbooks_UpdatePlaybook_sync", + "title": "Snippet for the update_playbook call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#update_playbook.", + "file": "playbooks/update_playbook.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_playbook", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#update_playbook", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdatePlaybookRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Playbook", + "client": { + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" + }, + "method": { + "short_name": "UpdatePlaybook", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.UpdatePlaybook", + "service": { + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Playbooks_CreatePlaybookVersion_sync", + "title": "Snippet for the create_playbook_version call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#create_playbook_version.", + "file": "playbooks/create_playbook_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_playbook_version", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#create_playbook_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion", + "client": { + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" + }, + "method": { + "short_name": "CreatePlaybookVersion", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.CreatePlaybookVersion", + "service": { + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Playbooks_GetPlaybookVersion_sync", + "title": "Snippet for the get_playbook_version call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#get_playbook_version.", + "file": "playbooks/get_playbook_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_playbook_version", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#get_playbook_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetPlaybookVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion", + "client": { + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" + }, + "method": { + "short_name": "GetPlaybookVersion", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.GetPlaybookVersion", + "service": { + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Playbooks_RestorePlaybookVersion_sync", + "title": "Snippet for the restore_playbook_version call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#restore_playbook_version.", + "file": "playbooks/restore_playbook_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "restore_playbook_version", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#restore_playbook_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionResponse", + "client": { + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" + }, + "method": { + "short_name": "RestorePlaybookVersion", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.RestorePlaybookVersion", + "service": { + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Playbooks_ListPlaybookVersions_sync", + "title": "Snippet for the list_playbook_versions call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#list_playbook_versions.", + "file": "playbooks/list_playbook_versions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_playbook_versions", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#list_playbook_versions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsResponse", + "client": { + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" + }, + "method": { + "short_name": "ListPlaybookVersions", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.ListPlaybookVersions", + "service": { + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Playbooks_DeletePlaybookVersion_sync", + "title": "Snippet for the delete_playbook_version call in the Playbooks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#delete_playbook_version.", + "file": "playbooks/delete_playbook_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_playbook_version", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#delete_playbook_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Playbooks::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" + }, + "method": { + "short_name": "DeletePlaybookVersion", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.DeletePlaybookVersion", + "service": { + "short_name": "Playbooks", + "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_SecuritySettingsService_CreateSecuritySettings_sync", + "title": "Snippet for the create_security_settings call in the SecuritySettingsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#create_security_settings.", + "file": "security_settings_service/create_security_settings.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_security_settings", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#create_security_settings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettings", + "client": { + "short_name": "SecuritySettingsService::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client" + }, + "method": { + "short_name": "CreateSecuritySettings", + "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService.CreateSecuritySettings", + "service": { + "short_name": "SecuritySettingsService", + "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_SecuritySettingsService_GetSecuritySettings_sync", + "title": "Snippet for the get_security_settings call in the SecuritySettingsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#get_security_settings.", + "file": "security_settings_service/get_security_settings.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_security_settings", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#get_security_settings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettings", + "client": { + "short_name": "SecuritySettingsService::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client" + }, + "method": { + "short_name": "GetSecuritySettings", + "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService.GetSecuritySettings", + "service": { + "short_name": "SecuritySettingsService", + "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_SecuritySettingsService_UpdateSecuritySettings_sync", + "title": "Snippet for the update_security_settings call in the SecuritySettingsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#update_security_settings.", + "file": "security_settings_service/update_security_settings.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_security_settings", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#update_security_settings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettings", + "client": { + "short_name": "SecuritySettingsService::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client" + }, + "method": { + "short_name": "UpdateSecuritySettings", + "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService.UpdateSecuritySettings", + "service": { + "short_name": "SecuritySettingsService", + "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_SecuritySettingsService_ListSecuritySettings_sync", + "title": "Snippet for the list_security_settings call in the SecuritySettingsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#list_security_settings.", + "file": "security_settings_service/list_security_settings.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_security_settings", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#list_security_settings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsResponse", + "client": { + "short_name": "SecuritySettingsService::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client" + }, + "method": { + "short_name": "ListSecuritySettings", + "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService.ListSecuritySettings", + "service": { + "short_name": "SecuritySettingsService", + "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_SecuritySettingsService_DeleteSecuritySettings_sync", + "title": "Snippet for the delete_security_settings call in the SecuritySettingsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#delete_security_settings.", + "file": "security_settings_service/delete_security_settings.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_security_settings", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#delete_security_settings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SecuritySettingsService::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client" + }, + "method": { + "short_name": "DeleteSecuritySettings", + "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService.DeleteSecuritySettings", + "service": { + "short_name": "SecuritySettingsService", + "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Tools::Client#create_tool.", + "file": "tools/create_tool.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_tool", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#create_tool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreateToolRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Tool", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" + }, + "method": { + "short_name": "CreateTool", + "full_name": "google.cloud.dialogflow.cx.v3.Tools.CreateTool", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Tools::Client#list_tools.", + "file": "tools/list_tools.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_tools", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#list_tools", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListToolsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListToolsResponse", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" + }, + "method": { + "short_name": "ListTools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools.ListTools", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Tools::Client#get_tool.", + "file": "tools/get_tool.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_tool", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#get_tool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetToolRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Tool", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" + }, + "method": { + "short_name": "GetTool", + "full_name": "google.cloud.dialogflow.cx.v3.Tools.GetTool", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Tools::Client#update_tool.", + "file": "tools/update_tool.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_tool", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#update_tool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateToolRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::Tool", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" + }, + "method": { + "short_name": "UpdateTool", + "full_name": "google.cloud.dialogflow.cx.v3.Tools.UpdateTool", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_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::CX::V3::Tools::Client#delete_tool.", + "file": "tools/delete_tool.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_tool", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#delete_tool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteToolRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" + }, + "method": { + "short_name": "DeleteTool", + "full_name": "google.cloud.dialogflow.cx.v3.Tools.DeleteTool", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Tools_ListToolVersions_sync", + "title": "Snippet for the list_tool_versions call in the Tools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Tools::Client#list_tool_versions.", + "file": "tools/list_tool_versions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_tool_versions", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#list_tool_versions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsResponse", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" + }, + "method": { + "short_name": "ListToolVersions", + "full_name": "google.cloud.dialogflow.cx.v3.Tools.ListToolVersions", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Tools_CreateToolVersion_sync", + "title": "Snippet for the create_tool_version call in the Tools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Tools::Client#create_tool_version.", + "file": "tools/create_tool_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_tool_version", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#create_tool_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::CreateToolVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ToolVersion", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" + }, + "method": { + "short_name": "CreateToolVersion", + "full_name": "google.cloud.dialogflow.cx.v3.Tools.CreateToolVersion", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Tools_GetToolVersion_sync", + "title": "Snippet for the get_tool_version call in the Tools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Tools::Client#get_tool_version.", + "file": "tools/get_tool_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_tool_version", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#get_tool_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::GetToolVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::ToolVersion", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" + }, + "method": { + "short_name": "GetToolVersion", + "full_name": "google.cloud.dialogflow.cx.v3.Tools.GetToolVersion", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Tools_DeleteToolVersion_sync", + "title": "Snippet for the delete_tool_version call in the Tools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Tools::Client#delete_tool_version.", + "file": "tools/delete_tool_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_tool_version", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#delete_tool_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteToolVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" + }, + "method": { + "short_name": "DeleteToolVersion", + "full_name": "google.cloud.dialogflow.cx.v3.Tools.DeleteToolVersion", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v3_generated_Tools_RestoreToolVersion_sync", + "title": "Snippet for the restore_tool_version call in the Tools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Tools::Client#restore_tool_version.", + "file": "tools/restore_tool_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "restore_tool_version", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#restore_tool_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionResponse", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" + }, + "method": { + "short_name": "RestoreToolVersion", + "full_name": "google.cloud.dialogflow.cx.v3.Tools.RestoreToolVersion", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.cx.v3.Tools" } } }, diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/create_tool.rb b/google-cloud-dialogflow-cx-v3/snippets/tools/create_tool.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/create_tool.rb rename to google-cloud-dialogflow-cx-v3/snippets/tools/create_tool.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/create_tool_version.rb b/google-cloud-dialogflow-cx-v3/snippets/tools/create_tool_version.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/create_tool_version.rb rename to google-cloud-dialogflow-cx-v3/snippets/tools/create_tool_version.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/delete_tool.rb b/google-cloud-dialogflow-cx-v3/snippets/tools/delete_tool.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/delete_tool.rb rename to google-cloud-dialogflow-cx-v3/snippets/tools/delete_tool.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/delete_tool_version.rb b/google-cloud-dialogflow-cx-v3/snippets/tools/delete_tool_version.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/delete_tool_version.rb rename to google-cloud-dialogflow-cx-v3/snippets/tools/delete_tool_version.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/get_tool.rb b/google-cloud-dialogflow-cx-v3/snippets/tools/get_tool.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/get_tool.rb rename to google-cloud-dialogflow-cx-v3/snippets/tools/get_tool.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/get_tool_version.rb b/google-cloud-dialogflow-cx-v3/snippets/tools/get_tool_version.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/get_tool_version.rb rename to google-cloud-dialogflow-cx-v3/snippets/tools/get_tool_version.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/list_tool_versions.rb b/google-cloud-dialogflow-cx-v3/snippets/tools/list_tool_versions.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/list_tool_versions.rb rename to google-cloud-dialogflow-cx-v3/snippets/tools/list_tool_versions.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/list_tools.rb b/google-cloud-dialogflow-cx-v3/snippets/tools/list_tools.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/list_tools.rb rename to google-cloud-dialogflow-cx-v3/snippets/tools/list_tools.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/restore_tool_version.rb b/google-cloud-dialogflow-cx-v3/snippets/tools/restore_tool_version.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/restore_tool_version.rb rename to google-cloud-dialogflow-cx-v3/snippets/tools/restore_tool_version.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/update_tool.rb b/google-cloud-dialogflow-cx-v3/snippets/tools/update_tool.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/tools/update_tool.rb rename to google-cloud-dialogflow-cx-v3/snippets/tools/update_tool.rb diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_paths_test.rb index 3f2d2cc5af34..95378fb470f5 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_paths_test.rb @@ -113,6 +113,18 @@ def test_location_path end end + def test_playbook_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::CX::V3::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.playbook_path project: "value0", location: "value1", agent: "value2", playbook: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/playbooks/value3", 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 diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_paths_test.rb index 17434b39e7e8..8720fc7673c0 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_paths_test.rb @@ -65,6 +65,18 @@ def test_environment_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::CX::V3::Environments::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 diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_paths_test.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_paths_test.rb rename to google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_paths_test.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_rest_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_rest_test.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_rest_test.rb rename to google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_rest_test.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_test.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_test.rb rename to google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/examples_test.rb diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_paths_test.rb index 892e6983a6a6..2962e051ef27 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_paths_test.rb @@ -113,6 +113,30 @@ def test_page_path end end + def test_playbook_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::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.playbook_path project: "value0", location: "value1", agent: "value2", playbook: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/playbooks/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::CX::V3::Flows::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tool_path project: "value0", location: "value1", agent: "value2", tool: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/tools/value3", path + end + end + def test_transition_route_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure ::Gapic::ServiceStub.stub :new, DummyStub.new do diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_paths_test.rb index 33115a438bb6..373b6aafe9c0 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_paths_test.rb @@ -101,6 +101,30 @@ def test_page_path end end + def test_playbook_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::CX::V3::Pages::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.playbook_path project: "value0", location: "value1", agent: "value2", playbook: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/playbooks/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::CX::V3::Pages::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tool_path project: "value0", location: "value1", agent: "value2", tool: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/tools/value3", path + end + end + def test_transition_route_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure ::Gapic::ServiceStub.stub :new, DummyStub.new do diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_operations_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_operations_test.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_operations_test.rb rename to google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_operations_test.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_paths_test.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_paths_test.rb rename to google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_paths_test.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_rest_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_rest_test.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_rest_test.rb rename to google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_rest_test.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_test.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_test.rb rename to google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/playbooks_test.rb diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_paths_test.rb index 0c764dca926c..cfb555600f0b 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_paths_test.rb @@ -92,6 +92,18 @@ def test_page_path end end + def test_playbook_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::CX::V3::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.playbook_path project: "value0", location: "value1", agent: "value2", playbook: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/playbooks/value3", path + end + end + def test_session_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure ::Gapic::ServiceStub.stub :new, DummyStub.new do @@ -122,6 +134,18 @@ def test_session_entity_type_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::CX::V3::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tool_path project: "value0", location: "value1", agent: "value2", tool: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/tools/value3", 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 diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_rest_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_rest_test.rb index a92a0e39abe2..16512535ac6d 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_rest_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_rest_test.rb @@ -90,6 +90,7 @@ def test_detect_intent query_params = {} query_input = {} output_audio_config = {} + response_view = :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED detect_intent_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| assert options.metadata.key? :"x-goog-api-client" @@ -105,27 +106,27 @@ def test_detect_intent end # Use hash object - client.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config }) do |_result, response| + client.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }) do |_result, response| assert_equal http_response, response.underlying_op end # Use named arguments - client.detect_intent session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config do |_result, response| + client.detect_intent session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view do |_result, response| assert_equal http_response, response.underlying_op end # Use protobuf object - client.detect_intent ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config) do |_result, response| + client.detect_intent ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view) do |_result, response| assert_equal http_response, response.underlying_op end # Use hash object with options - client.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config }, call_options) do |_result, response| + client.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }, call_options) do |_result, response| assert_equal http_response, response.underlying_op end # Use protobuf object with options - client.detect_intent(::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config), call_options) do |_result, response| + client.detect_intent(::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view), call_options) do |_result, response| assert_equal http_response, response.underlying_op end @@ -147,6 +148,7 @@ def test_server_streaming_detect_intent query_params = {} query_input = {} output_audio_config = {} + response_view = :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED server_streaming_detect_intent_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, is_server_streaming:, method_name:| assert options.metadata.key? :"x-goog-api-client" @@ -162,27 +164,27 @@ def test_server_streaming_detect_intent end # Use hash object - client.server_streaming_detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config }) do |_result, response| + client.server_streaming_detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }) do |_result, response| assert_equal http_response, response.underlying_op end.first # Use named arguments - client.server_streaming_detect_intent session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config do |_result, response| + client.server_streaming_detect_intent session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view do |_result, response| assert_equal http_response, response.underlying_op end.first # Use protobuf object - client.server_streaming_detect_intent ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config) do |_result, response| + client.server_streaming_detect_intent ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view) do |_result, response| assert_equal http_response, response.underlying_op end.first # Use hash object with options - client.server_streaming_detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config }, call_options) do |_result, response| + client.server_streaming_detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }, call_options) do |_result, response| assert_equal http_response, response.underlying_op end.first # Use protobuf object with options - client.server_streaming_detect_intent(::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config), call_options) do |_result, response| + client.server_streaming_detect_intent(::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view), call_options) do |_result, response| assert_equal http_response, response.underlying_op end.first diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_test.rb index 0722e7e35e3d..a2f74cc8bd45 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_test.rb @@ -75,6 +75,7 @@ def test_detect_intent query_params = {} query_input = {} output_audio_config = {} + response_view = :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED detect_intent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| assert_equal :detect_intent, name @@ -83,6 +84,7 @@ def test_detect_intent assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::QueryParameters), request["query_params"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::QueryInput), request["query_input"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig), request["output_audio_config"] + assert_equal :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED, request["response_view"] refute_nil options end @@ -93,31 +95,31 @@ def test_detect_intent end # Use hash object - client.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config }) do |response, operation| + client.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use named arguments - client.detect_intent session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config do |response, operation| + client.detect_intent session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use protobuf object - client.detect_intent ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config) do |response, operation| + client.detect_intent ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use hash object with options - client.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config }, grpc_options) do |response, operation| + client.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }, grpc_options) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use protobuf object with options - client.detect_intent(::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config), grpc_options) do |response, operation| + client.detect_intent(::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view), grpc_options) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end @@ -139,6 +141,7 @@ def test_server_streaming_detect_intent query_params = {} query_input = {} output_audio_config = {} + response_view = :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED server_streaming_detect_intent_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| assert_equal :server_streaming_detect_intent, name @@ -147,6 +150,7 @@ def test_server_streaming_detect_intent assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::QueryParameters), request["query_params"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::QueryInput), request["query_input"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig), request["output_audio_config"] + assert_equal :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED, request["response_view"] refute_nil options end @@ -157,7 +161,7 @@ def test_server_streaming_detect_intent end # Use hash object - client.server_streaming_detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config }) do |response, operation| + client.server_streaming_detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }) do |response, operation| assert_kind_of Enumerable, response response.to_a.each do |r| assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse, r @@ -166,7 +170,7 @@ def test_server_streaming_detect_intent end # Use named arguments - client.server_streaming_detect_intent session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config do |response, operation| + client.server_streaming_detect_intent session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view do |response, operation| assert_kind_of Enumerable, response response.to_a.each do |r| assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse, r @@ -175,7 +179,7 @@ def test_server_streaming_detect_intent end # Use protobuf object - client.server_streaming_detect_intent ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config) do |response, operation| + client.server_streaming_detect_intent ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view) do |response, operation| assert_kind_of Enumerable, response response.to_a.each do |r| assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse, r @@ -184,7 +188,7 @@ def test_server_streaming_detect_intent end # Use hash object with options - client.server_streaming_detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config }, grpc_options) do |response, operation| + client.server_streaming_detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }, grpc_options) do |response, operation| assert_kind_of Enumerable, response response.to_a.each do |r| assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse, r @@ -193,7 +197,7 @@ def test_server_streaming_detect_intent end # Use protobuf object with options - client.server_streaming_detect_intent(::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config), grpc_options) do |response, operation| + client.server_streaming_detect_intent(::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view), grpc_options) do |response, operation| assert_kind_of Enumerable, response response.to_a.each do |r| assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse, r @@ -220,6 +224,7 @@ def test_streaming_detect_intent output_audio_config = {} enable_partial_response = true enable_debugging_info = true + response_view = :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED streaming_detect_intent_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| assert_equal :streaming_detect_intent, name @@ -235,8 +240,8 @@ def test_streaming_detect_intent end # Use enumerable object with hash and protobuf object. - request_hash = { session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info } - request_proto = ::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info + request_hash = { session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view } + request_proto = ::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view enum_input = [request_hash, request_proto].to_enum client.streaming_detect_intent enum_input do |response, operation| assert_kind_of Enumerable, response @@ -247,8 +252,8 @@ def test_streaming_detect_intent end # Use stream input object (from gapic-common). - request_hash = { session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info } - request_proto = ::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info + request_hash = { session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view } + request_proto = ::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view stream_input = Gapic::StreamInput.new client.streaming_detect_intent stream_input do |response, operation| assert_kind_of Enumerable, response @@ -262,8 +267,8 @@ def test_streaming_detect_intent 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, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info } - request_proto = ::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info + request_hash = { session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view } + request_proto = ::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view enum_input = [request_hash, request_proto].to_enum client.streaming_detect_intent enum_input, grpc_options do |response, operation| assert_kind_of Enumerable, response @@ -274,8 +279,8 @@ def test_streaming_detect_intent end # Use stream input object (from gapic-common) with options. - request_hash = { session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info } - request_proto = ::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info + request_hash = { session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view } + request_proto = ::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view stream_input = Gapic::StreamInput.new client.streaming_detect_intent stream_input, grpc_options do |response, operation| assert_kind_of Enumerable, response @@ -299,6 +304,7 @@ def test_streaming_detect_intent assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig), r["output_audio_config"] assert_equal true, r["enable_partial_response"] assert_equal true, r["enable_debugging_info"] + assert_equal :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED, r["response_view"] end end end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_paths_test.rb index c1ce6e7adda9..a660c606c00f 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_paths_test.rb @@ -125,6 +125,18 @@ def test_page_path end end + def test_playbook_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::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.playbook_path project: "value0", location: "value1", agent: "value2", playbook: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/playbooks/value3", path + end + end + def test_test_case_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure ::Gapic::ServiceStub.stub :new, DummyStub.new do @@ -149,6 +161,18 @@ def test_test_case_result_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::CX::V3::TestCases::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tool_path project: "value0", location: "value1", agent: "value2", tool: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/tools/value3", path + end + end + def test_transition_route_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure ::Gapic::ServiceStub.stub :new, DummyStub.new do diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_paths_test.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_paths_test.rb rename to google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_paths_test.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_rest_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_rest_test.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_rest_test.rb rename to google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_rest_test.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_test.rb similarity index 100% rename from owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_test.rb rename to google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/tools_test.rb diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_paths_test.rb index 4b0a57942a7b..a2548bb8a2a6 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_paths_test.rb @@ -101,6 +101,18 @@ def test_page_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::CX::V3::TransitionRouteGroups::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tool_path project: "value0", location: "value1", agent: "value2", tool: "value3" + assert_equal "projects/value0/locations/value1/agents/value2/tools/value3", path + end + end + def test_transition_route_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure ::Gapic::ServiceStub.stub :new, DummyStub.new do diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_paths_test.rb index 790dabf85a17..f005976392ef 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_paths_test.rb @@ -53,6 +53,18 @@ def test_agent_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::CX::V3::Webhooks::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 diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/.gitignore b/owl-bot-staging/google-cloud-dialogflow-cx-v3/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/.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-cx-v3/.repo-metadata.json b/owl-bot-staging/google-cloud-dialogflow-cx-v3/.repo-metadata.json deleted file mode 100644 index 2ba78224f798..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/.repo-metadata.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "api_id": "dialogflow.googleapis.com", - "api_shortname": "dialogflow", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-cx-v3/latest", - "distribution_name": "google-cloud-dialogflow-cx-v3", - "is_cloud": true, - "language": "ruby", - "name": "dialogflow", - "name_pretty": "Dialogflow CX V3 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 CX, providing an advanced agent type suitable for large or very complex agents. Note that google-cloud-dialogflow-cx-v3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-dialogflow-cx instead. See the readme for more details.", - "ruby-cloud-env-prefix": "DIALOGFLOW", - "ruby-cloud-product-url": "https://cloud.google.com/dialogflow", - "ruby-cloud-namespace-override": "Cx=CX", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/.rubocop.yml b/owl-bot-staging/google-cloud-dialogflow-cx-v3/.rubocop.yml deleted file mode 100644 index a6b50c67bede..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-dialogflow-cx-v3.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-cx-v3.rb" diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/.toys.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/.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-cx-v3/.yardopts b/owl-bot-staging/google-cloud-dialogflow-cx-v3/.yardopts deleted file mode 100644 index cfa57b102370..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Dialogflow CX V3 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-cx-v3/AUTHENTICATION.md b/owl-bot-staging/google-cloud-dialogflow-cx-v3/AUTHENTICATION.md deleted file mode 100644 index 7f0de856d6c6..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-dialogflow-cx-v3 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-cx-v3 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/cx/v3" - -client = ::Google::Cloud::Dialogflow::CX::V3::Pages::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/cx/v3" - -::Google::Cloud::Dialogflow::CX::V3::Pages::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Dialogflow::CX::V3::Pages::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-cx-v3 -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/cx/v3" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Dialogflow::CX::V3::Pages::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-cx-v3/CHANGELOG.md b/owl-bot-staging/google-cloud-dialogflow-cx-v3/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/Gemfile b/owl-bot-staging/google-cloud-dialogflow-cx-v3/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/LICENSE.md b/owl-bot-staging/google-cloud-dialogflow-cx-v3/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/README.md b/owl-bot-staging/google-cloud-dialogflow-cx-v3/README.md deleted file mode 100644 index c994a736221b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Dialogflow CX V3 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 CX, providing an advanced agent type suitable for large or very complex 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 CX V3 API. Most users should consider using -the main client gem, -[google-cloud-dialogflow-cx](https://rubygems.org/gems/google-cloud-dialogflow-cx). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-dialogflow-cx-v3 -``` - -## 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/cx/v3" - -client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new -request = ::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest.new # (request fields as keyword arguments...) -response = client.list_pages request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-cx-v3/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/cx/v3" -require "logger" - -client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| - config.logger = Logger.new "my-app.log" -end -``` - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 3.0+. - -Google provides official support for Ruby versions that are actively supported -by Ruby Core—that is, Ruby versions that are either in normal maintenance or -in security maintenance, and not end of life. Older versions of Ruby _may_ -still work, but are unsupported and not recommended. See -https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby -support schedule. - -## Which client should I use? - -Most modern Ruby client libraries for Google APIs come in two flavors: the main -client library with a name such as `google-cloud-dialogflow-cx`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-dialogflow-cx-v3`. -_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-cx`. -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-cx-v3`. - -### 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-cx-v3/Rakefile b/owl-bot-staging/google-cloud-dialogflow-cx-v3/Rakefile deleted file mode 100644 index f1b0bdc7fdba..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3 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/cx/v3/pages/credentials" - ::Google::Cloud::Dialogflow::CX::V3::Pages::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-cx-v3 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-cx-v3 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-cx-v3 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-cx-v3 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-dialogflow-cx-v3" - header "google-cloud-dialogflow-cx-v3 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-dialogflow-cx-v3 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-dialogflow-cx-v3 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-cx-v3 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-cx-v3 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-cx-v3/gapic_metadata.json b/owl-bot-staging/google-cloud-dialogflow-cx-v3/gapic_metadata.json deleted file mode 100644 index 37c2bf5fa424..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/gapic_metadata.json +++ /dev/null @@ -1,874 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.dialogflow.cx.v3", - "libraryPackage": "::Google::Cloud::Dialogflow::CX::V3", - "services": { - "Pages": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client", - "rpcs": { - "ListPages": { - "methods": [ - "list_pages" - ] - }, - "GetPage": { - "methods": [ - "get_page" - ] - }, - "CreatePage": { - "methods": [ - "create_page" - ] - }, - "UpdatePage": { - "methods": [ - "update_page" - ] - }, - "DeletePage": { - "methods": [ - "delete_page" - ] - } - } - } - } - }, - "Flows": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client", - "rpcs": { - "CreateFlow": { - "methods": [ - "create_flow" - ] - }, - "DeleteFlow": { - "methods": [ - "delete_flow" - ] - }, - "ListFlows": { - "methods": [ - "list_flows" - ] - }, - "GetFlow": { - "methods": [ - "get_flow" - ] - }, - "UpdateFlow": { - "methods": [ - "update_flow" - ] - }, - "TrainFlow": { - "methods": [ - "train_flow" - ] - }, - "ValidateFlow": { - "methods": [ - "validate_flow" - ] - }, - "GetFlowValidationResult": { - "methods": [ - "get_flow_validation_result" - ] - }, - "ImportFlow": { - "methods": [ - "import_flow" - ] - }, - "ExportFlow": { - "methods": [ - "export_flow" - ] - } - } - } - } - }, - "Agents": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client", - "rpcs": { - "ListAgents": { - "methods": [ - "list_agents" - ] - }, - "GetAgent": { - "methods": [ - "get_agent" - ] - }, - "CreateAgent": { - "methods": [ - "create_agent" - ] - }, - "UpdateAgent": { - "methods": [ - "update_agent" - ] - }, - "DeleteAgent": { - "methods": [ - "delete_agent" - ] - }, - "ExportAgent": { - "methods": [ - "export_agent" - ] - }, - "RestoreAgent": { - "methods": [ - "restore_agent" - ] - }, - "ValidateAgent": { - "methods": [ - "validate_agent" - ] - }, - "GetAgentValidationResult": { - "methods": [ - "get_agent_validation_result" - ] - }, - "GetGenerativeSettings": { - "methods": [ - "get_generative_settings" - ] - }, - "UpdateGenerativeSettings": { - "methods": [ - "update_generative_settings" - ] - } - } - } - } - }, - "Changelogs": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client", - "rpcs": { - "ListChangelogs": { - "methods": [ - "list_changelogs" - ] - }, - "GetChangelog": { - "methods": [ - "get_changelog" - ] - } - } - } - } - }, - "Deployments": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Deployments::Client", - "rpcs": { - "ListDeployments": { - "methods": [ - "list_deployments" - ] - }, - "GetDeployment": { - "methods": [ - "get_deployment" - ] - } - } - } - } - }, - "EntityTypes": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client", - "rpcs": { - "GetEntityType": { - "methods": [ - "get_entity_type" - ] - }, - "CreateEntityType": { - "methods": [ - "create_entity_type" - ] - }, - "UpdateEntityType": { - "methods": [ - "update_entity_type" - ] - }, - "DeleteEntityType": { - "methods": [ - "delete_entity_type" - ] - }, - "ListEntityTypes": { - "methods": [ - "list_entity_types" - ] - }, - "ExportEntityTypes": { - "methods": [ - "export_entity_types" - ] - }, - "ImportEntityTypes": { - "methods": [ - "import_entity_types" - ] - } - } - } - } - }, - "Intents": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client", - "rpcs": { - "ListIntents": { - "methods": [ - "list_intents" - ] - }, - "GetIntent": { - "methods": [ - "get_intent" - ] - }, - "CreateIntent": { - "methods": [ - "create_intent" - ] - }, - "UpdateIntent": { - "methods": [ - "update_intent" - ] - }, - "DeleteIntent": { - "methods": [ - "delete_intent" - ] - }, - "ImportIntents": { - "methods": [ - "import_intents" - ] - }, - "ExportIntents": { - "methods": [ - "export_intents" - ] - } - } - } - } - }, - "SessionEntityTypes": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Sessions::Client", - "rpcs": { - "DetectIntent": { - "methods": [ - "detect_intent" - ] - }, - "ServerStreamingDetectIntent": { - "methods": [ - "server_streaming_detect_intent" - ] - }, - "StreamingDetectIntent": { - "methods": [ - "streaming_detect_intent" - ] - }, - "MatchIntent": { - "methods": [ - "match_intent" - ] - }, - "FulfillIntent": { - "methods": [ - "fulfill_intent" - ] - }, - "SubmitAnswerFeedback": { - "methods": [ - "submit_answer_feedback" - ] - } - } - } - } - }, - "TransitionRouteGroups": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client", - "rpcs": { - "ListTransitionRouteGroups": { - "methods": [ - "list_transition_route_groups" - ] - }, - "GetTransitionRouteGroup": { - "methods": [ - "get_transition_route_group" - ] - }, - "CreateTransitionRouteGroup": { - "methods": [ - "create_transition_route_group" - ] - }, - "UpdateTransitionRouteGroup": { - "methods": [ - "update_transition_route_group" - ] - }, - "DeleteTransitionRouteGroup": { - "methods": [ - "delete_transition_route_group" - ] - } - } - } - } - }, - "TestCases": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client", - "rpcs": { - "ListTestCases": { - "methods": [ - "list_test_cases" - ] - }, - "BatchDeleteTestCases": { - "methods": [ - "batch_delete_test_cases" - ] - }, - "GetTestCase": { - "methods": [ - "get_test_case" - ] - }, - "CreateTestCase": { - "methods": [ - "create_test_case" - ] - }, - "UpdateTestCase": { - "methods": [ - "update_test_case" - ] - }, - "RunTestCase": { - "methods": [ - "run_test_case" - ] - }, - "BatchRunTestCases": { - "methods": [ - "batch_run_test_cases" - ] - }, - "CalculateCoverage": { - "methods": [ - "calculate_coverage" - ] - }, - "ImportTestCases": { - "methods": [ - "import_test_cases" - ] - }, - "ExportTestCases": { - "methods": [ - "export_test_cases" - ] - }, - "ListTestCaseResults": { - "methods": [ - "list_test_case_results" - ] - }, - "GetTestCaseResult": { - "methods": [ - "get_test_case_result" - ] - } - } - } - } - }, - "Webhooks": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client", - "rpcs": { - "ListWebhooks": { - "methods": [ - "list_webhooks" - ] - }, - "GetWebhook": { - "methods": [ - "get_webhook" - ] - }, - "CreateWebhook": { - "methods": [ - "create_webhook" - ] - }, - "UpdateWebhook": { - "methods": [ - "update_webhook" - ] - }, - "DeleteWebhook": { - "methods": [ - "delete_webhook" - ] - } - } - } - } - }, - "Environments": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client", - "rpcs": { - "ListEnvironments": { - "methods": [ - "list_environments" - ] - }, - "GetEnvironment": { - "methods": [ - "get_environment" - ] - }, - "CreateEnvironment": { - "methods": [ - "create_environment" - ] - }, - "UpdateEnvironment": { - "methods": [ - "update_environment" - ] - }, - "DeleteEnvironment": { - "methods": [ - "delete_environment" - ] - }, - "LookupEnvironmentHistory": { - "methods": [ - "lookup_environment_history" - ] - }, - "RunContinuousTest": { - "methods": [ - "run_continuous_test" - ] - }, - "ListContinuousTestResults": { - "methods": [ - "list_continuous_test_results" - ] - }, - "DeployFlow": { - "methods": [ - "deploy_flow" - ] - } - } - } - } - }, - "Examples": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client", - "rpcs": { - "CreateExample": { - "methods": [ - "create_example" - ] - }, - "DeleteExample": { - "methods": [ - "delete_example" - ] - }, - "ListExamples": { - "methods": [ - "list_examples" - ] - }, - "GetExample": { - "methods": [ - "get_example" - ] - }, - "UpdateExample": { - "methods": [ - "update_example" - ] - } - } - } - } - }, - "Experiments": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client", - "rpcs": { - "ListExperiments": { - "methods": [ - "list_experiments" - ] - }, - "GetExperiment": { - "methods": [ - "get_experiment" - ] - }, - "CreateExperiment": { - "methods": [ - "create_experiment" - ] - }, - "UpdateExperiment": { - "methods": [ - "update_experiment" - ] - }, - "DeleteExperiment": { - "methods": [ - "delete_experiment" - ] - }, - "StartExperiment": { - "methods": [ - "start_experiment" - ] - }, - "StopExperiment": { - "methods": [ - "stop_experiment" - ] - } - } - } - } - }, - "Generators": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client", - "rpcs": { - "ListGenerators": { - "methods": [ - "list_generators" - ] - }, - "GetGenerator": { - "methods": [ - "get_generator" - ] - }, - "CreateGenerator": { - "methods": [ - "create_generator" - ] - }, - "UpdateGenerator": { - "methods": [ - "update_generator" - ] - }, - "DeleteGenerator": { - "methods": [ - "delete_generator" - ] - } - } - } - } - }, - "Playbooks": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client", - "rpcs": { - "CreatePlaybook": { - "methods": [ - "create_playbook" - ] - }, - "DeletePlaybook": { - "methods": [ - "delete_playbook" - ] - }, - "ListPlaybooks": { - "methods": [ - "list_playbooks" - ] - }, - "GetPlaybook": { - "methods": [ - "get_playbook" - ] - }, - "ExportPlaybook": { - "methods": [ - "export_playbook" - ] - }, - "ImportPlaybook": { - "methods": [ - "import_playbook" - ] - }, - "UpdatePlaybook": { - "methods": [ - "update_playbook" - ] - }, - "CreatePlaybookVersion": { - "methods": [ - "create_playbook_version" - ] - }, - "GetPlaybookVersion": { - "methods": [ - "get_playbook_version" - ] - }, - "RestorePlaybookVersion": { - "methods": [ - "restore_playbook_version" - ] - }, - "ListPlaybookVersions": { - "methods": [ - "list_playbook_versions" - ] - }, - "DeletePlaybookVersion": { - "methods": [ - "delete_playbook_version" - ] - } - } - } - } - }, - "SecuritySettingsService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client", - "rpcs": { - "CreateSecuritySettings": { - "methods": [ - "create_security_settings" - ] - }, - "GetSecuritySettings": { - "methods": [ - "get_security_settings" - ] - }, - "UpdateSecuritySettings": { - "methods": [ - "update_security_settings" - ] - }, - "ListSecuritySettings": { - "methods": [ - "list_security_settings" - ] - }, - "DeleteSecuritySettings": { - "methods": [ - "delete_security_settings" - ] - } - } - } - } - }, - "Tools": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client", - "rpcs": { - "CreateTool": { - "methods": [ - "create_tool" - ] - }, - "ListTools": { - "methods": [ - "list_tools" - ] - }, - "GetTool": { - "methods": [ - "get_tool" - ] - }, - "UpdateTool": { - "methods": [ - "update_tool" - ] - }, - "DeleteTool": { - "methods": [ - "delete_tool" - ] - }, - "ListToolVersions": { - "methods": [ - "list_tool_versions" - ] - }, - "CreateToolVersion": { - "methods": [ - "create_tool_version" - ] - }, - "GetToolVersion": { - "methods": [ - "get_tool_version" - ] - }, - "DeleteToolVersion": { - "methods": [ - "delete_tool_version" - ] - }, - "RestoreToolVersion": { - "methods": [ - "restore_tool_version" - ] - } - } - } - } - }, - "Versions": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client", - "rpcs": { - "ListVersions": { - "methods": [ - "list_versions" - ] - }, - "GetVersion": { - "methods": [ - "get_version" - ] - }, - "CreateVersion": { - "methods": [ - "create_version" - ] - }, - "UpdateVersion": { - "methods": [ - "update_version" - ] - }, - "DeleteVersion": { - "methods": [ - "delete_version" - ] - }, - "LoadVersion": { - "methods": [ - "load_version" - ] - }, - "CompareVersions": { - "methods": [ - "compare_versions" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/google-cloud-dialogflow-cx-v3.gemspec b/owl-bot-staging/google-cloud-dialogflow-cx-v3/google-cloud-dialogflow-cx-v3.gemspec deleted file mode 100644 index ac45eaa9f882..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/google-cloud-dialogflow-cx-v3.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/dialogflow/cx/v3/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-dialogflow-cx-v3" - gem.version = Google::Cloud::Dialogflow::CX::V3::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 CX, providing an advanced agent type suitable for large or very complex agents. Note that google-cloud-dialogflow-cx-v3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-dialogflow-cx 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.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google-cloud-dialogflow-cx-v3.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google-cloud-dialogflow-cx-v3.rb deleted file mode 100644 index 4c4fb203f02f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google-cloud-dialogflow-cx-v3.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/cx/v3" diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3.rb deleted file mode 100644 index 28aad8d17934..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3.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/cx/v3/pages" -require "google/cloud/dialogflow/cx/v3/flows" -require "google/cloud/dialogflow/cx/v3/agents" -require "google/cloud/dialogflow/cx/v3/changelogs" -require "google/cloud/dialogflow/cx/v3/deployments" -require "google/cloud/dialogflow/cx/v3/entity_types" -require "google/cloud/dialogflow/cx/v3/intents" -require "google/cloud/dialogflow/cx/v3/session_entity_types" -require "google/cloud/dialogflow/cx/v3/sessions" -require "google/cloud/dialogflow/cx/v3/transition_route_groups" -require "google/cloud/dialogflow/cx/v3/test_cases" -require "google/cloud/dialogflow/cx/v3/webhooks" -require "google/cloud/dialogflow/cx/v3/environments" -require "google/cloud/dialogflow/cx/v3/examples" -require "google/cloud/dialogflow/cx/v3/experiments" -require "google/cloud/dialogflow/cx/v3/generators" -require "google/cloud/dialogflow/cx/v3/playbooks" -require "google/cloud/dialogflow/cx/v3/security_settings_service" -require "google/cloud/dialogflow/cx/v3/tools" -require "google/cloud/dialogflow/cx/v3/versions" -require "google/cloud/dialogflow/cx/v3/version" - -module Google - module Cloud - module Dialogflow - module CX - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/dialogflow/cx/v3" - # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/dialogflow/cx/v3" - # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new - # - module V3 - end - end - end - end -end - -helper_path = ::File.join __dir__, "v3", "_helpers.rb" -require "google/cloud/dialogflow/cx/v3/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/advanced_settings_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/advanced_settings_pb.rb deleted file mode 100644 index db7ad74ee237..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/advanced_settings_pb.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/advanced_settings.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/cloud/dialogflow/cx/v3/gcs_pb' -require 'google/protobuf/duration_pb' - - -descriptor_data = "\n5google/cloud/dialogflow/cx/v3/advanced_settings.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\'google/cloud/dialogflow/cx/v3/gcs.proto\x1a\x1egoogle/protobuf/duration.proto\"\xdc\x07\n\x10\x41\x64vancedSettings\x12S\n\x1c\x61udio_export_gcs_destination\x18\x02 \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.GcsDestination\x12W\n\x0fspeech_settings\x18\x03 \x01(\x0b\x32>.google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings\x12S\n\rdtmf_settings\x18\x05 \x01(\x0b\x32<.google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings\x12Y\n\x10logging_settings\x18\x06 \x01(\x0b\x32?.google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings\x1a\x98\x02\n\x0eSpeechSettings\x12\x1e\n\x16\x65ndpointer_sensitivity\x18\x01 \x01(\x05\x12\x34\n\x11no_speech_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12%\n\x1duse_timeout_based_endpointing\x18\x03 \x01(\x08\x12Z\n\x06models\x18\x05 \x03(\x0b\x32J.google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.ModelsEntry\x1a-\n\x0bModelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\xca\x01\n\x0c\x44tmfSettings\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x12\n\nmax_digits\x18\x02 \x01(\x05\x12\x14\n\x0c\x66inish_digit\x18\x03 \x01(\t\x12>\n\x1binterdigit_timeout_duration\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12?\n\x1c\x65ndpointing_timeout_duration\x18\x07 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a\x81\x01\n\x0fLoggingSettings\x12\"\n\x1a\x65nable_stackdriver_logging\x18\x02 \x01(\x08\x12\"\n\x1a\x65nable_interaction_logging\x18\x03 \x01(\x08\x12&\n\x1e\x65nable_consent_based_redaction\x18\x04 \x01(\x08\x42\xb8\x01\n!com.google.cloud.dialogflow.cx.v3B\x15\x41\x64vancedSettingsProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.dialogflow.cx.v3.GcsDestination", "google/cloud/dialogflow/cx/v3/gcs.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - AdvancedSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.AdvancedSettings").msgclass - AdvancedSettings::SpeechSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings").msgclass - AdvancedSettings::DtmfSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings").msgclass - AdvancedSettings::LoggingSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb deleted file mode 100644 index 30c31944b4eb..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/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/cx/v3/advanced_settings_pb' -require 'google/cloud/dialogflow/cx/v3/audio_config_pb' -require 'google/cloud/dialogflow/cx/v3/flow_pb' -require 'google/cloud/dialogflow/cx/v3/generative_settings_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/cx/v3/agent.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/advanced_settings.proto\x1a\x30google/cloud/dialogflow/cx/v3/audio_config.proto\x1a(google/cloud/dialogflow/cx/v3/flow.proto\x1a\x37google/cloud/dialogflow/cx/v3/generative_settings.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"8\n\x14SpeechToTextSettings\x12 \n\x18\x65nable_speech_adaptation\x18\x01 \x01(\x08\"\xa1\x11\n\x05\x41gent\x12\x0c\n\x04name\x18\x01 \x01(\t\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\x06\xe0\x41\x02\xe0\x41\x05\x12 \n\x18supported_language_codes\x18\x04 \x03(\t\x12\x16\n\ttime_zone\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x12\n\navatar_uri\x18\x07 \x01(\t\x12T\n\x17speech_to_text_settings\x18\r \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.SpeechToTextSettings\x12\x39\n\nstart_flow\x18\x10 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/FlowH\x00\x12\x41\n\x0estart_playbook\x18\' \x01(\tB\'\xfa\x41$\n\"dialogflow.googleapis.com/PlaybookH\x00\x12J\n\x11security_settings\x18\x11 \x01(\tB/\xfa\x41,\n*dialogflow.googleapis.com/SecuritySettings\x12&\n\x1a\x65nable_stackdriver_logging\x18\x12 \x01(\x08\x42\x02\x18\x01\x12\x1f\n\x17\x65nable_spell_correction\x18\x14 \x01(\x08\x12+\n\x1e\x65nable_multi_language_training\x18( \x01(\x08\x42\x03\xe0\x41\x01\x12\x0e\n\x06locked\x18\x1b \x01(\x08\x12J\n\x11\x61\x64vanced_settings\x18\x16 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x12]\n\x18git_integration_settings\x18\x1e \x01(\x0b\x32;.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings\x12T\n\x17text_to_speech_settings\x18\x1f \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.TextToSpeechSettings\x12\x61\n\x18gen_app_builder_settings\x18! \x01(\x0b\x32:.google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettingsH\x01\x88\x01\x01\x12\x62\n\x18\x61nswer_feedback_settings\x18& \x01(\x0b\x32;.google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettingsB\x03\xe0\x41\x01\x12\x63\n\x18personalization_settings\x18* \x01(\x0b\x32<.google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettingsB\x03\xe0\x41\x01\x12h\n\x1b\x63lient_certificate_settings\x18+ \x01(\x0b\x32>.google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettingsB\x03\xe0\x41\x01\x12\"\n\rsatisfies_pzs\x18- \x01(\x08\x42\x06\xe0\x41\x01\xe0\x41\x03H\x02\x88\x01\x01\x12\"\n\rsatisfies_pzi\x18. \x01(\x08\x42\x06\xe0\x41\x01\xe0\x41\x03H\x03\x88\x01\x01\x1a\x90\x02\n\x16GitIntegrationSettings\x12\x65\n\x0fgithub_settings\x18\x01 \x01(\x0b\x32J.google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettingsH\x00\x1a\x7f\n\x0eGithubSettings\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x16\n\x0erepository_uri\x18\x02 \x01(\t\x12\x17\n\x0ftracking_branch\x18\x03 \x01(\t\x12\x14\n\x0c\x61\x63\x63\x65ss_token\x18\x04 \x01(\t\x12\x10\n\x08\x62ranches\x18\x05 \x03(\tB\x0e\n\x0cgit_settings\x1a,\n\x15GenAppBuilderSettings\x12\x13\n\x06\x65ngine\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a=\n\x16\x41nswerFeedbackSettings\x12#\n\x16\x65nable_answer_feedback\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x1aZ\n\x17PersonalizationSettings\x12?\n\x19\x64\x65\x66\x61ult_end_user_metadata\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x1a\xca\x01\n\x19\x43lientCertificateSettings\x12\x1c\n\x0fssl_certificate\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12G\n\x0bprivate_key\x18\x02 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x46\n\npassphrase\x18\x03 \x01(\tB2\xe0\x41\x01\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion:\\\xea\x41Y\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x36projects/{project}/locations/{location}/agents/{agent}B\x18\n\x16session_entry_resourceB\x1b\n\x19_gen_app_builder_settingsB\x10\n\x0e_satisfies_pzsB\x10\n\x0e_satisfies_pzi\"s\n\x11ListAgentsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"c\n\x12ListAgentsResponse\x12\x34\n\x06\x61gents\x18\x01 \x03(\x0b\x32$.google.cloud.dialogflow.cx.v3.Agent\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"H\n\x0fGetAgentRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\"\x87\x01\n\x12\x43reateAgentRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\x12\x38\n\x05\x61gent\x18\x02 \x01(\x0b\x32$.google.cloud.dialogflow.cx.v3.AgentB\x03\xe0\x41\x02\"\x7f\n\x12UpdateAgentRequest\x12\x38\n\x05\x61gent\x18\x01 \x01(\x0b\x32$.google.cloud.dialogflow.cx.v3.AgentB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"K\n\x12\x44\x65leteAgentRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\"\x98\x04\n\x12\x45xportAgentRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x16\n\tagent_uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12V\n\x0b\x64\x61ta_format\x18\x03 \x01(\x0e\x32<.google.cloud.dialogflow.cx.v3.ExportAgentRequest.DataFormatB\x03\xe0\x41\x01\x12\x42\n\x0b\x65nvironment\x18\x05 \x01(\tB-\xe0\x41\x01\xfa\x41\'\n%dialogflow.googleapis.com/Environment\x12^\n\x0fgit_destination\x18\x06 \x01(\x0b\x32@.google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestinationB\x03\xe0\x41\x01\x12-\n include_bigquery_export_settings\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x41\n\x0eGitDestination\x12\x17\n\x0ftracking_branch\x18\x01 \x01(\t\x12\x16\n\x0e\x63ommit_message\x18\x02 \x01(\t\"E\n\nDataFormat\x12\x1b\n\x17\x44\x41TA_FORMAT_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42LOB\x10\x01\x12\x10\n\x0cJSON_PACKAGE\x10\x04\"b\n\x13\x45xportAgentResponse\x12\x13\n\tagent_uri\x18\x01 \x01(\tH\x00\x12\x17\n\ragent_content\x18\x02 \x01(\x0cH\x00\x12\x14\n\ncommit_sha\x18\x03 \x01(\tH\x00\x42\x07\n\x05\x61gent\"\xa0\x03\n\x13RestoreAgentRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\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\x12R\n\ngit_source\x18\x06 \x01(\x0b\x32<.google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSourceH\x00\x12X\n\x0erestore_option\x18\x05 \x01(\x0e\x32@.google.cloud.dialogflow.cx.v3.RestoreAgentRequest.RestoreOption\x1a$\n\tGitSource\x12\x17\n\x0ftracking_branch\x18\x01 \x01(\t\"G\n\rRestoreOption\x12\x1e\n\x1aRESTORE_OPTION_UNSPECIFIED\x10\x00\x12\x08\n\x04KEEP\x10\x01\x12\x0c\n\x08\x46\x41LLBACK\x10\x02\x42\x07\n\x05\x61gent\"d\n\x14ValidateAgentRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\x7f\n\x1fGetAgentValidationResultRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/dialogflow.googleapis.com/AgentValidationResult\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\xfa\x01\n\x15\x41gentValidationResult\x12\x0c\n\x04name\x18\x01 \x01(\t\x12T\n\x17\x66low_validation_results\x18\x02 \x03(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.FlowValidationResult:}\xea\x41z\n/dialogflow.googleapis.com/AgentValidationResult\x12Gprojects/{project}/locations/{location}/agents/{agent}/validationResult\"\x83\x01\n\x1cGetGenerativeSettingsRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1dialogflow.googleapis.com/AgentGenerativeSettings\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\xac\x01\n\x1fUpdateGenerativeSettingsRequest\x12S\n\x13generative_settings\x18\x01 \x01(\x0b\x32\x31.google.cloud.dialogflow.cx.v3.GenerativeSettingsB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x32\xa2\x12\n\x06\x41gents\x12\xae\x01\n\nListAgents\x12\x30.google.cloud.dialogflow.cx.v3.ListAgentsRequest\x1a\x31.google.cloud.dialogflow.cx.v3.ListAgentsResponse\";\xda\x41\x06parent\x82\xd3\xe4\x93\x02,\x12*/v3/{parent=projects/*/locations/*}/agents\x12\x9b\x01\n\x08GetAgent\x12..google.cloud.dialogflow.cx.v3.GetAgentRequest\x1a$.google.cloud.dialogflow.cx.v3.Agent\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,\x12*/v3/{name=projects/*/locations/*/agents/*}\x12\xb0\x01\n\x0b\x43reateAgent\x12\x31.google.cloud.dialogflow.cx.v3.CreateAgentRequest\x1a$.google.cloud.dialogflow.cx.v3.Agent\"H\xda\x41\x0cparent,agent\x82\xd3\xe4\x93\x02\x33\"*/v3/{parent=projects/*/locations/*}/agents:\x05\x61gent\x12\xbb\x01\n\x0bUpdateAgent\x12\x31.google.cloud.dialogflow.cx.v3.UpdateAgentRequest\x1a$.google.cloud.dialogflow.cx.v3.Agent\"S\xda\x41\x11\x61gent,update_mask\x82\xd3\xe4\x93\x02\x39\x32\x30/v3/{agent.name=projects/*/locations/*/agents/*}:\x05\x61gent\x12\x93\x01\n\x0b\x44\x65leteAgent\x12\x31.google.cloud.dialogflow.cx.v3.DeleteAgentRequest\x1a\x16.google.protobuf.Empty\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,**/v3/{name=projects/*/locations/*/agents/*}\x12\xcd\x01\n\x0b\x45xportAgent\x12\x31.google.cloud.dialogflow.cx.v3.ExportAgentRequest\x1a\x1d.google.longrunning.Operation\"l\xca\x41-\n\x13\x45xportAgentResponse\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02\x36\"1/v3/{name=projects/*/locations/*/agents/*}:export:\x01*\x12\xd2\x01\n\x0cRestoreAgent\x12\x32.google.cloud.dialogflow.cx.v3.RestoreAgentRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02\x37\"2/v3/{name=projects/*/locations/*/agents/*}:restore:\x01*\x12\xba\x01\n\rValidateAgent\x12\x33.google.cloud.dialogflow.cx.v3.ValidateAgentRequest\x1a\x34.google.cloud.dialogflow.cx.v3.AgentValidationResult\">\x82\xd3\xe4\x93\x02\x38\"3/v3/{name=projects/*/locations/*/agents/*}:validate:\x01*\x12\xdc\x01\n\x18GetAgentValidationResult\x12>.google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest\x1a\x34.google.cloud.dialogflow.cx.v3.AgentValidationResult\"J\xda\x41\x04name\x82\xd3\xe4\x93\x02=\x12;/v3/{name=projects/*/locations/*/agents/*/validationResult}\x12\xe3\x01\n\x15GetGenerativeSettings\x12;.google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest\x1a\x31.google.cloud.dialogflow.cx.v3.GenerativeSettings\"Z\xda\x41\x12name,language_code\x82\xd3\xe4\x93\x02?\x12=/v3/{name=projects/*/locations/*/agents/*/generativeSettings}\x12\xa0\x02\n\x18UpdateGenerativeSettings\x12>.google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest\x1a\x31.google.cloud.dialogflow.cx.v3.GenerativeSettings\"\x90\x01\xda\x41\x1fgenerative_settings,update_mask\x82\xd3\xe4\x93\x02h2Q/v3/{generative_settings.name=projects/*/locations/*/agents/*/generativeSettings}:\x13generative_settings\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x94\x02\n!com.google.cloud.dialogflow.cx.v3B\nAgentProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3\xea\x41\x64\n*secretmanager.googleapis.com/SecretVersion\x12\x36projects/{project}/secrets/{secret}/versions/{version}b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.dialogflow.cx.v3.AdvancedSettings", "google/cloud/dialogflow/cx/v3/advanced_settings.proto"], - ["google.cloud.dialogflow.cx.v3.TextToSpeechSettings", "google/cloud/dialogflow/cx/v3/audio_config.proto"], - ["google.protobuf.Struct", "google/protobuf/struct.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.cloud.dialogflow.cx.v3.FlowValidationResult", "google/cloud/dialogflow/cx/v3/flow.proto"], - ["google.cloud.dialogflow.cx.v3.GenerativeSettings", "google/cloud/dialogflow/cx/v3/generative_settings.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - SpeechToTextSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SpeechToTextSettings").msgclass - Agent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Agent").msgclass - Agent::GitIntegrationSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings").msgclass - Agent::GitIntegrationSettings::GithubSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Agent.GitIntegrationSettings.GithubSettings").msgclass - Agent::GenAppBuilderSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Agent.GenAppBuilderSettings").msgclass - Agent::AnswerFeedbackSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Agent.AnswerFeedbackSettings").msgclass - Agent::PersonalizationSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Agent.PersonalizationSettings").msgclass - Agent::ClientCertificateSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Agent.ClientCertificateSettings").msgclass - ListAgentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListAgentsRequest").msgclass - ListAgentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListAgentsResponse").msgclass - GetAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetAgentRequest").msgclass - CreateAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateAgentRequest").msgclass - UpdateAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateAgentRequest").msgclass - DeleteAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteAgentRequest").msgclass - ExportAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportAgentRequest").msgclass - ExportAgentRequest::GitDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportAgentRequest.GitDestination").msgclass - ExportAgentRequest::DataFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportAgentRequest.DataFormat").enummodule - ExportAgentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportAgentResponse").msgclass - RestoreAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RestoreAgentRequest").msgclass - RestoreAgentRequest::GitSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RestoreAgentRequest.GitSource").msgclass - RestoreAgentRequest::RestoreOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RestoreAgentRequest.RestoreOption").enummodule - ValidateAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ValidateAgentRequest").msgclass - GetAgentValidationResultRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest").msgclass - AgentValidationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.AgentValidationResult").msgclass - GetGenerativeSettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetGenerativeSettingsRequest").msgclass - UpdateGenerativeSettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateGenerativeSettingsRequest").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agent_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agent_services_pb.rb deleted file mode 100644 index 0dbd29141d9a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agent_services_pb.rb +++ /dev/null @@ -1,103 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/cx/v3/agent.proto for package 'Google.Cloud.Dialogflow.CX.V3' -# 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/cx/v3/agent_pb' - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Agents - # Service for managing [Agents][google.cloud.dialogflow.cx.v3.Agent]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.cx.v3.Agents' - - # Returns the list of all agents in the specified location. - rpc :ListAgents, ::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListAgentsResponse - # Retrieves the specified agent. - rpc :GetAgent, ::Google::Cloud::Dialogflow::CX::V3::GetAgentRequest, ::Google::Cloud::Dialogflow::CX::V3::Agent - # Creates an agent in the specified location. - # - # Note: You should always train flows prior to sending them queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - rpc :CreateAgent, ::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest, ::Google::Cloud::Dialogflow::CX::V3::Agent - # Updates the specified agent. - # - # Note: You should always train flows prior to sending them queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - rpc :UpdateAgent, ::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest, ::Google::Cloud::Dialogflow::CX::V3::Agent - # Deletes the specified agent. - rpc :DeleteAgent, ::Google::Cloud::Dialogflow::CX::V3::DeleteAgentRequest, ::Google::Protobuf::Empty - # Exports the specified agent to a binary file. - # - # 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`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: - # [ExportAgentResponse][google.cloud.dialogflow.cx.v3.ExportAgentResponse] - rpc :ExportAgent, ::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest, ::Google::Longrunning::Operation - # Restores the specified agent from a binary file. - # - # Replaces the current agent with a new one. Note that all existing resources - # in agent (e.g. intents, entity types, flows) will be removed. - # - # 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`: 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 flows prior to sending them queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - rpc :RestoreAgent, ::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest, ::Google::Longrunning::Operation - # Validates the specified agent and creates or updates validation results. - # The agent in draft version is validated. Please call this API after the - # training is completed to get the complete validation results. - rpc :ValidateAgent, ::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest, ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult - # Gets the latest agent validation result. Agent validation is performed - # when ValidateAgent is called. - rpc :GetAgentValidationResult, ::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest, ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult - # Gets the generative settings for the agent. - rpc :GetGenerativeSettings, ::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest, ::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings - # Updates the generative settings for the agent. - rpc :UpdateGenerativeSettings, ::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest, ::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents.rb deleted file mode 100644 index 8798d806b89c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents.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/cx/v3/version" - -require "google/cloud/dialogflow/cx/v3/agents/credentials" -require "google/cloud/dialogflow/cx/v3/agents/paths" -require "google/cloud/dialogflow/cx/v3/agents/operations" -require "google/cloud/dialogflow/cx/v3/agents/client" -require "google/cloud/dialogflow/cx/v3/agents/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Agent Agents}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/cx/v3/agents" - # client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/cx/v3/agents/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new - # - module Agents - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "agents", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/agents/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/client.rb deleted file mode 100644 index 8267f7959c06..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/client.rb +++ /dev/null @@ -1,1569 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/agent_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Agents - ## - # Client for the Agents service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Agents::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Agents clients - # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] - 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.create_agent.timeout = 180.0 - default_config.rpcs.create_agent.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::CX::V3::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::CX::V3::Agents::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::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/cx/v3/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::CX::V3::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::CX::V3::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 - - ## - # Returns the list of all agents in the specified location. - # - # @overload list_agents(request, options = nil) - # Pass arguments to `list_agents` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_agents(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_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 location to list all agents for. - # 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::CX::V3::Agent>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Agent>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest.new - # - # # Call the list_agents method. - # result = client.list_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::CX::V3::Agent. - # p item - # end - # - def list_agents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest - - # Converts hash and nil to 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_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::CX::V3::VERSION - metadata[:"x-goog-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_agents.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_agents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.call_rpc :list_agents, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @agents_stub, :list_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 - - ## - # 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::CX::V3::GetAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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(name: 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 name [::String] - # Required. The name of the agent. - # Format: `projects//locations//agents/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Agent] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetAgentRequest.new - # - # # Call the get_agent method. - # result = client.get_agent request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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 an agent in the specified location. - # - # Note: You should always train flows prior to sending them queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload create_agent(request, options = nil) - # Pass arguments to `create_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_agent(parent: nil, agent: nil) - # Pass arguments to `create_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 location to create a agent for. - # Format: `projects//locations/`. - # @param agent [::Google::Cloud::Dialogflow::CX::V3::Agent, ::Hash] - # Required. The agent to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Agent] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest.new - # - # # Call the create_agent method. - # result = client.create_agent request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. - # p result - # - def create_agent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest - - # Converts hash and nil to 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_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::CX::V3::VERSION - metadata[:"x-goog-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_agent.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_agent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.call_rpc :create_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 - - ## - # Updates the specified agent. - # - # Note: You should always train flows prior to sending them queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload update_agent(request, options = nil) - # Pass arguments to `update_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_agent(agent: nil, update_mask: nil) - # Pass arguments to `update_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::CX::V3::Agent, ::Hash] - # Required. The agent to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # 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::CX::V3::Agent] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest.new - # - # # Call the update_agent method. - # result = client.update_agent request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. - # p result - # - def update_agent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest - - # Converts hash and nil to 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_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::CX::V3::VERSION - metadata[:"x-goog-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&.name - header_params["agent.name"] = request.agent.name - end - - request_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_agent.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_agent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.call_rpc :update_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::CX::V3::DeleteAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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(name: 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 name [::String] - # Required. The name of the agent to delete. - # Format: `projects//locations//agents/`. - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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 - - ## - # Exports the specified agent to a binary file. - # - # 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`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::ExportAgentResponse ExportAgentResponse} - # - # @overload export_agent(request, options = nil) - # Pass arguments to `export_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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(name: nil, agent_uri: nil, data_format: nil, environment: nil, git_destination: nil, include_bigquery_export_settings: 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 name [::String] - # Required. The name of the agent to export. - # Format: `projects//locations//agents/`. - # @param agent_uri [::String] - # Optional. 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). - # @param data_format [::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest::DataFormat] - # Optional. The data format of the exported agent. If not specified, `BLOB` - # is assumed. - # @param environment [::String] - # Optional. Environment name. If not set, draft environment is assumed. - # Format: - # `projects//locations//agents//environments/`. - # @param git_destination [::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest::GitDestination, ::Hash] - # Optional. The Git branch to export the agent to. - # @param include_bigquery_export_settings [::Boolean] - # Optional. Whether to include BigQuery Export setting. - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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 - - ## - # Restores the specified agent from a binary file. - # - # Replaces the current agent with a new one. Note that all existing resources - # in agent (e.g. intents, entity types, flows) will be removed. - # - # 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`: 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 flows prior to sending them queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload restore_agent(request, options = nil) - # Pass arguments to `restore_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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(name: nil, agent_uri: nil, agent_content: nil, git_source: nil, restore_option: 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 name [::String] - # Required. The name of the agent to restore into. - # Format: `projects//locations//agents/`. - # @param agent_uri [::String] - # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI - # to restore agent from. The format of this URI must be - # `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`, `git_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param agent_content [::String] - # Uncompressed raw byte content for agent. - # - # Note: The following parameters are mutually exclusive: `agent_content`, `agent_uri`, `git_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param git_source [::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest::GitSource, ::Hash] - # Setting for restoring from a git branch - # - # Note: The following parameters are mutually exclusive: `git_source`, `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 restore_option [::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest::RestoreOption] - # Agent restore mode. If not specified, `KEEP` is assumed. - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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 - - ## - # Validates the specified agent and creates or updates validation results. - # The agent in draft version is validated. Please call this API after the - # training is completed to get the complete validation results. - # - # @overload validate_agent(request, options = nil) - # Pass arguments to `validate_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload validate_agent(name: nil, language_code: nil) - # Pass arguments to `validate_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 name [::String] - # Required. The agent to validate. - # Format: `projects//locations//agents/`. - # @param language_code [::String] - # If not specified, the agent's default language is used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest.new - # - # # Call the validate_agent method. - # result = client.validate_agent request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AgentValidationResult. - # p result - # - def validate_agent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.validate_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.validate_agent.timeout, - metadata: metadata, - retry_policy: @config.rpcs.validate_agent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.call_rpc :validate_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 - - ## - # Gets the latest agent validation result. Agent validation is performed - # when ValidateAgent is called. - # - # @overload get_agent_validation_result(request, options = nil) - # Pass arguments to `get_agent_validation_result` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_validation_result(name: nil, language_code: nil) - # Pass arguments to `get_agent_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 name [::String] - # Required. The agent name. - # Format: - # `projects//locations//agents//validationResult`. - # @param language_code [::String] - # If not specified, the agent's default language is used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest.new - # - # # Call the get_agent_validation_result method. - # result = client.get_agent_validation_result request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AgentValidationResult. - # p result - # - def get_agent_validation_result request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest - - # Converts hash and nil to 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_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_validation_result.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_agent_validation_result.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.call_rpc :get_agent_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 - - ## - # Gets the generative settings for the agent. - # - # @overload get_generative_settings(request, options = nil) - # Pass arguments to `get_generative_settings` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generative_settings(name: nil, language_code: nil) - # Pass arguments to `get_generative_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Format: - # `projects//locations//agents//generativeSettings`. - # @param language_code [::String] - # Required. Language code of the generative settings. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest.new - # - # # Call the get_generative_settings method. - # result = client.get_generative_settings request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::GenerativeSettings. - # p result - # - def get_generative_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest - - # Converts hash and nil to 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_generative_settings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_generative_settings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_generative_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.call_rpc :get_generative_settings, request, 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 generative settings for the agent. - # - # @overload update_generative_settings(request, options = nil) - # Pass arguments to `update_generative_settings` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generative_settings(generative_settings: nil, update_mask: nil) - # Pass arguments to `update_generative_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param generative_settings [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings, ::Hash] - # Required. Generative settings 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::CX::V3::GenerativeSettings] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest.new - # - # # Call the update_generative_settings method. - # result = client.update_generative_settings request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::GenerativeSettings. - # p result - # - def update_generative_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest - - # Converts hash and nil to 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_generative_settings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.generative_settings&.name - header_params["generative_settings.name"] = request.generative_settings.name - end - - request_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_generative_settings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_generative_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.call_rpc :update_generative_settings, request, 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::CX::V3::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 - # # list_agents to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_agents.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_agents.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::CX::V3::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. - # * `: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. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_agents` - # @return [::Gapic::Config::Method] - # - attr_reader :list_agents - ## - # RPC-specific configuration for `get_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :get_agent - ## - # RPC-specific configuration for `create_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :create_agent - ## - # RPC-specific configuration for `update_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :update_agent - ## - # RPC-specific configuration for `delete_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_agent - ## - # RPC-specific configuration for `export_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :export_agent - ## - # RPC-specific configuration for `restore_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :restore_agent - ## - # RPC-specific configuration for `validate_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :validate_agent - ## - # RPC-specific configuration for `get_agent_validation_result` - # @return [::Gapic::Config::Method] - # - attr_reader :get_agent_validation_result - ## - # RPC-specific configuration for `get_generative_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :get_generative_settings - ## - # RPC-specific configuration for `update_generative_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :update_generative_settings - - # @private - def initialize parent_rpcs = nil - list_agents_config = parent_rpcs.list_agents if parent_rpcs.respond_to? :list_agents - @list_agents = ::Gapic::Config::Method.new list_agents_config - get_agent_config = parent_rpcs.get_agent if parent_rpcs.respond_to? :get_agent - @get_agent = ::Gapic::Config::Method.new get_agent_config - create_agent_config = parent_rpcs.create_agent if parent_rpcs.respond_to? :create_agent - @create_agent = ::Gapic::Config::Method.new create_agent_config - update_agent_config = parent_rpcs.update_agent if parent_rpcs.respond_to? :update_agent - @update_agent = ::Gapic::Config::Method.new update_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 - export_agent_config = parent_rpcs.export_agent if parent_rpcs.respond_to? :export_agent - @export_agent = ::Gapic::Config::Method.new export_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 - validate_agent_config = parent_rpcs.validate_agent if parent_rpcs.respond_to? :validate_agent - @validate_agent = ::Gapic::Config::Method.new validate_agent_config - get_agent_validation_result_config = parent_rpcs.get_agent_validation_result if parent_rpcs.respond_to? :get_agent_validation_result - @get_agent_validation_result = ::Gapic::Config::Method.new get_agent_validation_result_config - get_generative_settings_config = parent_rpcs.get_generative_settings if parent_rpcs.respond_to? :get_generative_settings - @get_generative_settings = ::Gapic::Config::Method.new get_generative_settings_config - update_generative_settings_config = parent_rpcs.update_generative_settings if parent_rpcs.respond_to? :update_generative_settings - @update_generative_settings = ::Gapic::Config::Method.new update_generative_settings_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/credentials.rb deleted file mode 100644 index 4808b1595bff..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - 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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb deleted file mode 100644 index a7b68a307818..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/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 CX - module V3 - 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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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. - # * `: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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/paths.rb deleted file mode 100644 index 9ac32eefe45f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/paths.rb +++ /dev/null @@ -1,210 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - module Agents - # Path helper methods for the Agents API. - module Paths - ## - # Create a fully-qualified Agent resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # - # @return [::String] - def agent_path project:, location:, agent: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}" - end - - ## - # Create a fully-qualified AgentGenerativeSettings resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/generativeSettings` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # - # @return [::String] - def agent_generative_settings_path project:, location:, agent: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/generativeSettings" - end - - ## - # Create a fully-qualified AgentValidationResult resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/validationResult` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # - # @return [::String] - def agent_validation_result_path project:, location:, agent: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/validationResult" - end - - ## - # Create a fully-qualified Environment resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param environment [String] - # - # @return [::String] - def environment_path project:, location:, agent:, environment: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}" - end - - ## - # Create a fully-qualified Flow resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param flow [String] - # - # @return [::String] - def flow_path project:, location:, agent:, flow: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}" - 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 Playbook resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param playbook [String] - # - # @return [::String] - def playbook_path project:, location:, agent:, playbook: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}" - 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 SecuritySettings 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 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 - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest.rb deleted file mode 100644 index c00ccb479570..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/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/cx/v3/version" -require "google/cloud/dialogflow/cx/v3/bindings_override" - -require "google/cloud/dialogflow/cx/v3/agents/credentials" -require "google/cloud/dialogflow/cx/v3/agents/paths" -require "google/cloud/dialogflow/cx/v3/agents/rest/operations" -require "google/cloud/dialogflow/cx/v3/agents/rest/client" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Agent Agents}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/cx/v3/agents/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new - # - module Agents - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/agents/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb deleted file mode 100644 index e40f82dd8d40..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb +++ /dev/null @@ -1,1457 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/agent_pb" -require "google/cloud/dialogflow/cx/v3/agents/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Agents - module Rest - ## - # REST client for the Agents service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Agents::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Agents clients - # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] - 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.create_agent.timeout = 180.0 - default_config.rpcs.create_agent.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::CX::V3::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::CX::V3::Agents::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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 - - ## - # Returns the list of all agents in the specified location. - # - # @overload list_agents(request, options = nil) - # Pass arguments to `list_agents` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_agents(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_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 location to list all agents for. - # 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::CX::V3::Agent>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Agent>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest.new - # - # # Call the list_agents method. - # result = client.list_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::CX::V3::Agent. - # p item - # end - # - def list_agents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest - - # Converts hash and nil to an 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_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_agents.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_agents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.list_agents request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @agents_stub, :list_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 - - ## - # 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::CX::V3::GetAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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(name: 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 name [::String] - # Required. The name of the agent. - # Format: `projects//locations//agents/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Agent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetAgentRequest.new - # - # # Call the get_agent method. - # result = client.get_agent request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 an agent in the specified location. - # - # Note: You should always train flows prior to sending them queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload create_agent(request, options = nil) - # Pass arguments to `create_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_agent(parent: nil, agent: nil) - # Pass arguments to `create_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 location to create a agent for. - # Format: `projects//locations/`. - # @param agent [::Google::Cloud::Dialogflow::CX::V3::Agent, ::Hash] - # Required. The agent to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Agent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest.new - # - # # Call the create_agent method. - # result = client.create_agent request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. - # p result - # - def create_agent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest - - # Converts hash and nil to an 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_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_agent.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_agent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.create_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 - - ## - # Updates the specified agent. - # - # Note: You should always train flows prior to sending them queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload update_agent(request, options = nil) - # Pass arguments to `update_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_agent(agent: nil, update_mask: nil) - # Pass arguments to `update_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::CX::V3::Agent, ::Hash] - # Required. The agent to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # 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::CX::V3::Agent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest.new - # - # # Call the update_agent method. - # result = client.update_agent request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. - # p result - # - def update_agent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest - - # Converts hash and nil to an 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_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_agent.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_agent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.update_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::CX::V3::DeleteAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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(name: 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 name [::String] - # Required. The name of the agent to delete. - # Format: `projects//locations//agents/`. - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - ## - # Exports the specified agent to a binary file. - # - # 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`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::ExportAgentResponse ExportAgentResponse} - # - # @overload export_agent(request, options = nil) - # Pass arguments to `export_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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(name: nil, agent_uri: nil, data_format: nil, environment: nil, git_destination: nil, include_bigquery_export_settings: 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 name [::String] - # Required. The name of the agent to export. - # Format: `projects//locations//agents/`. - # @param agent_uri [::String] - # Optional. 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). - # @param data_format [::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest::DataFormat] - # Optional. The data format of the exported agent. If not specified, `BLOB` - # is assumed. - # @param environment [::String] - # Optional. Environment name. If not set, draft environment is assumed. - # Format: - # `projects//locations//agents//environments/`. - # @param git_destination [::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest::GitDestination, ::Hash] - # Optional. The Git branch to export the agent to. - # @param include_bigquery_export_settings [::Boolean] - # Optional. Whether to include BigQuery Export setting. - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - ## - # Restores the specified agent from a binary file. - # - # Replaces the current agent with a new one. Note that all existing resources - # in agent (e.g. intents, entity types, flows) will be removed. - # - # 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`: 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 flows prior to sending them queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload restore_agent(request, options = nil) - # Pass arguments to `restore_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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(name: nil, agent_uri: nil, agent_content: nil, git_source: nil, restore_option: 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 name [::String] - # Required. The name of the agent to restore into. - # Format: `projects//locations//agents/`. - # @param agent_uri [::String] - # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI - # to restore agent from. The format of this URI must be - # `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`, `git_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param agent_content [::String] - # Uncompressed raw byte content for agent. - # - # Note: The following parameters are mutually exclusive: `agent_content`, `agent_uri`, `git_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param git_source [::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest::GitSource, ::Hash] - # Setting for restoring from a git branch - # - # Note: The following parameters are mutually exclusive: `git_source`, `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 restore_option [::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest::RestoreOption] - # Agent restore mode. If not specified, `KEEP` is assumed. - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - ## - # Validates the specified agent and creates or updates validation results. - # The agent in draft version is validated. Please call this API after the - # training is completed to get the complete validation results. - # - # @overload validate_agent(request, options = nil) - # Pass arguments to `validate_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload validate_agent(name: nil, language_code: nil) - # Pass arguments to `validate_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 name [::String] - # Required. The agent to validate. - # Format: `projects//locations//agents/`. - # @param language_code [::String] - # If not specified, the agent's default language is used. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest.new - # - # # Call the validate_agent method. - # result = client.validate_agent request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AgentValidationResult. - # p result - # - def validate_agent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.validate_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.validate_agent.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.validate_agent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.validate_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 - - ## - # Gets the latest agent validation result. Agent validation is performed - # when ValidateAgent is called. - # - # @overload get_agent_validation_result(request, options = nil) - # Pass arguments to `get_agent_validation_result` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_validation_result(name: nil, language_code: nil) - # Pass arguments to `get_agent_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 name [::String] - # Required. The agent name. - # Format: - # `projects//locations//agents//validationResult`. - # @param language_code [::String] - # If not specified, the agent's default language is used. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest.new - # - # # Call the get_agent_validation_result method. - # result = client.get_agent_validation_result request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AgentValidationResult. - # p result - # - def get_agent_validation_result request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest - - # Converts hash and nil to an 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_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_validation_result.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_agent_validation_result.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.get_agent_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 - - ## - # Gets the generative settings for the agent. - # - # @overload get_generative_settings(request, options = nil) - # Pass arguments to `get_generative_settings` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generative_settings(name: nil, language_code: nil) - # Pass arguments to `get_generative_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Format: - # `projects//locations//agents//generativeSettings`. - # @param language_code [::String] - # Required. Language code of the generative settings. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest.new - # - # # Call the get_generative_settings method. - # result = client.get_generative_settings request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::GenerativeSettings. - # p result - # - def get_generative_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest - - # Converts hash and nil to an 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_generative_settings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_generative_settings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_generative_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.get_generative_settings request, 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 generative settings for the agent. - # - # @overload update_generative_settings(request, options = nil) - # Pass arguments to `update_generative_settings` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generative_settings(generative_settings: nil, update_mask: nil) - # Pass arguments to `update_generative_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param generative_settings [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings, ::Hash] - # Required. Generative settings 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::CX::V3::GenerativeSettings] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest.new - # - # # Call the update_generative_settings method. - # result = client.update_generative_settings request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::GenerativeSettings. - # p result - # - def update_generative_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest - - # Converts hash and nil to an 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_generative_settings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_generative_settings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_generative_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.update_generative_settings request, 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::CX::V3::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 - # # list_agents to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_agents.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_agents.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_agents` - # @return [::Gapic::Config::Method] - # - attr_reader :list_agents - ## - # RPC-specific configuration for `get_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :get_agent - ## - # RPC-specific configuration for `create_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :create_agent - ## - # RPC-specific configuration for `update_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :update_agent - ## - # RPC-specific configuration for `delete_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_agent - ## - # RPC-specific configuration for `export_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :export_agent - ## - # RPC-specific configuration for `restore_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :restore_agent - ## - # RPC-specific configuration for `validate_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :validate_agent - ## - # RPC-specific configuration for `get_agent_validation_result` - # @return [::Gapic::Config::Method] - # - attr_reader :get_agent_validation_result - ## - # RPC-specific configuration for `get_generative_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :get_generative_settings - ## - # RPC-specific configuration for `update_generative_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :update_generative_settings - - # @private - def initialize parent_rpcs = nil - list_agents_config = parent_rpcs.list_agents if parent_rpcs.respond_to? :list_agents - @list_agents = ::Gapic::Config::Method.new list_agents_config - get_agent_config = parent_rpcs.get_agent if parent_rpcs.respond_to? :get_agent - @get_agent = ::Gapic::Config::Method.new get_agent_config - create_agent_config = parent_rpcs.create_agent if parent_rpcs.respond_to? :create_agent - @create_agent = ::Gapic::Config::Method.new create_agent_config - update_agent_config = parent_rpcs.update_agent if parent_rpcs.respond_to? :update_agent - @update_agent = ::Gapic::Config::Method.new update_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 - export_agent_config = parent_rpcs.export_agent if parent_rpcs.respond_to? :export_agent - @export_agent = ::Gapic::Config::Method.new export_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 - validate_agent_config = parent_rpcs.validate_agent if parent_rpcs.respond_to? :validate_agent - @validate_agent = ::Gapic::Config::Method.new validate_agent_config - get_agent_validation_result_config = parent_rpcs.get_agent_validation_result if parent_rpcs.respond_to? :get_agent_validation_result - @get_agent_validation_result = ::Gapic::Config::Method.new get_agent_validation_result_config - get_generative_settings_config = parent_rpcs.get_generative_settings if parent_rpcs.respond_to? :get_generative_settings - @get_generative_settings = ::Gapic::Config::Method.new get_generative_settings_config - update_generative_settings_config = parent_rpcs.update_generative_settings if parent_rpcs.respond_to? :update_generative_settings - @update_generative_settings = ::Gapic::Config::Method.new update_generative_settings_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb deleted file mode 100644 index 7767c8986ec6..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/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 CX - module V3 - 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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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. - # * `: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: "/v3/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3/{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: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3/{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: "/v3/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v3/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb deleted file mode 100644 index 53976a53bf83..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb +++ /dev/null @@ -1,760 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/agent_pb" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - 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 list_agents REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::ListAgentsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::ListAgentsResponse] - # A result object deserialized from the server's reply - def list_agents request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_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: "list_agents", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::ListAgentsResponse.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_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Agent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 create_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::Agent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] - # A result object deserialized from the server's reply - def create_agent request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_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: "create_agent", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::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 update_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::Agent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] - # A result object deserialized from the server's reply - def update_agent request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_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: "update_agent", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 export_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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 restore_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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 validate_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::AgentValidationResult] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] - # A result object deserialized from the server's reply - def validate_agent request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_validate_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: "validate_agent", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult.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_agent_validation_result REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::AgentValidationResult] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] - # A result object deserialized from the server's reply - def get_agent_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_agent_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_agent_validation_result", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult.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_generative_settings REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::GenerativeSettings] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings] - # A result object deserialized from the server's reply - def get_generative_settings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_generative_settings_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_generative_settings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings.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_generative_settings REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::GenerativeSettings] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings] - # A result object deserialized from the server's reply - def update_generative_settings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_generative_settings_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_generative_settings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings.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_agents REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest] - # 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_agents_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/agents", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest] - # 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_agent_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/agents", - body: "agent", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest] - # 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_agent_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v3/{agent.name}", - body: "agent", - matches: [ - ["agent.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the export_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}:export", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the restore_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}:restore", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the validate_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_validate_agent_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{name}:validate", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_agent_validation_result REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest] - # 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_validation_result_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/validationResult/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_generative_settings REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest] - # 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_generative_settings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/generativeSettings/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_generative_settings REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest] - # 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_generative_settings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v3/{generative_settings.name}", - body: "generative_settings", - matches: [ - ["generative_settings.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/generativeSettings/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/audio_config_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/audio_config_pb.rb deleted file mode 100644 index 244fdc51b3b9..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/audio_config_pb.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/audio_config.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/duration_pb' - - -descriptor_data = "\n0google/cloud/dialogflow/cx/v3/audio_config.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\"\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\"{\n\rBargeInConfig\x12\x37\n\x14no_barge_in_duration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x31\n\x0etotal_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"\x8d\x03\n\x10InputAudioConfig\x12I\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32,.google.cloud.dialogflow.cx.v3.AudioEncodingB\x03\xe0\x41\x02\x12\x19\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x12\x18\n\x10\x65nable_word_info\x18\r \x01(\x08\x12\x14\n\x0cphrase_hints\x18\x04 \x03(\t\x12\r\n\x05model\x18\x07 \x01(\t\x12H\n\rmodel_variant\x18\n \x01(\x0e\x32\x31.google.cloud.dialogflow.cx.v3.SpeechModelVariant\x12\x18\n\x10single_utterance\x18\x08 \x01(\x08\x12\x45\n\x0f\x62\x61rge_in_config\x18\x0f \x01(\x0b\x32,.google.cloud.dialogflow.cx.v3.BargeInConfig\x12)\n!opt_out_conformer_model_migration\x18\x1a \x01(\x08\"i\n\x14VoiceSelectionParams\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x43\n\x0bssml_gender\x18\x02 \x01(\x0e\x32..google.cloud.dialogflow.cx.v3.SsmlVoiceGender\"\xb6\x01\n\x16SynthesizeSpeechConfig\x12\x15\n\rspeaking_rate\x18\x01 \x01(\x01\x12\r\n\x05pitch\x18\x02 \x01(\x01\x12\x16\n\x0evolume_gain_db\x18\x03 \x01(\x01\x12\x1a\n\x12\x65\x66\x66\x65\x63ts_profile_id\x18\x05 \x03(\t\x12\x42\n\x05voice\x18\x04 \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.VoiceSelectionParams\"\xd8\x01\n\x11OutputAudioConfig\x12O\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32\x32.google.cloud.dialogflow.cx.v3.OutputAudioEncodingB\x03\xe0\x41\x02\x12\x19\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x12W\n\x18synthesize_speech_config\x18\x03 \x01(\x0b\x32\x35.google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig\"\x82\x02\n\x14TextToSpeechSettings\x12s\n\x19synthesize_speech_configs\x18\x01 \x03(\x0b\x32P.google.cloud.dialogflow.cx.v3.TextToSpeechSettings.SynthesizeSpeechConfigsEntry\x1au\n\x1cSynthesizeSpeechConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x44\n\x05value\x18\x02 \x01(\x0b\x32\x35.google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig:\x02\x38\x01*\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\x8b\x02\n!com.google.cloud.dialogflow.cx.v3B\x10\x41udioConfigProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3\xea\x41U\n\x1b\x61utoml.googleapis.com/Model\x12\x36projects/{project}/locations/{location}/models/{model}b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - SpeechWordInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SpeechWordInfo").msgclass - BargeInConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BargeInConfig").msgclass - InputAudioConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.InputAudioConfig").msgclass - VoiceSelectionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.VoiceSelectionParams").msgclass - SynthesizeSpeechConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig").msgclass - OutputAudioConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.OutputAudioConfig").msgclass - TextToSpeechSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TextToSpeechSettings").msgclass - AudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.AudioEncoding").enummodule - SpeechModelVariant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SpeechModelVariant").enummodule - SsmlVoiceGender = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SsmlVoiceGender").enummodule - OutputAudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.OutputAudioEncoding").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/bindings_override.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/bindings_override.rb deleted file mode 100644 index 2b02b38167a8..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/bindings_override.rb +++ /dev/null @@ -1,77 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See 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 - module CX - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/dialogflow/cx/v3/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new - # - module V3 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Dialogflow", "CX"] - 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: "/v3/{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: "/v3/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelog_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelog_pb.rb deleted file mode 100644 index e397c2dcf543..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelog_pb.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/changelog.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/timestamp_pb' - - -descriptor_data = "\n-google/cloud/dialogflow/cx/v3/changelog.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8b\x01\n\x15ListChangelogsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#dialogflow.googleapis.com/Changelog\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"o\n\x16ListChangelogsResponse\x12<\n\nchangelogs\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.cx.v3.Changelog\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"P\n\x13GetChangelogRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#dialogflow.googleapis.com/Changelog\"\xb4\x02\n\tChangelog\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nuser_email\x18\x02 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x07 \x01(\t\x12\x0e\n\x06\x61\x63tion\x18\x0b \x01(\t\x12\x0c\n\x04type\x18\x08 \x01(\t\x12\x10\n\x08resource\x18\x03 \x01(\t\x12/\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rlanguage_code\x18\x0e \x01(\t:w\xea\x41t\n#dialogflow.googleapis.com/Changelog\x12Mprojects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}2\x87\x04\n\nChangelogs\x12\xc7\x01\n\x0eListChangelogs\x12\x34.google.cloud.dialogflow.cx.v3.ListChangelogsRequest\x1a\x35.google.cloud.dialogflow.cx.v3.ListChangelogsResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v3/{parent=projects/*/locations/*/agents/*}/changelogs\x12\xb4\x01\n\x0cGetChangelog\x12\x32.google.cloud.dialogflow.cx.v3.GetChangelogRequest\x1a(.google.cloud.dialogflow.cx.v3.Changelog\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\x12\x37/v3/{name=projects/*/locations/*/agents/*/changelogs/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xb1\x01\n!com.google.cloud.dialogflow.cx.v3B\x0e\x43hangelogProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ListChangelogsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListChangelogsRequest").msgclass - ListChangelogsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListChangelogsResponse").msgclass - GetChangelogRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetChangelogRequest").msgclass - Changelog = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Changelog").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelog_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelog_services_pb.rb deleted file mode 100644 index 14b28b74492e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelog_services_pb.rb +++ /dev/null @@ -1,49 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/cx/v3/changelog.proto for package 'Google.Cloud.Dialogflow.CX.V3' -# 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/cx/v3/changelog_pb' - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Changelogs - # Service for managing [Changelogs][google.cloud.dialogflow.cx.v3.Changelog]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.cx.v3.Changelogs' - - # Returns the list of Changelogs. - rpc :ListChangelogs, ::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListChangelogsResponse - # Retrieves the specified Changelog. - rpc :GetChangelog, ::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest, ::Google::Cloud::Dialogflow::CX::V3::Changelog - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs.rb deleted file mode 100644 index fe2be82b78aa..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs.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/cx/v3/version" - -require "google/cloud/dialogflow/cx/v3/changelogs/credentials" -require "google/cloud/dialogflow/cx/v3/changelogs/paths" -require "google/cloud/dialogflow/cx/v3/changelogs/client" -require "google/cloud/dialogflow/cx/v3/changelogs/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Changelog Changelogs}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/cx/v3/changelogs" - # client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/cx/v3/changelogs/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.new - # - module Changelogs - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "changelogs", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/changelogs/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb deleted file mode 100644 index 6f21e7c8f3c7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb +++ /dev/null @@ -1,624 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/changelog_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Changelogs - ## - # Client for the Changelogs service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Changelog Changelogs}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :changelogs_stub - - ## - # Configure the Changelogs Client class. - # - # See {::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Changelogs clients - # ::Google::Cloud::Dialogflow::CX::V3::Changelogs::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", "CX", "V3"] - 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 Changelogs 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::CX::V3::Changelogs::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 - @changelogs_stub.universe_domain - end - - ## - # Create a new Changelogs client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Changelogs 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/cx/v3/changelog_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 - - @changelogs_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::CX::V3::Changelogs::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 - ) - - @changelogs_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 = @changelogs_stub.endpoint - config.universe_domain = @changelogs_stub.universe_domain - config.logger = @changelogs_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 - @changelogs_stub.logger - end - - # Service calls - - ## - # Returns the list of Changelogs. - # - # @overload list_changelogs(request, options = nil) - # Pass arguments to `list_changelogs` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_changelogs(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_changelogs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 containing the changelogs. - # Format: `projects//locations//agents/`. - # @param filter [::String] - # The filter string. Supports filter by user_email, resource, type and - # create_time. Some examples: - # 1. By user email: - # user_email = "someone@google.com" - # 2. By resource name: - # resource = "projects/123/locations/global/agents/456/flows/789" - # 3. By resource display name: - # display_name = "my agent" - # 4. By action: - # action = "Create" - # 5. By type: - # type = "flows" - # 6. By create time. Currently predicates on `create_time` and - # `create_time_epoch_seconds` are supported: - # create_time_epoch_seconds > 1551790877 AND create_time <= - # 2017-01-15T01:30:15.01Z - # 7. Combination of above filters: - # resource = "projects/123/locations/global/agents/456/flows/789" - # AND user_email = "someone@google.com" - # AND create_time <= 2017-01-15T01:30:15.01Z - # @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::CX::V3::Changelog>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Changelog>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest.new - # - # # Call the list_changelogs method. - # result = client.list_changelogs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Changelog. - # p item - # end - # - def list_changelogs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest - - # Converts hash and nil to 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_changelogs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_changelogs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_changelogs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @changelogs_stub.call_rpc :list_changelogs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @changelogs_stub, :list_changelogs, 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 Changelog. - # - # @overload get_changelog(request, options = nil) - # Pass arguments to `get_changelog` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_changelog(name: nil) - # Pass arguments to `get_changelog` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 changelog to get. - # Format: - # `projects//locations//agents//changelogs/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Changelog] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Changelog] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest.new - # - # # Call the get_changelog method. - # result = client.get_changelog request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Changelog. - # p result - # - def get_changelog request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest - - # Converts hash and nil to 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_changelog.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_changelog.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_changelog.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @changelogs_stub.call_rpc :get_changelog, request, 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 Changelogs API. - # - # This class represents the configuration for Changelogs, - # 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::CX::V3::Changelogs::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_changelogs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_changelogs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_changelogs.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::CX::V3::Changelogs::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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 Changelogs API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_changelogs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_changelogs - ## - # RPC-specific configuration for `get_changelog` - # @return [::Gapic::Config::Method] - # - attr_reader :get_changelog - - # @private - def initialize parent_rpcs = nil - list_changelogs_config = parent_rpcs.list_changelogs if parent_rpcs.respond_to? :list_changelogs - @list_changelogs = ::Gapic::Config::Method.new list_changelogs_config - get_changelog_config = parent_rpcs.get_changelog if parent_rpcs.respond_to? :get_changelog - @get_changelog = ::Gapic::Config::Method.new get_changelog_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/credentials.rb deleted file mode 100644 index 824acb2ecdb4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Changelogs - # Credentials for the Changelogs 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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/paths.rb deleted file mode 100644 index 3bf87a11adfb..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/paths.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! - - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Changelogs - # Path helper methods for the Changelogs API. - module Paths - ## - # Create a fully-qualified Agent resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # - # @return [::String] - def agent_path project:, location:, agent: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}" - end - - ## - # Create a fully-qualified Changelog resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param changelog [String] - # - # @return [::String] - def changelog_path project:, location:, agent:, changelog: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/changelogs/#{changelog}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest.rb deleted file mode 100644 index e726f27da37e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/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/cx/v3/version" -require "google/cloud/dialogflow/cx/v3/bindings_override" - -require "google/cloud/dialogflow/cx/v3/changelogs/credentials" -require "google/cloud/dialogflow/cx/v3/changelogs/paths" -require "google/cloud/dialogflow/cx/v3/changelogs/rest/client" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Changelog Changelogs}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/cx/v3/changelogs/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.new - # - module Changelogs - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/changelogs/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb deleted file mode 100644 index 03b9fc92e606..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb +++ /dev/null @@ -1,575 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/dialogflow/cx/v3/changelog_pb" -require "google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Changelogs - module Rest - ## - # REST client for the Changelogs service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Changelog Changelogs}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :changelogs_stub - - ## - # Configure the Changelogs Client class. - # - # See {::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Changelogs clients - # ::Google::Cloud::Dialogflow::CX::V3::Changelogs::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", "CX", "V3"] - 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 Changelogs 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::CX::V3::Changelogs::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 - @changelogs_stub.universe_domain - end - - ## - # Create a new Changelogs REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Changelogs 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 - - @changelogs_stub = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @changelogs_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 = @changelogs_stub.endpoint - config.universe_domain = @changelogs_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @changelogs_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 - @changelogs_stub.logger - end - - # Service calls - - ## - # Returns the list of Changelogs. - # - # @overload list_changelogs(request, options = nil) - # Pass arguments to `list_changelogs` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_changelogs(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_changelogs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 containing the changelogs. - # Format: `projects//locations//agents/`. - # @param filter [::String] - # The filter string. Supports filter by user_email, resource, type and - # create_time. Some examples: - # 1. By user email: - # user_email = "someone@google.com" - # 2. By resource name: - # resource = "projects/123/locations/global/agents/456/flows/789" - # 3. By resource display name: - # display_name = "my agent" - # 4. By action: - # action = "Create" - # 5. By type: - # type = "flows" - # 6. By create time. Currently predicates on `create_time` and - # `create_time_epoch_seconds` are supported: - # create_time_epoch_seconds > 1551790877 AND create_time <= - # 2017-01-15T01:30:15.01Z - # 7. Combination of above filters: - # resource = "projects/123/locations/global/agents/456/flows/789" - # AND user_email = "someone@google.com" - # AND create_time <= 2017-01-15T01:30:15.01Z - # @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::CX::V3::Changelog>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Changelog>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest.new - # - # # Call the list_changelogs method. - # result = client.list_changelogs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Changelog. - # p item - # end - # - def list_changelogs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest - - # Converts hash and nil to an 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_changelogs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_changelogs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_changelogs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @changelogs_stub.list_changelogs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @changelogs_stub, :list_changelogs, "changelogs", 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 Changelog. - # - # @overload get_changelog(request, options = nil) - # Pass arguments to `get_changelog` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_changelog(name: nil) - # Pass arguments to `get_changelog` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 changelog to get. - # Format: - # `projects//locations//agents//changelogs/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Changelog] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Changelog] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest.new - # - # # Call the get_changelog method. - # result = client.get_changelog request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Changelog. - # p result - # - def get_changelog request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest - - # Converts hash and nil to an 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_changelog.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_changelog.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_changelog.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @changelogs_stub.get_changelog request, 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 Changelogs REST API. - # - # This class represents the configuration for Changelogs 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::CX::V3::Changelogs::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_changelogs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_changelogs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_changelogs.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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 Changelogs API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_changelogs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_changelogs - ## - # RPC-specific configuration for `get_changelog` - # @return [::Gapic::Config::Method] - # - attr_reader :get_changelog - - # @private - def initialize parent_rpcs = nil - list_changelogs_config = parent_rpcs.list_changelogs if parent_rpcs.respond_to? :list_changelogs - @list_changelogs = ::Gapic::Config::Method.new list_changelogs_config - get_changelog_config = parent_rpcs.get_changelog if parent_rpcs.respond_to? :get_changelog - @get_changelog = ::Gapic::Config::Method.new get_changelog_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb deleted file mode 100644 index 51d3e6f22d24..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb +++ /dev/null @@ -1,205 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/dialogflow/cx/v3/changelog_pb" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Changelogs - module Rest - ## - # REST service stub for the Changelogs 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_changelogs REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::ListChangelogsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::ListChangelogsResponse] - # A result object deserialized from the server's reply - def list_changelogs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_changelogs_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_changelogs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::ListChangelogsResponse.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_changelog REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::Changelog] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Changelog] - # A result object deserialized from the server's reply - def get_changelog request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_changelog_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_changelog", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::Changelog.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_changelogs REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest] - # 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_changelogs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/changelogs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_changelog REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest] - # 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_changelog_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/changelogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/data_store_connection_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/data_store_connection_pb.rb deleted file mode 100644 index d26d07a2049c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/data_store_connection_pb.rb +++ /dev/null @@ -1,62 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/data_store_connection.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/struct_pb' - - -descriptor_data = "\n9google/cloud/dialogflow/cx/v3/data_store_connection.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xc9\x01\n\x13\x44\x61taStoreConnection\x12\x45\n\x0f\x64\x61ta_store_type\x18\x01 \x01(\x0e\x32,.google.cloud.dialogflow.cx.v3.DataStoreType\x12\x12\n\ndata_store\x18\x02 \x01(\t\x12W\n\x18\x64ocument_processing_mode\x18\x04 \x01(\x0e\x32\x35.google.cloud.dialogflow.cx.v3.DocumentProcessingMode\"\xcd\x12\n\x1a\x44\x61taStoreConnectionSignals\x12|\n\x1brewriter_model_call_signals\x18\x01 \x01(\x0b\x32R.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignalsB\x03\xe0\x41\x01\x12\x1c\n\x0frewritten_query\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x65\n\x0fsearch_snippets\x18\x03 \x03(\x0b\x32G.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippetB\x03\xe0\x41\x01\x12\x8d\x01\n$answer_generation_model_call_signals\x18\x04 \x01(\x0b\x32Z.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignalsB\x03\xe0\x41\x01\x12\x13\n\x06\x61nswer\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12_\n\x0c\x61nswer_parts\x18\x06 \x03(\x0b\x32\x44.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPartB\x03\xe0\x41\x01\x12\x63\n\x0e\x63ited_snippets\x18\x07 \x03(\x0b\x32\x46.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippetB\x03\xe0\x41\x01\x12j\n\x11grounding_signals\x18\x08 \x01(\x0b\x32J.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignalsB\x03\xe0\x41\x01\x12\x64\n\x0esafety_signals\x18\t \x01(\x0b\x32G.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignalsB\x03\xe0\x41\x01\x1aX\n\x18RewriterModelCallSignals\x12\x17\n\x0frendered_prompt\x18\x01 \x01(\t\x12\x14\n\x0cmodel_output\x18\x02 \x01(\t\x12\r\n\x05model\x18\x03 \x01(\t\x1av\n\rSearchSnippet\x12\x16\n\x0e\x64ocument_title\x18\x01 \x01(\t\x12\x14\n\x0c\x64ocument_uri\x18\x02 \x01(\t\x12\x0c\n\x04text\x18\x03 \x01(\t\x12)\n\x08metadata\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a`\n AnswerGenerationModelCallSignals\x12\x17\n\x0frendered_prompt\x18\x01 \x01(\t\x12\x14\n\x0cmodel_output\x18\x02 \x01(\t\x12\r\n\x05model\x18\x03 \x01(\t\x1a\x36\n\nAnswerPart\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x1a\n\x12supporting_indices\x18\x02 \x03(\x05\x1a\x86\x01\n\x0c\x43itedSnippet\x12_\n\x0esearch_snippet\x18\x01 \x01(\x0b\x32G.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet\x12\x15\n\rsnippet_index\x18\x02 \x01(\x05\x1a\xdd\x03\n\x10GroundingSignals\x12n\n\x08\x64\x65\x63ision\x18\x01 \x01(\x0e\x32\\.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingDecision\x12n\n\x05score\x18\x02 \x01(\x0e\x32_.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket\"m\n\x11GroundingDecision\x12\"\n\x1eGROUNDING_DECISION_UNSPECIFIED\x10\x00\x12\x19\n\x15\x41\x43\x43\x45PTED_BY_GROUNDING\x10\x01\x12\x19\n\x15REJECTED_BY_GROUNDING\x10\x02\"z\n\x14GroundingScoreBucket\x12&\n\"GROUNDING_SCORE_BUCKET_UNSPECIFIED\x10\x00\x12\x0c\n\x08VERY_LOW\x10\x01\x12\x07\n\x03LOW\x10\x03\x12\n\n\x06MEDIUM\x10\x04\x12\x08\n\x04HIGH\x10\x05\x12\r\n\tVERY_HIGH\x10\x06\x1a\x99\x04\n\rSafetySignals\x12h\n\x08\x64\x65\x63ision\x18\x01 \x01(\x0e\x32V.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.SafetyDecision\x12v\n\x13\x62\x61nned_phrase_match\x18\x02 \x01(\x0e\x32Y.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch\x12\x1d\n\x15matched_banned_phrase\x18\x03 \x01(\t\"m\n\x0eSafetyDecision\x12\x1f\n\x1bSAFETY_DECISION_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x41\x43\x43\x45PTED_BY_SAFETY_CHECK\x10\x01\x12\x1c\n\x18REJECTED_BY_SAFETY_CHECK\x10\x02\"\x97\x01\n\x11\x42\x61nnedPhraseMatch\x12#\n\x1f\x42\x41NNED_PHRASE_MATCH_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x42\x41NNED_PHRASE_MATCH_NONE\x10\x01\x12\x1d\n\x19\x42\x41NNED_PHRASE_MATCH_QUERY\x10\x02\x12 \n\x1c\x42\x41NNED_PHRASE_MATCH_RESPONSE\x10\x03*b\n\rDataStoreType\x12\x1f\n\x1b\x44\x41TA_STORE_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nPUBLIC_WEB\x10\x01\x12\x10\n\x0cUNSTRUCTURED\x10\x02\x12\x0e\n\nSTRUCTURED\x10\x03*]\n\x16\x44ocumentProcessingMode\x12(\n$DOCUMENT_PROCESSING_MODE_UNSPECIFIED\x10\x00\x12\r\n\tDOCUMENTS\x10\x01\x12\n\n\x06\x43HUNKS\x10\x02\x42\xbb\x01\n!com.google.cloud.dialogflow.cx.v3B\x18\x44\x61taStoreConnectionProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Struct", "google/protobuf/struct.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - DataStoreConnection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnection").msgclass - DataStoreConnectionSignals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals").msgclass - DataStoreConnectionSignals::RewriterModelCallSignals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.RewriterModelCallSignals").msgclass - DataStoreConnectionSignals::SearchSnippet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SearchSnippet").msgclass - DataStoreConnectionSignals::AnswerGenerationModelCallSignals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerGenerationModelCallSignals").msgclass - DataStoreConnectionSignals::AnswerPart = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart").msgclass - DataStoreConnectionSignals::CitedSnippet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.CitedSnippet").msgclass - DataStoreConnectionSignals::GroundingSignals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals").msgclass - DataStoreConnectionSignals::GroundingSignals::GroundingDecision = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingDecision").enummodule - DataStoreConnectionSignals::GroundingSignals::GroundingScoreBucket = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.GroundingSignals.GroundingScoreBucket").enummodule - DataStoreConnectionSignals::SafetySignals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals").msgclass - DataStoreConnectionSignals::SafetySignals::SafetyDecision = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.SafetyDecision").enummodule - DataStoreConnectionSignals::SafetySignals::BannedPhraseMatch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.SafetySignals.BannedPhraseMatch").enummodule - DataStoreType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DataStoreType").enummodule - DocumentProcessingMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DocumentProcessingMode").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployment_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployment_pb.rb deleted file mode 100644 index 9dfd45e59043..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployment_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/cx/v3/deployment.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/timestamp_pb' - - -descriptor_data = "\n.google/cloud/dialogflow/cx/v3/deployment.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb3\x05\n\nDeployment\x12\x0c\n\x04name\x18\x01 \x01(\t\x12<\n\x0c\x66low_version\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Version\x12>\n\x05state\x18\x03 \x01(\x0e\x32/.google.cloud.dialogflow.cx.v3.Deployment.State\x12@\n\x06result\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.Deployment.Result\x12.\n\nstart_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x97\x01\n\x06Result\x12N\n\x17\x64\x65ployment_test_results\x18\x01 \x03(\tB-\xfa\x41*\n(dialogflow.googleapis.com/TestCaseResult\x12=\n\nexperiment\x18\x02 \x01(\tB)\xfa\x41&\n$dialogflow.googleapis.com/Experiment\"F\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03:\x96\x01\xea\x41\x92\x01\n$dialogflow.googleapis.com/Deployment\x12jprojects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}\"}\n\x16ListDeploymentsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/Deployment\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"r\n\x17ListDeploymentsResponse\x12>\n\x0b\x64\x65ployments\x18\x01 \x03(\x0b\x32).google.cloud.dialogflow.cx.v3.Deployment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"R\n\x14GetDeploymentRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/Deployment2\xae\x04\n\x0b\x44\x65ployments\x12\xda\x01\n\x0fListDeployments\x12\x35.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest\x1a\x36.google.cloud.dialogflow.cx.v3.ListDeploymentsResponse\"X\xda\x41\x06parent\x82\xd3\xe4\x93\x02I\x12G/v3/{parent=projects/*/locations/*/agents/*/environments/*}/deployments\x12\xc7\x01\n\rGetDeployment\x12\x33.google.cloud.dialogflow.cx.v3.GetDeploymentRequest\x1a).google.cloud.dialogflow.cx.v3.Deployment\"V\xda\x41\x04name\x82\xd3\xe4\x93\x02I\x12G/v3/{name=projects/*/locations/*/agents/*/environments/*/deployments/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xb2\x01\n!com.google.cloud.dialogflow.cx.v3B\x0f\x44\x65ploymentProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - Deployment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Deployment").msgclass - Deployment::Result = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Deployment.Result").msgclass - Deployment::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Deployment.State").enummodule - ListDeploymentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListDeploymentsRequest").msgclass - ListDeploymentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListDeploymentsResponse").msgclass - GetDeploymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetDeploymentRequest").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployment_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployment_services_pb.rb deleted file mode 100644 index 5efd71c0faec..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployment_services_pb.rb +++ /dev/null @@ -1,51 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/cx/v3/deployment.proto for package 'Google.Cloud.Dialogflow.CX.V3' -# 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/cx/v3/deployment_pb' - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Deployments - # Service for managing [Deployments][google.cloud.dialogflow.cx.v3.Deployment]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.cx.v3.Deployments' - - # Returns the list of all deployments in the specified - # [Environment][google.cloud.dialogflow.cx.v3.Environment]. - rpc :ListDeployments, ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsResponse - # Retrieves the specified - # [Deployment][google.cloud.dialogflow.cx.v3.Deployment]. - rpc :GetDeployment, ::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest, ::Google::Cloud::Dialogflow::CX::V3::Deployment - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments.rb deleted file mode 100644 index 2e3eb43326ff..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments.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/cx/v3/version" - -require "google/cloud/dialogflow/cx/v3/deployments/credentials" -require "google/cloud/dialogflow/cx/v3/deployments/paths" -require "google/cloud/dialogflow/cx/v3/deployments/client" -require "google/cloud/dialogflow/cx/v3/deployments/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployments}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/cx/v3/deployments" - # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/cx/v3/deployments/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new - # - module Deployments - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "deployments", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/deployments/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb deleted file mode 100644 index 017d8b7fce00..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb +++ /dev/null @@ -1,606 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/deployment_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Deployments - ## - # Client for the Deployments service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployments}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :deployments_stub - - ## - # Configure the Deployments Client class. - # - # See {::Google::Cloud::Dialogflow::CX::V3::Deployments::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Deployments clients - # ::Google::Cloud::Dialogflow::CX::V3::Deployments::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", "CX", "V3"] - 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 Deployments 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::CX::V3::Deployments::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 - @deployments_stub.universe_domain - end - - ## - # Create a new Deployments client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Deployments 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/cx/v3/deployment_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 - - @deployments_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::CX::V3::Deployments::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 - ) - - @deployments_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 = @deployments_stub.endpoint - config.universe_domain = @deployments_stub.universe_domain - config.logger = @deployments_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 - @deployments_stub.logger - end - - # Service calls - - ## - # Returns the list of all deployments in the specified - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. - # - # @overload list_deployments(request, options = nil) - # Pass arguments to `list_deployments` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_deployments(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_deployments` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to - # list all environments for. Format: - # `projects//locations//agents//environments/`. - # @param page_size [::Integer] - # The maximum number of items to return in a single page. By default 20 and - # at most 100. - # @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::CX::V3::Deployment>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Deployment>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest.new - # - # # Call the list_deployments method. - # result = client.list_deployments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Deployment. - # p item - # end - # - def list_deployments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest - - # Converts hash and nil to 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_deployments.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_deployments.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_deployments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @deployments_stub.call_rpc :list_deployments, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @deployments_stub, :list_deployments, 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 - # {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployment}. - # - # @overload get_deployment(request, options = nil) - # Pass arguments to `get_deployment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_deployment(name: nil) - # Pass arguments to `get_deployment` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 - # {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployment}. Format: - # `projects//locations//agents//environments//deployments/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Deployment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Deployment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest.new - # - # # Call the get_deployment method. - # result = client.get_deployment request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Deployment. - # p result - # - def get_deployment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest - - # Converts hash and nil to 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_deployment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_deployment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_deployment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @deployments_stub.call_rpc :get_deployment, request, 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 Deployments API. - # - # This class represents the configuration for Deployments, - # 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::CX::V3::Deployments::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_deployments to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_deployments.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_deployments.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::CX::V3::Deployments::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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 Deployments API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_deployments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_deployments - ## - # RPC-specific configuration for `get_deployment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_deployment - - # @private - def initialize parent_rpcs = nil - list_deployments_config = parent_rpcs.list_deployments if parent_rpcs.respond_to? :list_deployments - @list_deployments = ::Gapic::Config::Method.new list_deployments_config - get_deployment_config = parent_rpcs.get_deployment if parent_rpcs.respond_to? :get_deployment - @get_deployment = ::Gapic::Config::Method.new get_deployment_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/credentials.rb deleted file mode 100644 index 4721d9d99ca2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Deployments - # Credentials for the Deployments 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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/paths.rb deleted file mode 100644 index 7ed8ea8adf5f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/paths.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - module Deployments - # Path helper methods for the Deployments API. - module Paths - ## - # Create a fully-qualified Deployment resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param environment [String] - # @param deployment [String] - # - # @return [::String] - def deployment_path project:, location:, agent:, environment:, deployment: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}/deployments/#{deployment}" - end - - ## - # Create a fully-qualified Environment resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param environment [String] - # - # @return [::String] - def environment_path project:, location:, agent:, environment: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest.rb deleted file mode 100644 index 96109c156abf..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/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/cx/v3/version" -require "google/cloud/dialogflow/cx/v3/bindings_override" - -require "google/cloud/dialogflow/cx/v3/deployments/credentials" -require "google/cloud/dialogflow/cx/v3/deployments/paths" -require "google/cloud/dialogflow/cx/v3/deployments/rest/client" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployments}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/cx/v3/deployments/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new - # - module Deployments - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/deployments/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb deleted file mode 100644 index 021b9399873d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb +++ /dev/null @@ -1,557 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/deployment_pb" -require "google/cloud/dialogflow/cx/v3/deployments/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Deployments - module Rest - ## - # REST client for the Deployments service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployments}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :deployments_stub - - ## - # Configure the Deployments Client class. - # - # See {::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Deployments clients - # ::Google::Cloud::Dialogflow::CX::V3::Deployments::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", "CX", "V3"] - 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 Deployments 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::CX::V3::Deployments::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 - @deployments_stub.universe_domain - end - - ## - # Create a new Deployments REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Deployments 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 - - @deployments_stub = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @deployments_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 = @deployments_stub.endpoint - config.universe_domain = @deployments_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @deployments_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 - @deployments_stub.logger - end - - # Service calls - - ## - # Returns the list of all deployments in the specified - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. - # - # @overload list_deployments(request, options = nil) - # Pass arguments to `list_deployments` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_deployments(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_deployments` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to - # list all environments for. Format: - # `projects//locations//agents//environments/`. - # @param page_size [::Integer] - # The maximum number of items to return in a single page. By default 20 and - # at most 100. - # @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::CX::V3::Deployment>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Deployment>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest.new - # - # # Call the list_deployments method. - # result = client.list_deployments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Deployment. - # p item - # end - # - def list_deployments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest - - # Converts hash and nil to an 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_deployments.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_deployments.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_deployments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @deployments_stub.list_deployments request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @deployments_stub, :list_deployments, "deployments", 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 - # {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployment}. - # - # @overload get_deployment(request, options = nil) - # Pass arguments to `get_deployment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_deployment(name: nil) - # Pass arguments to `get_deployment` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 - # {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployment}. Format: - # `projects//locations//agents//environments//deployments/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Deployment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Deployment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest.new - # - # # Call the get_deployment method. - # result = client.get_deployment request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Deployment. - # p result - # - def get_deployment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest - - # Converts hash and nil to an 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_deployment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_deployment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_deployment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @deployments_stub.get_deployment request, 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 Deployments REST API. - # - # This class represents the configuration for Deployments 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::CX::V3::Deployments::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_deployments to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_deployments.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_deployments.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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 Deployments API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_deployments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_deployments - ## - # RPC-specific configuration for `get_deployment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_deployment - - # @private - def initialize parent_rpcs = nil - list_deployments_config = parent_rpcs.list_deployments if parent_rpcs.respond_to? :list_deployments - @list_deployments = ::Gapic::Config::Method.new list_deployments_config - get_deployment_config = parent_rpcs.get_deployment if parent_rpcs.respond_to? :get_deployment - @get_deployment = ::Gapic::Config::Method.new get_deployment_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb deleted file mode 100644 index 1e2fc4b21f06..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb +++ /dev/null @@ -1,205 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/dialogflow/cx/v3/deployment_pb" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Deployments - module Rest - ## - # REST service stub for the Deployments 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_deployments REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::ListDeploymentsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsResponse] - # A result object deserialized from the server's reply - def list_deployments request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_deployments_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_deployments", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsResponse.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_deployment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::Deployment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Deployment] - # A result object deserialized from the server's reply - def get_deployment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_deployment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_deployment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::Deployment.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_deployments REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest] - # 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_deployments_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/deployments", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_deployment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest] - # 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_deployment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/deployments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_type_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_type_pb.rb deleted file mode 100644 index 6ee3d1300a01..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_type_pb.rb +++ /dev/null @@ -1,74 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/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/cx/v3/inline_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n/google/cloud/dialogflow/cx/v3/entity_type.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/inline.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x9a\x06\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\x41\n\x04kind\x18\x03 \x01(\x0e\x32..google.cloud.dialogflow.cx.v3.EntityType.KindB\x03\xe0\x41\x02\x12X\n\x13\x61uto_expansion_mode\x18\x04 \x01(\x0e\x32;.google.cloud.dialogflow.cx.v3.EntityType.AutoExpansionMode\x12\x42\n\x08\x65ntities\x18\x05 \x03(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.EntityType.Entity\x12R\n\x10\x65xcluded_phrases\x18\x06 \x03(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase\x12\x1f\n\x17\x65nable_fuzzy_extraction\x18\x07 \x01(\x08\x12\x0e\n\x06redact\x18\t \x01(\x08\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\x1a$\n\x0e\x45xcludedPhrase\x12\x12\n\x05value\x18\x01 \x01(\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:{\xea\x41x\n$dialogflow.googleapis.com/EntityType\x12Pprojects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}\"\x90\x03\n\x18\x45xportEntityTypesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/EntityType\x12\x19\n\x0c\x65ntity_types\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12\x1f\n\x10\x65ntity_types_uri\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x12*\n\x1b\x65ntity_types_content_inline\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x12\\\n\x0b\x64\x61ta_format\x18\x05 \x01(\x0e\x32\x42.google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest.DataFormatB\x03\xe0\x41\x01\x12\x1a\n\rlanguage_code\x18\x06 \x01(\tB\x03\xe0\x41\x01\"E\n\nDataFormat\x12\x1b\n\x17\x44\x41TA_FORMAT_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42LOB\x10\x01\x12\x10\n\x0cJSON_PACKAGE\x10\x05\x42\r\n\x0b\x64\x65stination\"\xa2\x01\n\x19\x45xportEntityTypesResponse\x12\x1a\n\x10\x65ntity_types_uri\x18\x01 \x01(\tH\x00\x12P\n\x14\x65ntity_types_content\x18\x02 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.InlineDestinationH\x00\x42\x17\n\x15\x65xported_entity_types\"\x1b\n\x19\x45xportEntityTypesMetadata\"\xeb\x03\n\x18ImportEntityTypesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/EntityType\x12\x1a\n\x10\x65ntity_types_uri\x18\x02 \x01(\tH\x00\x12K\n\x14\x65ntity_types_content\x18\x03 \x01(\x0b\x32+.google.cloud.dialogflow.cx.v3.InlineSourceH\x00\x12^\n\x0cmerge_option\x18\x04 \x01(\x0e\x32\x43.google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.MergeOptionB\x03\xe0\x41\x02\x12H\n\x12target_entity_type\x18\x05 \x01(\tB,\xe0\x41\x01\xfa\x41&\n$dialogflow.googleapis.com/EntityType\"n\n\x0bMergeOption\x12\x1c\n\x18MERGE_OPTION_UNSPECIFIED\x10\x00\x12\x0b\n\x07REPLACE\x10\x01\x12\t\n\x05MERGE\x10\x02\x12\n\n\x06RENAME\x10\x03\x12\x13\n\x0fREPORT_CONFLICT\x10\x04\x12\x08\n\x04KEEP\x10\x05\x42\x0e\n\x0c\x65ntity_types\"\xa3\x02\n\x19ImportEntityTypesResponse\x12?\n\x0c\x65ntity_types\x18\x01 \x03(\tB)\xfa\x41&\n$dialogflow.googleapis.com/EntityType\x12l\n\x15\x63onflicting_resources\x18\x02 \x01(\x0b\x32M.google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources\x1aW\n\x14\x43onflictingResources\x12!\n\x19\x65ntity_type_display_names\x18\x01 \x03(\t\x12\x1c\n\x14\x65ntity_display_names\x18\x02 \x03(\t\"\x1b\n\x19ImportEntityTypesMetadata\"\x94\x01\n\x16ListEntityTypesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/EntityType\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"s\n\x17ListEntityTypesResponse\x12?\n\x0c\x65ntity_types\x18\x01 \x03(\x0b\x32).google.cloud.dialogflow.cx.v3.EntityType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"i\n\x14GetEntityTypeRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/EntityType\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\xb3\x01\n\x17\x43reateEntityTypeRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/EntityType\x12\x43\n\x0b\x65ntity_type\x18\x02 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.EntityTypeB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"\xa6\x01\n\x17UpdateEntityTypeRequest\x12\x43\n\x0b\x65ntity_type\x18\x01 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.EntityTypeB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"d\n\x17\x44\x65leteEntityTypeRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/EntityType\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\x32\xef\x0c\n\x0b\x45ntityTypes\x12\xb8\x01\n\rGetEntityType\x12\x33.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest\x1a).google.cloud.dialogflow.cx.v3.EntityType\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v3/{name=projects/*/locations/*/agents/*/entityTypes/*}\x12\xd9\x01\n\x10\x43reateEntityType\x12\x36.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest\x1a).google.cloud.dialogflow.cx.v3.EntityType\"b\xda\x41\x12parent,entity_type\x82\xd3\xe4\x93\x02G\"8/v3/{parent=projects/*/locations/*/agents/*}/entityTypes:\x0b\x65ntity_type\x12\xea\x01\n\x10UpdateEntityType\x12\x36.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest\x1a).google.cloud.dialogflow.cx.v3.EntityType\"s\xda\x41\x17\x65ntity_type,update_mask\x82\xd3\xe4\x93\x02S2D/v3/{entity_type.name=projects/*/locations/*/agents/*/entityTypes/*}:\x0b\x65ntity_type\x12\xab\x01\n\x10\x44\x65leteEntityType\x12\x36.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest\x1a\x16.google.protobuf.Empty\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v3/{name=projects/*/locations/*/agents/*/entityTypes/*}\x12\xcb\x01\n\x0fListEntityTypes\x12\x35.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest\x1a\x36.google.cloud.dialogflow.cx.v3.ListEntityTypesResponse\"I\xda\x41\x06parent\x82\xd3\xe4\x93\x02:\x12\x38/v3/{parent=projects/*/locations/*/agents/*}/entityTypes\x12\xf1\x01\n\x11\x45xportEntityTypes\x12\x37.google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest\x1a\x1d.google.longrunning.Operation\"\x83\x01\xca\x41\x36\n\x19\x45xportEntityTypesResponse\x12\x19\x45xportEntityTypesMetadata\x82\xd3\xe4\x93\x02\x44\"?/v3/{parent=projects/*/locations/*/agents/*}/entityTypes:export:\x01*\x12\xf1\x01\n\x11ImportEntityTypes\x12\x37.google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest\x1a\x1d.google.longrunning.Operation\"\x83\x01\xca\x41\x36\n\x19ImportEntityTypesResponse\x12\x19ImportEntityTypesMetadata\x82\xd3\xe4\x93\x02\x44\"?/v3/{parent=projects/*/locations/*/agents/*}/entityTypes:import:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xb2\x01\n!com.google.cloud.dialogflow.cx.v3B\x0f\x45ntityTypeProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.dialogflow.cx.v3.InlineDestination", "google/cloud/dialogflow/cx/v3/inline.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - EntityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.EntityType").msgclass - EntityType::Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.EntityType.Entity").msgclass - EntityType::ExcludedPhrase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.EntityType.ExcludedPhrase").msgclass - EntityType::Kind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.EntityType.Kind").enummodule - EntityType::AutoExpansionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.EntityType.AutoExpansionMode").enummodule - ExportEntityTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest").msgclass - ExportEntityTypesRequest::DataFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest.DataFormat").enummodule - ExportEntityTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportEntityTypesResponse").msgclass - ExportEntityTypesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportEntityTypesMetadata").msgclass - ImportEntityTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest").msgclass - ImportEntityTypesRequest::MergeOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.MergeOption").enummodule - ImportEntityTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse").msgclass - ImportEntityTypesResponse::ConflictingResources = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportEntityTypesResponse.ConflictingResources").msgclass - ImportEntityTypesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportEntityTypesMetadata").msgclass - ListEntityTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListEntityTypesRequest").msgclass - ListEntityTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListEntityTypesResponse").msgclass - GetEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetEntityTypeRequest").msgclass - CreateEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest").msgclass - UpdateEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest").msgclass - DeleteEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_type_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_type_services_pb.rb deleted file mode 100644 index 8b475e4abab4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_type_services_pb.rb +++ /dev/null @@ -1,71 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/cx/v3/entity_type.proto for package 'Google.Cloud.Dialogflow.CX.V3' -# 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/cx/v3/entity_type_pb' - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module EntityTypes - # Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3.EntityType]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.cx.v3.EntityTypes' - - # Retrieves the specified entity type. - rpc :GetEntityType, ::Google::Cloud::Dialogflow::CX::V3::GetEntityTypeRequest, ::Google::Cloud::Dialogflow::CX::V3::EntityType - # Creates an entity type in the specified agent. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - rpc :CreateEntityType, ::Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest, ::Google::Cloud::Dialogflow::CX::V3::EntityType - # Updates the specified entity type. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - rpc :UpdateEntityType, ::Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest, ::Google::Cloud::Dialogflow::CX::V3::EntityType - # Deletes the specified entity type. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - rpc :DeleteEntityType, ::Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest, ::Google::Protobuf::Empty - # Returns the list of all entity types in the specified agent. - rpc :ListEntityTypes, ::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest, ::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesResponse - # Exports the selected entity types. - rpc :ExportEntityTypes, ::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest, ::Google::Longrunning::Operation - # Imports the specified entitytypes into the agent. - rpc :ImportEntityTypes, ::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types.rb deleted file mode 100644 index 4ddd79c8213f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types.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/cx/v3/version" - -require "google/cloud/dialogflow/cx/v3/entity_types/credentials" -require "google/cloud/dialogflow/cx/v3/entity_types/paths" -require "google/cloud/dialogflow/cx/v3/entity_types/operations" -require "google/cloud/dialogflow/cx/v3/entity_types/client" -require "google/cloud/dialogflow/cx/v3/entity_types/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::EntityType EntityTypes}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/cx/v3/entity_types" - # client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/cx/v3/entity_types/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new - # - module EntityTypes - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "entity_types", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/entity_types/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb deleted file mode 100644 index 333c41fc6259..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb +++ /dev/null @@ -1,1243 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/entity_type_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module EntityTypes - ## - # Client for the EntityTypes service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityTypes::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all EntityTypes clients - # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] - 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::CX::V3::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::CX::V3::EntityTypes::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::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/cx/v3/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::CX::V3::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::CX::V3::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 - - ## - # 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::CX::V3::GetEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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//locations//agents//entityTypes/`. - # @param language_code [::String] - # The language to retrieve the entity type for. The following fields are - # language dependent: - # - # * `EntityType.entities.value` - # * `EntityType.entities.synonyms` - # * `EntityType.excluded_phrases.value` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::EntityType] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetEntityTypeRequest.new - # - # # Call the get_entity_type method. - # result = client.get_entity_type request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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 a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload create_entity_type(request, options = nil) - # Pass arguments to `create_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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//locations//agents/`. - # @param entity_type [::Google::Cloud::Dialogflow::CX::V3::EntityType, ::Hash] - # Required. The entity type to create. - # @param language_code [::String] - # The language of the following fields in `entity_type`: - # - # * `EntityType.entities.value` - # * `EntityType.entities.synonyms` - # * `EntityType.excluded_phrases.value` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::EntityType] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest.new - # - # # Call the create_entity_type method. - # result = client.create_entity_type request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-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 a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload update_entity_type(request, options = nil) - # Pass arguments to `update_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityType, ::Hash] - # Required. The entity type to update. - # @param language_code [::String] - # The language of the following fields in `entity_type`: - # - # * `EntityType.entities.value` - # * `EntityType.entities.synonyms` - # * `EntityType.excluded_phrases.value` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The mask to control which fields get updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::EntityType] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest.new - # - # # Call the update_entity_type method. - # result = client.update_entity_type request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-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 a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload delete_entity_type(request, options = nil) - # Pass arguments to `delete_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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, force: 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//locations//agents//entityTypes/`. - # @param force [::Boolean] - # This field has no effect for entity type not being used. - # For entity types that are used by intents or pages: - # - # * If `force` is set to false, an error will be returned with message - # indicating the referencing resources. - # * If `force` is set to true, Dialogflow will remove the entity type, as - # well as any references to the entity type (i.e. Page - # {::Google::Cloud::Dialogflow::CX::V3::Form::Parameter parameter} of the entity - # type will be changed to - # '@sys.any' and intent - # {::Google::Cloud::Dialogflow::CX::V3::Intent::Parameter parameter} of the - # entity type will be removed). - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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 - - ## - # 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::CX::V3::ListEntityTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 for. - # Format: `projects//locations//agents/`. - # @param language_code [::String] - # The language to list entity types for. The following fields are language - # dependent: - # - # * `EntityType.entities.value` - # * `EntityType.entities.synonyms` - # * `EntityType.excluded_phrases.value` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - # @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::CX::V3::EntityType>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::EntityType>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-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 - - ## - # Exports the selected entity types. - # - # @overload export_entity_types(request, options = nil) - # Pass arguments to `export_entity_types` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_types(parent: nil, entity_types: nil, entity_types_uri: nil, entity_types_content_inline: nil, data_format: nil, language_code: nil) - # Pass arguments to `export_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 parent agent to export entity types. - # Format: `projects//locations//agents/`. - # @param entity_types [::Array<::String>] - # Required. The name of the entity types to export. - # Format: - # `projects//locations//agents//entityTypes/`. - # @param entity_types_uri [::String] - # Optional. The [Google Cloud - # Storage](https://cloud.google.com/storage/docs/) URI to export the entity - # types to. The format of this URI must be - # `gs:///`. - # - # 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). - # - # Note: The following parameters are mutually exclusive: `entity_types_uri`, `entity_types_content_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_types_content_inline [::Boolean] - # Optional. The option to return the serialized entity types inline. - # - # Note: The following parameters are mutually exclusive: `entity_types_content_inline`, `entity_types_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 data_format [::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest::DataFormat] - # Optional. The data format of the exported entity types. If not specified, - # `BLOB` is assumed. - # @param language_code [::String] - # Optional. The language to retrieve the entity type for. The following - # fields are language dependent: - # - # * `EntityType.entities.value` - # * `EntityType.entities.synonyms` - # * `EntityType.excluded_phrases.value` - # - # If not specified, all language dependent fields will be retrieved. - # [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 [::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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest.new - # - # # Call the export_entity_types method. - # result = client.export_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 export_entity_types request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest - - # Converts hash and nil to 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_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::CX::V3::VERSION - metadata[:"x-goog-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_entity_types.timeout, - metadata: metadata, - retry_policy: @config.rpcs.export_entity_types.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.call_rpc :export_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 - - ## - # Imports the specified entitytypes into the agent. - # - # @overload import_entity_types(request, options = nil) - # Pass arguments to `import_entity_types` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_types(parent: nil, entity_types_uri: nil, entity_types_content: nil, merge_option: nil, target_entity_type: nil) - # Pass arguments to `import_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 import the entity types into. - # Format: `projects//locations//agents/`. - # @param entity_types_uri [::String] - # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI - # to import entity types from. The format of this URI must be - # `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: `entity_types_uri`, `entity_types_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 entity_types_content [::Google::Cloud::Dialogflow::CX::V3::InlineSource, ::Hash] - # Uncompressed byte content of entity types. - # - # Note: The following parameters are mutually exclusive: `entity_types_content`, `entity_types_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 merge_option [::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest::MergeOption] - # Required. Merge option for importing entity types. - # @param target_entity_type [::String] - # Optional. The target entity type to import into. - # Format: - # `projects//locations//agents//entity_types/`. - # If set, there should be only one entity type included in - # [entity_types][google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.entity_types], - # of which the type should match the type of the target entity type. All - # {::Google::Cloud::Dialogflow::CX::V3::EntityType#entities entities} in the - # imported entity type will be added to the target entity type. - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest.new - # - # # Call the import_entity_types method. - # result = client.import_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 import_entity_types request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest - - # Converts hash and nil to 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_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::CX::V3::VERSION - metadata[:"x-goog-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_entity_types.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_entity_types.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.call_rpc :import_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 - - ## - # 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::CX::V3::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 - # # get_entity_type to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_entity_type.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_entity_type.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::CX::V3::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. - # * `: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. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # 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 `list_entity_types` - # @return [::Gapic::Config::Method] - # - attr_reader :list_entity_types - ## - # RPC-specific configuration for `export_entity_types` - # @return [::Gapic::Config::Method] - # - attr_reader :export_entity_types - ## - # RPC-specific configuration for `import_entity_types` - # @return [::Gapic::Config::Method] - # - attr_reader :import_entity_types - - # @private - def initialize parent_rpcs = nil - 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 - 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 - export_entity_types_config = parent_rpcs.export_entity_types if parent_rpcs.respond_to? :export_entity_types - @export_entity_types = ::Gapic::Config::Method.new export_entity_types_config - import_entity_types_config = parent_rpcs.import_entity_types if parent_rpcs.respond_to? :import_entity_types - @import_entity_types = ::Gapic::Config::Method.new import_entity_types_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/credentials.rb deleted file mode 100644 index 2b351cd1c438..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - 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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/operations.rb deleted file mode 100644 index e93af8ed6ffd..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/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 CX - module V3 - 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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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. - # * `: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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/paths.rb deleted file mode 100644 index be3823154354..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/paths.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! - - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module EntityTypes - # Path helper methods for the EntityTypes API. - module Paths - ## - # Create a fully-qualified Agent resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # - # @return [::String] - def agent_path project:, location:, agent: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}" - end - - ## - # Create a fully-qualified EntityType resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param entity_type [String] - # - # @return [::String] - def entity_type_path project:, location:, agent:, entity_type: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/entityTypes/#{entity_type}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest.rb deleted file mode 100644 index a3136f87ea20..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/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/cx/v3/version" -require "google/cloud/dialogflow/cx/v3/bindings_override" - -require "google/cloud/dialogflow/cx/v3/entity_types/credentials" -require "google/cloud/dialogflow/cx/v3/entity_types/paths" -require "google/cloud/dialogflow/cx/v3/entity_types/rest/operations" -require "google/cloud/dialogflow/cx/v3/entity_types/rest/client" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::EntityType EntityTypes}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/cx/v3/entity_types/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new - # - module EntityTypes - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/entity_types/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb deleted file mode 100644 index c26a929a7fd6..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb +++ /dev/null @@ -1,1159 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/dialogflow/cx/v3/entity_type_pb" -require "google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module EntityTypes - module Rest - ## - # REST client for the EntityTypes service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityTypes::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all EntityTypes clients - # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] - 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::CX::V3::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::CX::V3::EntityTypes::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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 - - ## - # 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::CX::V3::GetEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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//locations//agents//entityTypes/`. - # @param language_code [::String] - # The language to retrieve the entity type for. The following fields are - # language dependent: - # - # * `EntityType.entities.value` - # * `EntityType.entities.synonyms` - # * `EntityType.excluded_phrases.value` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::EntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetEntityTypeRequest.new - # - # # Call the get_entity_type method. - # result = client.get_entity_type request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload create_entity_type(request, options = nil) - # Pass arguments to `create_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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//locations//agents/`. - # @param entity_type [::Google::Cloud::Dialogflow::CX::V3::EntityType, ::Hash] - # Required. The entity type to create. - # @param language_code [::String] - # The language of the following fields in `entity_type`: - # - # * `EntityType.entities.value` - # * `EntityType.entities.synonyms` - # * `EntityType.excluded_phrases.value` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::EntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest.new - # - # # Call the create_entity_type method. - # result = client.create_entity_type request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload update_entity_type(request, options = nil) - # Pass arguments to `update_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityType, ::Hash] - # Required. The entity type to update. - # @param language_code [::String] - # The language of the following fields in `entity_type`: - # - # * `EntityType.entities.value` - # * `EntityType.entities.synonyms` - # * `EntityType.excluded_phrases.value` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The mask to control which fields get updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::EntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest.new - # - # # Call the update_entity_type method. - # result = client.update_entity_type request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload delete_entity_type(request, options = nil) - # Pass arguments to `delete_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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, force: 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//locations//agents//entityTypes/`. - # @param force [::Boolean] - # This field has no effect for entity type not being used. - # For entity types that are used by intents or pages: - # - # * If `force` is set to false, an error will be returned with message - # indicating the referencing resources. - # * If `force` is set to true, Dialogflow will remove the entity type, as - # well as any references to the entity type (i.e. Page - # {::Google::Cloud::Dialogflow::CX::V3::Form::Parameter parameter} of the entity - # type will be changed to - # '@sys.any' and intent - # {::Google::Cloud::Dialogflow::CX::V3::Intent::Parameter parameter} of the - # entity type will be removed). - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - ## - # 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::CX::V3::ListEntityTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 for. - # Format: `projects//locations//agents/`. - # @param language_code [::String] - # The language to list entity types for. The following fields are language - # dependent: - # - # * `EntityType.entities.value` - # * `EntityType.entities.synonyms` - # * `EntityType.excluded_phrases.value` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - # @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::CX::V3::EntityType>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::EntityType>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - ## - # Exports the selected entity types. - # - # @overload export_entity_types(request, options = nil) - # Pass arguments to `export_entity_types` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_types(parent: nil, entity_types: nil, entity_types_uri: nil, entity_types_content_inline: nil, data_format: nil, language_code: nil) - # Pass arguments to `export_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 parent agent to export entity types. - # Format: `projects//locations//agents/`. - # @param entity_types [::Array<::String>] - # Required. The name of the entity types to export. - # Format: - # `projects//locations//agents//entityTypes/`. - # @param entity_types_uri [::String] - # Optional. The [Google Cloud - # Storage](https://cloud.google.com/storage/docs/) URI to export the entity - # types to. The format of this URI must be - # `gs:///`. - # - # 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). - # - # Note: The following parameters are mutually exclusive: `entity_types_uri`, `entity_types_content_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_types_content_inline [::Boolean] - # Optional. The option to return the serialized entity types inline. - # - # Note: The following parameters are mutually exclusive: `entity_types_content_inline`, `entity_types_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 data_format [::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest::DataFormat] - # Optional. The data format of the exported entity types. If not specified, - # `BLOB` is assumed. - # @param language_code [::String] - # Optional. The language to retrieve the entity type for. The following - # fields are language dependent: - # - # * `EntityType.entities.value` - # * `EntityType.entities.synonyms` - # * `EntityType.excluded_phrases.value` - # - # If not specified, all language dependent fields will be retrieved. - # [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 [::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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest.new - # - # # Call the export_entity_types method. - # result = client.export_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 export_entity_types request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest - - # Converts hash and nil to an 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_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_entity_types.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.export_entity_types.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.export_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 - - ## - # Imports the specified entitytypes into the agent. - # - # @overload import_entity_types(request, options = nil) - # Pass arguments to `import_entity_types` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_types(parent: nil, entity_types_uri: nil, entity_types_content: nil, merge_option: nil, target_entity_type: nil) - # Pass arguments to `import_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 import the entity types into. - # Format: `projects//locations//agents/`. - # @param entity_types_uri [::String] - # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI - # to import entity types from. The format of this URI must be - # `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: `entity_types_uri`, `entity_types_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 entity_types_content [::Google::Cloud::Dialogflow::CX::V3::InlineSource, ::Hash] - # Uncompressed byte content of entity types. - # - # Note: The following parameters are mutually exclusive: `entity_types_content`, `entity_types_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 merge_option [::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest::MergeOption] - # Required. Merge option for importing entity types. - # @param target_entity_type [::String] - # Optional. The target entity type to import into. - # Format: - # `projects//locations//agents//entity_types/`. - # If set, there should be only one entity type included in - # [entity_types][google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.entity_types], - # of which the type should match the type of the target entity type. All - # {::Google::Cloud::Dialogflow::CX::V3::EntityType#entities entities} in the - # imported entity type will be added to the target entity type. - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest.new - # - # # Call the import_entity_types method. - # result = client.import_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 import_entity_types request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest - - # Converts hash and nil to an 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_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_entity_types.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_entity_types.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.import_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 - - ## - # 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::CX::V3::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 - # # get_entity_type to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_entity_type.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_entity_type.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # 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 `list_entity_types` - # @return [::Gapic::Config::Method] - # - attr_reader :list_entity_types - ## - # RPC-specific configuration for `export_entity_types` - # @return [::Gapic::Config::Method] - # - attr_reader :export_entity_types - ## - # RPC-specific configuration for `import_entity_types` - # @return [::Gapic::Config::Method] - # - attr_reader :import_entity_types - - # @private - def initialize parent_rpcs = nil - 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 - 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 - export_entity_types_config = parent_rpcs.export_entity_types if parent_rpcs.respond_to? :export_entity_types - @export_entity_types = ::Gapic::Config::Method.new export_entity_types_config - import_entity_types_config = parent_rpcs.import_entity_types if parent_rpcs.respond_to? :import_entity_types - @import_entity_types = ::Gapic::Config::Method.new import_entity_types_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/operations.rb deleted file mode 100644 index a7f85b3eafd6..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/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 CX - module V3 - 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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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. - # * `: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: "/v3/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3/{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: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3/{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: "/v3/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v3/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb deleted file mode 100644 index ac316c062994..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb +++ /dev/null @@ -1,514 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/entity_type_pb" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - 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 get_entity_type REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::EntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::EntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 list_entity_types REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::ListEntityTypesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 export_entity_types REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_entity_types request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_export_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: "export_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 import_entity_types REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_entity_types request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_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: "import_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 - - ## - # @private - # - # GRPC transcoding helper method for the get_entity_type REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/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::CX::V3::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: "/v3/{parent}/entityTypes", - body: "entity_type", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_entity_type REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{entity_type.name}", - body: "entity_type", - matches: [ - ["entity_type.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/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::CX::V3::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: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/entityTypes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_entity_types REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{parent}/entityTypes", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the export_entity_types REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest] - # 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_entity_types_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/entityTypes:export", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_entity_types REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest] - # 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_entity_types_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/entityTypes:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environment_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environment_pb.rb deleted file mode 100644 index 1e470432e33d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environment_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/cx/v3/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/cx/v3/test_case_pb' -require 'google/cloud/dialogflow/cx/v3/webhook_pb' -require 'google/longrunning/operations_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/cx/v3/environment.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/test_case.proto\x1a+google/cloud/dialogflow/cx/v3/webhook.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xaf\x06\n\x0b\x45nvironment\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12Q\n\x0fversion_configs\x18\x06 \x03(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.Environment.VersionConfig\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12U\n\x11test_cases_config\x18\x07 \x01(\x0b\x32:.google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig\x12P\n\x0ewebhook_config\x18\n \x01(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.Environment.WebhookConfig\x1aK\n\rVersionConfig\x12:\n\x07version\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Version\x1a\x8f\x01\n\x0fTestCasesConfig\x12;\n\ntest_cases\x18\x01 \x03(\tB\'\xfa\x41$\n\"dialogflow.googleapis.com/TestCase\x12\x1d\n\x15\x65nable_continuous_run\x18\x02 \x01(\x08\x12 \n\x18\x65nable_predeployment_run\x18\x03 \x01(\x08\x1aR\n\rWebhookConfig\x12\x41\n\x11webhook_overrides\x18\x01 \x03(\x0b\x32&.google.cloud.dialogflow.cx.v3.Webhook:}\xea\x41z\n%dialogflow.googleapis.com/Environment\x12Qprojects/{project}/locations/{location}/agents/{agent}/environments/{environment}\"\x7f\n\x17ListEnvironmentsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%dialogflow.googleapis.com/Environment\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"u\n\x18ListEnvironmentsResponse\x12@\n\x0c\x65nvironments\x18\x01 \x03(\x0b\x32*.google.cloud.dialogflow.cx.v3.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\"\x9f\x01\n\x18\x43reateEnvironmentRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%dialogflow.googleapis.com/Environment\x12\x44\n\x0b\x65nvironment\x18\x02 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.EnvironmentB\x03\xe0\x41\x02\"\x96\x01\n\x18UpdateEnvironmentRequest\x12\x44\n\x0b\x65nvironment\x18\x01 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.EnvironmentB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"W\n\x18\x44\x65leteEnvironmentRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Environment\"\x85\x01\n\x1fLookupEnvironmentHistoryRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Environment\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"}\n LookupEnvironmentHistoryResponse\x12@\n\x0c\x65nvironments\x18\x01 \x03(\x0b\x32*.google.cloud.dialogflow.cx.v3.Environment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x88\x04\n\x14\x43ontinuousTestResult\x12\x0c\n\x04name\x18\x01 \x01(\t\x12X\n\x06result\x18\x02 \x01(\x0e\x32H.google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult\x12H\n\x11test_case_results\x18\x03 \x03(\tB-\xfa\x41*\n(dialogflow.googleapis.com/TestCaseResult\x12,\n\x08run_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"V\n\x14\x41ggregatedTestResult\x12&\n\"AGGREGATED_TEST_RESULT_UNSPECIFIED\x10\x00\x12\n\n\x06PASSED\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02:\xb7\x01\xea\x41\xb3\x01\n.dialogflow.googleapis.com/ContinuousTestResult\x12\x80\x01projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}\"^\n\x18RunContinuousTestRequest\x12\x42\n\x0b\x65nvironment\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Environment\"p\n\x19RunContinuousTestResponse\x12S\n\x16\x63ontinuous_test_result\x18\x01 \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.ContinuousTestResult\"U\n\x19RunContinuousTestMetadata\x12\x38\n\x06\x65rrors\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.cx.v3.TestError\"\x91\x01\n ListContinuousTestResultsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.dialogflow.googleapis.com/ContinuousTestResult\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x92\x01\n!ListContinuousTestResultsResponse\x12T\n\x17\x63ontinuous_test_results\x18\x01 \x03(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.ContinuousTestResult\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x98\x01\n\x11\x44\x65ployFlowRequest\x12\x42\n\x0b\x65nvironment\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Environment\x12?\n\x0c\x66low_version\x18\x02 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Version\"i\n\x12\x44\x65ployFlowResponse\x12?\n\x0b\x65nvironment\x18\x01 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.Environment\x12\x12\n\ndeployment\x18\x02 \x01(\t\"S\n\x12\x44\x65ployFlowMetadata\x12=\n\x0btest_errors\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.cx.v3.TestError2\xc4\x11\n\x0c\x45nvironments\x12\xcf\x01\n\x10ListEnvironments\x12\x36.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest\x1a\x37.google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v3/{parent=projects/*/locations/*/agents/*}/environments\x12\xbc\x01\n\x0eGetEnvironment\x12\x34.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest\x1a*.google.cloud.dialogflow.cx.v3.Environment\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v3/{name=projects/*/locations/*/agents/*/environments/*}\x12\xf9\x01\n\x11\x43reateEnvironment\x12\x37.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41%\n\x0b\x45nvironment\x12\x16google.protobuf.Struct\xda\x41\x12parent,environment\x82\xd3\xe4\x93\x02H\"9/v3/{parent=projects/*/locations/*/agents/*}/environments:\x0b\x65nvironment\x12\x8a\x02\n\x11UpdateEnvironment\x12\x37.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest\x1a\x1d.google.longrunning.Operation\"\x9c\x01\xca\x41%\n\x0b\x45nvironment\x12\x16google.protobuf.Struct\xda\x41\x17\x65nvironment,update_mask\x82\xd3\xe4\x93\x02T2E/v3/{environment.name=projects/*/locations/*/agents/*/environments/*}:\x0b\x65nvironment\x12\xae\x01\n\x11\x44\x65leteEnvironment\x12\x37.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest\x1a\x16.google.protobuf.Empty\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;*9/v3/{name=projects/*/locations/*/agents/*/environments/*}\x12\xfe\x01\n\x18LookupEnvironmentHistory\x12>.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest\x1a?.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse\"a\xda\x41\x04name\x82\xd3\xe4\x93\x02T\x12R/v3/{name=projects/*/locations/*/agents/*/environments/*}:lookupEnvironmentHistory\x12\x84\x02\n\x11RunContinuousTest\x12\x37.google.cloud.dialogflow.cx.v3.RunContinuousTestRequest\x1a\x1d.google.longrunning.Operation\"\x96\x01\xca\x41\x36\n\x19RunContinuousTestResponse\x12\x19RunContinuousTestMetadata\x82\xd3\xe4\x93\x02W\"R/v3/{environment=projects/*/locations/*/agents/*/environments/*}:runContinuousTest:\x01*\x12\x82\x02\n\x19ListContinuousTestResults\x12?.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest\x1a@.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse\"b\xda\x41\x06parent\x82\xd3\xe4\x93\x02S\x12Q/v3/{parent=projects/*/locations/*/agents/*/environments/*}/continuousTestResults\x12\xe1\x01\n\nDeployFlow\x12\x30.google.cloud.dialogflow.cx.v3.DeployFlowRequest\x1a\x1d.google.longrunning.Operation\"\x81\x01\xca\x41(\n\x12\x44\x65ployFlowResponse\x12\x12\x44\x65ployFlowMetadata\x82\xd3\xe4\x93\x02P\"K/v3/{environment=projects/*/locations/*/agents/*/environments/*}:deployFlow:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xb3\x01\n!com.google.cloud.dialogflow.cx.v3B\x10\x45nvironmentProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.dialogflow.cx.v3.Webhook", "google/cloud/dialogflow/cx/v3/webhook.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.cloud.dialogflow.cx.v3.TestError", "google/cloud/dialogflow/cx/v3/test_case.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - Environment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Environment").msgclass - Environment::VersionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Environment.VersionConfig").msgclass - Environment::TestCasesConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig").msgclass - Environment::WebhookConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Environment.WebhookConfig").msgclass - ListEnvironmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest").msgclass - ListEnvironmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse").msgclass - GetEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetEnvironmentRequest").msgclass - CreateEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest").msgclass - UpdateEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest").msgclass - DeleteEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest").msgclass - LookupEnvironmentHistoryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest").msgclass - LookupEnvironmentHistoryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse").msgclass - ContinuousTestResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ContinuousTestResult").msgclass - ContinuousTestResult::AggregatedTestResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult").enummodule - RunContinuousTestRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RunContinuousTestRequest").msgclass - RunContinuousTestResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RunContinuousTestResponse").msgclass - RunContinuousTestMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata").msgclass - ListContinuousTestResultsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest").msgclass - ListContinuousTestResultsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse").msgclass - DeployFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeployFlowRequest").msgclass - DeployFlowResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeployFlowResponse").msgclass - DeployFlowMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeployFlowMetadata").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environment_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environment_services_pb.rb deleted file mode 100644 index 904483183374..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environment_services_pb.rb +++ /dev/null @@ -1,106 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/cx/v3/environment.proto for package 'Google.Cloud.Dialogflow.CX.V3' -# 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/cx/v3/environment_pb' - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Environments - # Service for managing - # [Environments][google.cloud.dialogflow.cx.v3.Environment]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.cx.v3.Environments' - - # Returns the list of all environments in the specified - # [Agent][google.cloud.dialogflow.cx.v3.Agent]. - rpc :ListEnvironments, ::Google::Cloud::Dialogflow::CX::V3::ListEnvironmentsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListEnvironmentsResponse - # Retrieves the specified - # [Environment][google.cloud.dialogflow.cx.v3.Environment]. - rpc :GetEnvironment, ::Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest, ::Google::Cloud::Dialogflow::CX::V3::Environment - # Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the - # specified [Agent][google.cloud.dialogflow.cx.v3.Agent]. - # - # 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`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: [Environment][google.cloud.dialogflow.cx.v3.Environment] - rpc :CreateEnvironment, ::Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest, ::Google::Longrunning::Operation - # Updates the specified - # [Environment][google.cloud.dialogflow.cx.v3.Environment]. - # - # 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`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: [Environment][google.cloud.dialogflow.cx.v3.Environment] - rpc :UpdateEnvironment, ::Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest, ::Google::Longrunning::Operation - # Deletes the specified - # [Environment][google.cloud.dialogflow.cx.v3.Environment]. - rpc :DeleteEnvironment, ::Google::Cloud::Dialogflow::CX::V3::DeleteEnvironmentRequest, ::Google::Protobuf::Empty - # Looks up the history of the specified - # [Environment][google.cloud.dialogflow.cx.v3.Environment]. - rpc :LookupEnvironmentHistory, ::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest, ::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryResponse - # Kicks off a continuous test under the specified - # [Environment][google.cloud.dialogflow.cx.v3.Environment]. - # - # 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`: - # [RunContinuousTestMetadata][google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata] - # - `response`: - # [RunContinuousTestResponse][google.cloud.dialogflow.cx.v3.RunContinuousTestResponse] - rpc :RunContinuousTest, ::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest, ::Google::Longrunning::Operation - # Fetches a list of continuous test results for a given environment. - rpc :ListContinuousTestResults, ::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsResponse - # Deploys a flow to the specified - # [Environment][google.cloud.dialogflow.cx.v3.Environment]. - # - # 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`: - # [DeployFlowMetadata][google.cloud.dialogflow.cx.v3.DeployFlowMetadata] - # - `response`: - # [DeployFlowResponse][google.cloud.dialogflow.cx.v3.DeployFlowResponse] - rpc :DeployFlow, ::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments.rb deleted file mode 100644 index bab4ad76c69e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments.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/cx/v3/version" - -require "google/cloud/dialogflow/cx/v3/environments/credentials" -require "google/cloud/dialogflow/cx/v3/environments/paths" -require "google/cloud/dialogflow/cx/v3/environments/operations" -require "google/cloud/dialogflow/cx/v3/environments/client" -require "google/cloud/dialogflow/cx/v3/environments/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environments}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/cx/v3/environments" - # client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/cx/v3/environments/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new - # - module Environments - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "environments", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/environments/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/client.rb deleted file mode 100644 index d35c1676530d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/client.rb +++ /dev/null @@ -1,1382 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/environment_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Environments - ## - # Client for the Environments service. - # - # Service for managing - # {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Environments::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Environments clients - # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] - 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::CX::V3::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::CX::V3::Environments::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::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/cx/v3/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 - - @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 - - @environments_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::CX::V3::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 long-running operations. - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Environments::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 - @environments_stub.logger - end - - # Service calls - - ## - # Returns the list of all environments in the specified - # {::Google::Cloud::Dialogflow::CX::V3::Agent Agent}. - # - # @overload list_environments(request, options = nil) - # Pass arguments to `list_environments` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListEnvironmentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Agent Agent} to list all - # environments for. Format: - # `projects//locations//agents/`. - # @param page_size [::Integer] - # The maximum number of items to return in a single page. By default 20 and - # at most 100. - # @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::CX::V3::Environment>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-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 - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. - # - # @overload get_environment(request, options = nil) - # Pass arguments to `get_environment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. Format: - # `projects//locations//agents//environments/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Environment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Environment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest.new - # - # # Call the get_environment method. - # result = client.get_environment request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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 {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} in the - # specified {::Google::Cloud::Dialogflow::CX::V3::Agent Agent}. - # - # 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`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} - # - # @overload create_environment(request, options = nil) - # Pass arguments to `create_environment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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) - # 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 {::Google::Cloud::Dialogflow::CX::V3::Agent Agent} to create an - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} for. Format: - # `projects//locations//agents/`. - # @param environment [::Google::Cloud::Dialogflow::CX::V3::Environment, ::Hash] - # Required. The environment 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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest.new - # - # # Call the create_environment method. - # result = client.create_environment request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_environment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-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| - 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 - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. - # - # 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`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} - # - # @overload update_environment(request, options = nil) - # Pass arguments to `update_environment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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) - # 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::CX::V3::Environment, ::Hash] - # Required. The environment 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 [::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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest.new - # - # # Call the update_environment method. - # result = client.update_environment request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_environment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-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| - 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 - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. - # - # @overload delete_environment(request, options = nil) - # Pass arguments to `delete_environment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeleteEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to delete. Format: - # `projects//locations//agents//environments/`. - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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 - - ## - # Looks up the history of the specified - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. - # - # @overload lookup_environment_history(request, options = nil) - # Pass arguments to `lookup_environment_history` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload lookup_environment_history(name: nil, page_size: nil, page_token: nil) - # Pass arguments to `lookup_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 name [::String] - # Required. Resource name of the environment to look up the history for. - # Format: - # `projects//locations//agents//environments/`. - # @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::CX::V3::Environment>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest.new - # - # # Call the lookup_environment_history method. - # result = client.lookup_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::CX::V3::Environment. - # p item - # end - # - def lookup_environment_history request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.lookup_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.lookup_environment_history.timeout, - metadata: metadata, - retry_policy: @config.rpcs.lookup_environment_history.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @environments_stub.call_rpc :lookup_environment_history, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @environments_stub, :lookup_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 - - ## - # Kicks off a continuous test under the specified - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. - # - # 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::CX::V3::RunContinuousTestMetadata RunContinuousTestMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestResponse RunContinuousTestResponse} - # - # @overload run_continuous_test(request, options = nil) - # Pass arguments to `run_continuous_test` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload run_continuous_test(environment: nil) - # Pass arguments to `run_continuous_test` via keyword arguments. Note that at - # least one keyword argument is 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 [::String] - # Required. Format: - # `projects//locations//agents//environments/`. - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest.new - # - # # Call the run_continuous_test method. - # result = client.run_continuous_test request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def run_continuous_test request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.run_continuous_test.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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 - header_params["environment"] = request.environment - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.run_continuous_test.timeout, - metadata: metadata, - retry_policy: @config.rpcs.run_continuous_test.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @environments_stub.call_rpc :run_continuous_test, 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 - - ## - # Fetches a list of continuous test results for a given environment. - # - # @overload list_continuous_test_results(request, options = nil) - # Pass arguments to `list_continuous_test_results` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_continuous_test_results(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_continuous_test_results` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The environment to list results for. - # Format: - # `projects//locations//agents//environments/`. - # @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::CX::V3::ContinuousTestResult>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest.new - # - # # Call the list_continuous_test_results method. - # result = client.list_continuous_test_results request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::ContinuousTestResult. - # p item - # end - # - def list_continuous_test_results request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest - - # Converts hash and nil to 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_continuous_test_results.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_continuous_test_results.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_continuous_test_results.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @environments_stub.call_rpc :list_continuous_test_results, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @environments_stub, :list_continuous_test_results, 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 - - ## - # Deploys a flow to the specified - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. - # - # 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::CX::V3::DeployFlowMetadata DeployFlowMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::DeployFlowResponse DeployFlowResponse} - # - # @overload deploy_flow(request, options = nil) - # Pass arguments to `deploy_flow` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_flow(environment: nil, flow_version: nil) - # Pass arguments to `deploy_flow` via keyword arguments. Note that at - # least one keyword argument is 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 [::String] - # Required. The environment to deploy the flow to. - # Format: - # `projects//locations//agents//environments/`. - # @param flow_version [::String] - # Required. The flow version to deploy. - # Format: - # `projects//locations//agents//flows//versions/`. - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest.new - # - # # Call the deploy_flow method. - # result = client.deploy_flow request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_flow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest - - # Converts hash and nil to 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_flow.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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 - header_params["environment"] = request.environment - end - - request_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_flow.timeout, - metadata: metadata, - retry_policy: @config.rpcs.deploy_flow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @environments_stub.call_rpc :deploy_flow, 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 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::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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. - # * `: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. - # * `: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 `lookup_environment_history` - # @return [::Gapic::Config::Method] - # - attr_reader :lookup_environment_history - ## - # RPC-specific configuration for `run_continuous_test` - # @return [::Gapic::Config::Method] - # - attr_reader :run_continuous_test - ## - # RPC-specific configuration for `list_continuous_test_results` - # @return [::Gapic::Config::Method] - # - attr_reader :list_continuous_test_results - ## - # RPC-specific configuration for `deploy_flow` - # @return [::Gapic::Config::Method] - # - attr_reader :deploy_flow - - # @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 - lookup_environment_history_config = parent_rpcs.lookup_environment_history if parent_rpcs.respond_to? :lookup_environment_history - @lookup_environment_history = ::Gapic::Config::Method.new lookup_environment_history_config - run_continuous_test_config = parent_rpcs.run_continuous_test if parent_rpcs.respond_to? :run_continuous_test - @run_continuous_test = ::Gapic::Config::Method.new run_continuous_test_config - list_continuous_test_results_config = parent_rpcs.list_continuous_test_results if parent_rpcs.respond_to? :list_continuous_test_results - @list_continuous_test_results = ::Gapic::Config::Method.new list_continuous_test_results_config - deploy_flow_config = parent_rpcs.deploy_flow if parent_rpcs.respond_to? :deploy_flow - @deploy_flow = ::Gapic::Config::Method.new deploy_flow_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/credentials.rb deleted file mode 100644 index 4fdb595988b6..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - 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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb deleted file mode 100644 index 75b382fcd731..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/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 CX - module V3 - module Environments - # 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 Environments 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 Environments 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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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. - # * `: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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/paths.rb deleted file mode 100644 index 921d6c4a0187..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/paths.rb +++ /dev/null @@ -1,180 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - module Environments - # Path helper methods for the Environments API. - module Paths - ## - # Create a fully-qualified Agent resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # - # @return [::String] - def agent_path project:, location:, agent: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}" - end - - ## - # Create a fully-qualified Environment resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param environment [String] - # - # @return [::String] - def environment_path project:, location:, agent:, environment: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}" - 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 TestCase resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param test_case [String] - # - # @return [::String] - def test_case_path project:, location:, agent:, test_case: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/testCases/#{test_case}" - end - - ## - # Create a fully-qualified Version resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param flow [String] - # @param version [String] - # - # @return [::String] - def version_path project:, location:, agent:, flow:, version: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/versions/#{version}" - end - - ## - # Create a fully-qualified Webhook resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param webhook [String] - # - # @return [::String] - def webhook_path project:, location:, agent:, webhook: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/webhooks/#{webhook}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest.rb deleted file mode 100644 index 8b082ed916ec..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/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/cx/v3/version" -require "google/cloud/dialogflow/cx/v3/bindings_override" - -require "google/cloud/dialogflow/cx/v3/environments/credentials" -require "google/cloud/dialogflow/cx/v3/environments/paths" -require "google/cloud/dialogflow/cx/v3/environments/rest/operations" -require "google/cloud/dialogflow/cx/v3/environments/rest/client" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environments}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/cx/v3/environments/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new - # - module Environments - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/environments/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb deleted file mode 100644 index e66702a594fc..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb +++ /dev/null @@ -1,1284 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/environment_pb" -require "google/cloud/dialogflow/cx/v3/environments/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Environments - module Rest - ## - # REST client for the Environments service. - # - # Service for managing - # {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Environments::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Environments clients - # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] - 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::CX::V3::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::CX::V3::Environments::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::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 - - @operations_client = ::Google::Cloud::Dialogflow::CX::V3::Environments::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 - - @environments_stub = ::Google::Cloud::Dialogflow::CX::V3::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 long-running operations. - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Environments::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 - @environments_stub.logger - end - - # Service calls - - ## - # Returns the list of all environments in the specified - # {::Google::Cloud::Dialogflow::CX::V3::Agent Agent}. - # - # @overload list_environments(request, options = nil) - # Pass arguments to `list_environments` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListEnvironmentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Agent Agent} to list all - # environments for. Format: - # `projects//locations//agents/`. - # @param page_size [::Integer] - # The maximum number of items to return in a single page. By default 20 and - # at most 100. - # @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::CX::V3::Environment>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. - # - # @overload get_environment(request, options = nil) - # Pass arguments to `get_environment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. Format: - # `projects//locations//agents//environments/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Environment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Environment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest.new - # - # # Call the get_environment method. - # result = client.get_environment request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} in the - # specified {::Google::Cloud::Dialogflow::CX::V3::Agent Agent}. - # - # 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`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} - # - # @overload create_environment(request, options = nil) - # Pass arguments to `create_environment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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) - # 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 {::Google::Cloud::Dialogflow::CX::V3::Agent Agent} to create an - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} for. Format: - # `projects//locations//agents/`. - # @param environment [::Google::Cloud::Dialogflow::CX::V3::Environment, ::Hash] - # Required. The environment 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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest.new - # - # # Call the create_environment method. - # result = client.create_environment request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_environment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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| - 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 - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. - # - # 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`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} - # - # @overload update_environment(request, options = nil) - # Pass arguments to `update_environment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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) - # 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::CX::V3::Environment, ::Hash] - # Required. The environment 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 [::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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest.new - # - # # Call the update_environment method. - # result = client.update_environment request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_environment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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| - 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 - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. - # - # @overload delete_environment(request, options = nil) - # Pass arguments to `delete_environment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeleteEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to delete. Format: - # `projects//locations//agents//environments/`. - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - ## - # Looks up the history of the specified - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. - # - # @overload lookup_environment_history(request, options = nil) - # Pass arguments to `lookup_environment_history` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload lookup_environment_history(name: nil, page_size: nil, page_token: nil) - # Pass arguments to `lookup_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 name [::String] - # Required. Resource name of the environment to look up the history for. - # Format: - # `projects//locations//agents//environments/`. - # @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::CX::V3::Environment>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest.new - # - # # Call the lookup_environment_history method. - # result = client.lookup_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::CX::V3::Environment. - # p item - # end - # - def lookup_environment_history request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.lookup_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.lookup_environment_history.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.lookup_environment_history.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @environments_stub.lookup_environment_history request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @environments_stub, :lookup_environment_history, "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 - - ## - # Kicks off a continuous test under the specified - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. - # - # 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::CX::V3::RunContinuousTestMetadata RunContinuousTestMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestResponse RunContinuousTestResponse} - # - # @overload run_continuous_test(request, options = nil) - # Pass arguments to `run_continuous_test` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload run_continuous_test(environment: nil) - # Pass arguments to `run_continuous_test` via keyword arguments. Note that at - # least one keyword argument is 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 [::String] - # Required. Format: - # `projects//locations//agents//environments/`. - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest.new - # - # # Call the run_continuous_test method. - # result = client.run_continuous_test request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def run_continuous_test request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.run_continuous_test.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.run_continuous_test.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.run_continuous_test.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @environments_stub.run_continuous_test 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 - - ## - # Fetches a list of continuous test results for a given environment. - # - # @overload list_continuous_test_results(request, options = nil) - # Pass arguments to `list_continuous_test_results` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_continuous_test_results(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_continuous_test_results` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The environment to list results for. - # Format: - # `projects//locations//agents//environments/`. - # @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::CX::V3::ContinuousTestResult>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest.new - # - # # Call the list_continuous_test_results method. - # result = client.list_continuous_test_results request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::ContinuousTestResult. - # p item - # end - # - def list_continuous_test_results request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest - - # Converts hash and nil to an 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_continuous_test_results.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_continuous_test_results.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_continuous_test_results.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @environments_stub.list_continuous_test_results request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @environments_stub, :list_continuous_test_results, "continuous_test_results", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deploys a flow to the specified - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. - # - # 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::CX::V3::DeployFlowMetadata DeployFlowMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::DeployFlowResponse DeployFlowResponse} - # - # @overload deploy_flow(request, options = nil) - # Pass arguments to `deploy_flow` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_flow(environment: nil, flow_version: nil) - # Pass arguments to `deploy_flow` via keyword arguments. Note that at - # least one keyword argument is 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 [::String] - # Required. The environment to deploy the flow to. - # Format: - # `projects//locations//agents//environments/`. - # @param flow_version [::String] - # Required. The flow version to deploy. - # Format: - # `projects//locations//agents//flows//versions/`. - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest.new - # - # # Call the deploy_flow method. - # result = client.deploy_flow request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_flow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest - - # Converts hash and nil to an 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_flow.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_flow.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.deploy_flow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @environments_stub.deploy_flow 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 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::CX::V3::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::CX::V3::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::CX::V3::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. - # * `: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. - # * `: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 `lookup_environment_history` - # @return [::Gapic::Config::Method] - # - attr_reader :lookup_environment_history - ## - # RPC-specific configuration for `run_continuous_test` - # @return [::Gapic::Config::Method] - # - attr_reader :run_continuous_test - ## - # RPC-specific configuration for `list_continuous_test_results` - # @return [::Gapic::Config::Method] - # - attr_reader :list_continuous_test_results - ## - # RPC-specific configuration for `deploy_flow` - # @return [::Gapic::Config::Method] - # - attr_reader :deploy_flow - - # @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 - lookup_environment_history_config = parent_rpcs.lookup_environment_history if parent_rpcs.respond_to? :lookup_environment_history - @lookup_environment_history = ::Gapic::Config::Method.new lookup_environment_history_config - run_continuous_test_config = parent_rpcs.run_continuous_test if parent_rpcs.respond_to? :run_continuous_test - @run_continuous_test = ::Gapic::Config::Method.new run_continuous_test_config - list_continuous_test_results_config = parent_rpcs.list_continuous_test_results if parent_rpcs.respond_to? :list_continuous_test_results - @list_continuous_test_results = ::Gapic::Config::Method.new list_continuous_test_results_config - deploy_flow_config = parent_rpcs.deploy_flow if parent_rpcs.respond_to? :deploy_flow - @deploy_flow = ::Gapic::Config::Method.new deploy_flow_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb deleted file mode 100644 index ec944a6d50c8..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/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 CX - module V3 - module Environments - 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 Environments 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 Environments 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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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. - # * `: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: "/v3/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3/{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: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3/{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: "/v3/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v3/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb deleted file mode 100644 index dbd50c2ebd70..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb +++ /dev/null @@ -1,636 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/environment_pb" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - 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::CX::V3::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::CX::V3::ListEnvironmentsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::Environment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # 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::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_environment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # 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::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_environment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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 lookup_environment_history REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::LookupEnvironmentHistoryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryResponse] - # A result object deserialized from the server's reply - def lookup_environment_history request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_lookup_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: "lookup_environment_history", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the run_continuous_test REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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 run_continuous_test request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_run_continuous_test_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "run_continuous_test", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_continuous_test_results REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::ListContinuousTestResultsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsResponse] - # A result object deserialized from the server's reply - def list_continuous_test_results request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_continuous_test_results_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_continuous_test_results", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsResponse.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_flow REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_flow request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_deploy_flow_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_flow", - 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_environments REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{parent}/environments", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_environment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_environment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{parent}/environments", - body: "environment", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_environment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{environment.name}", - body: "environment", - matches: [ - ["environment.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_environment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the lookup_environment_history REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_lookup_environment_history_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}:lookupEnvironmentHistory", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the run_continuous_test REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_run_continuous_test_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{environment}:runContinuousTest", - body: "*", - matches: [ - ["environment", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_continuous_test_results REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest] - # 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_continuous_test_results_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/continuousTestResults", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the deploy_flow REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest] - # 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_flow_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{environment}:deployFlow", - body: "*", - matches: [ - ["environment", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiment_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiment_pb.rb deleted file mode 100644 index a220d3bd0185..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiment_pb.rb +++ /dev/null @@ -1,78 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/experiment.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/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n.google/cloud/dialogflow/cx/v3/experiment.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xfb\x10\n\nExperiment\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12>\n\x05state\x18\x04 \x01(\x0e\x32/.google.cloud.dialogflow.cx.v3.Experiment.State\x12H\n\ndefinition\x18\x05 \x01(\x0b\x32\x34.google.cloud.dialogflow.cx.v3.Experiment.Definition\x12\x44\n\x0erollout_config\x18\x0e \x01(\x0b\x32,.google.cloud.dialogflow.cx.v3.RolloutConfig\x12\x42\n\rrollout_state\x18\x0f \x01(\x0b\x32+.google.cloud.dialogflow.cx.v3.RolloutState\x12\x1e\n\x16rollout_failure_reason\x18\x10 \x01(\t\x12@\n\x06result\x18\x06 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.Experiment.Result\x12/\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nstart_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x10last_update_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x11\x65xperiment_length\x18\x0b \x01(\x0b\x32\x19.google.protobuf.Duration\x12H\n\x10variants_history\x18\x0c \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.VariantsHistory\x1aw\n\nDefinition\x12\x11\n\tcondition\x18\x01 \x01(\t\x12J\n\x10version_variants\x18\x02 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.VersionVariantsH\x00\x42\n\n\x08variants\x1a\x8b\x08\n\x06Result\x12X\n\x0fversion_metrics\x18\x01 \x03(\x0b\x32?.google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics\x12\x34\n\x10last_update_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1ag\n\x12\x43onfidenceInterval\x12\x18\n\x10\x63onfidence_level\x18\x01 \x01(\x01\x12\r\n\x05ratio\x18\x02 \x01(\x01\x12\x13\n\x0blower_bound\x18\x03 \x01(\x01\x12\x13\n\x0bupper_bound\x18\x04 \x01(\x01\x1a\xb0\x02\n\x06Metric\x12I\n\x04type\x18\x01 \x01(\x0e\x32;.google.cloud.dialogflow.cx.v3.Experiment.Result.MetricType\x12N\n\ncount_type\x18\x05 \x01(\x0e\x32:.google.cloud.dialogflow.cx.v3.Experiment.Result.CountType\x12\x0f\n\x05ratio\x18\x02 \x01(\x01H\x00\x12\x0f\n\x05\x63ount\x18\x04 \x01(\x01H\x00\x12`\n\x13\x63onfidence_interval\x18\x03 \x01(\x0b\x32\x43.google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceIntervalB\x07\n\x05value\x1a\xaa\x01\n\x0eVersionMetrics\x12\x37\n\x07version\x18\x01 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Version\x12H\n\x07metrics\x18\x02 \x03(\x0b\x32\x37.google.cloud.dialogflow.cx.v3.Experiment.Result.Metric\x12\x15\n\rsession_count\x18\x03 \x01(\x05\"\xb6\x01\n\nMetricType\x12\x16\n\x12METRIC_UNSPECIFIED\x10\x00\x12&\n\"CONTAINED_SESSION_NO_CALLBACK_RATE\x10\x01\x12\x1b\n\x17LIVE_AGENT_HANDOFF_RATE\x10\x02\x12\x19\n\x15\x43\x41LLBACK_SESSION_RATE\x10\x03\x12\x1a\n\x16\x41\x42\x41NDONED_SESSION_RATE\x10\x04\x12\x14\n\x10SESSION_END_RATE\x10\x05\"o\n\tCountType\x12\x1a\n\x16\x43OUNT_TYPE_UNSPECIFIED\x10\x00\x12\x18\n\x14TOTAL_NO_MATCH_COUNT\x10\x01\x12\x14\n\x10TOTAL_TURN_COUNT\x10\x02\x12\x16\n\x12\x41VERAGE_TURN_COUNT\x10\x03\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05\x44RAFT\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x08\n\x04\x44ONE\x10\x03\x12\x12\n\x0eROLLOUT_FAILED\x10\x04:\x96\x01\xea\x41\x92\x01\n$dialogflow.googleapis.com/Experiment\x12jprojects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}\"\xad\x01\n\x0fVersionVariants\x12H\n\x08variants\x18\x01 \x03(\x0b\x32\x36.google.cloud.dialogflow.cx.v3.VersionVariants.Variant\x1aP\n\x07Variant\x12\x0f\n\x07version\x18\x01 \x01(\t\x12\x1a\n\x12traffic_allocation\x18\x02 \x01(\x02\x12\x18\n\x10is_control_group\x18\x03 \x01(\x08\"\x9a\x01\n\x0fVariantsHistory\x12J\n\x10version_variants\x18\x01 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.VersionVariantsH\x00\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\n\n\x08variants\"\x85\x02\n\rRolloutConfig\x12O\n\rrollout_steps\x18\x01 \x03(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep\x12\x19\n\x11rollout_condition\x18\x02 \x01(\t\x12\x19\n\x11\x66\x61ilure_condition\x18\x03 \x01(\t\x1am\n\x0bRolloutStep\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x17\n\x0ftraffic_percent\x18\x02 \x01(\x05\x12/\n\x0cmin_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\"`\n\x0cRolloutState\x12\x0c\n\x04step\x18\x01 \x01(\t\x12\x12\n\nstep_index\x18\x03 \x01(\x05\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"}\n\x16ListExperimentsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/Experiment\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"r\n\x17ListExperimentsResponse\x12>\n\x0b\x65xperiments\x18\x01 \x03(\x0b\x32).google.cloud.dialogflow.cx.v3.Experiment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"R\n\x14GetExperimentRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/Experiment\"\x9b\x01\n\x17\x43reateExperimentRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/Experiment\x12\x42\n\nexperiment\x18\x02 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.ExperimentB\x03\xe0\x41\x02\"\x93\x01\n\x17UpdateExperimentRequest\x12\x42\n\nexperiment\x18\x01 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.ExperimentB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"U\n\x17\x44\x65leteExperimentRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/Experiment\"T\n\x16StartExperimentRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/Experiment\"S\n\x15StopExperimentRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/Experiment2\xf8\x0c\n\x0b\x45xperiments\x12\xda\x01\n\x0fListExperiments\x12\x35.google.cloud.dialogflow.cx.v3.ListExperimentsRequest\x1a\x36.google.cloud.dialogflow.cx.v3.ListExperimentsResponse\"X\xda\x41\x06parent\x82\xd3\xe4\x93\x02I\x12G/v3/{parent=projects/*/locations/*/agents/*/environments/*}/experiments\x12\xc7\x01\n\rGetExperiment\x12\x33.google.cloud.dialogflow.cx.v3.GetExperimentRequest\x1a).google.cloud.dialogflow.cx.v3.Experiment\"V\xda\x41\x04name\x82\xd3\xe4\x93\x02I\x12G/v3/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}\x12\xe6\x01\n\x10\x43reateExperiment\x12\x36.google.cloud.dialogflow.cx.v3.CreateExperimentRequest\x1a).google.cloud.dialogflow.cx.v3.Experiment\"o\xda\x41\x11parent,experiment\x82\xd3\xe4\x93\x02U\"G/v3/{parent=projects/*/locations/*/agents/*/environments/*}/experiments:\nexperiment\x12\xf6\x01\n\x10UpdateExperiment\x12\x36.google.cloud.dialogflow.cx.v3.UpdateExperimentRequest\x1a).google.cloud.dialogflow.cx.v3.Experiment\"\x7f\xda\x41\x16\x65xperiment,update_mask\x82\xd3\xe4\x93\x02`2R/v3/{experiment.name=projects/*/locations/*/agents/*/environments/*/experiments/*}:\nexperiment\x12\xba\x01\n\x10\x44\x65leteExperiment\x12\x36.google.cloud.dialogflow.cx.v3.DeleteExperimentRequest\x1a\x16.google.protobuf.Empty\"V\xda\x41\x04name\x82\xd3\xe4\x93\x02I*G/v3/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}\x12\xd4\x01\n\x0fStartExperiment\x12\x35.google.cloud.dialogflow.cx.v3.StartExperimentRequest\x1a).google.cloud.dialogflow.cx.v3.Experiment\"_\xda\x41\x04name\x82\xd3\xe4\x93\x02R\"M/v3/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}:start:\x01*\x12\xd1\x01\n\x0eStopExperiment\x12\x34.google.cloud.dialogflow.cx.v3.StopExperimentRequest\x1a).google.cloud.dialogflow.cx.v3.Experiment\"^\xda\x41\x04name\x82\xd3\xe4\x93\x02Q\"L/v3/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}:stop:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xb2\x01\n!com.google.cloud.dialogflow.cx.v3B\x0f\x45xperimentProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - Experiment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Experiment").msgclass - Experiment::Definition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Experiment.Definition").msgclass - Experiment::Result = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Experiment.Result").msgclass - Experiment::Result::ConfidenceInterval = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Experiment.Result.ConfidenceInterval").msgclass - Experiment::Result::Metric = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Experiment.Result.Metric").msgclass - Experiment::Result::VersionMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Experiment.Result.VersionMetrics").msgclass - Experiment::Result::MetricType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Experiment.Result.MetricType").enummodule - Experiment::Result::CountType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Experiment.Result.CountType").enummodule - Experiment::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Experiment.State").enummodule - VersionVariants = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.VersionVariants").msgclass - VersionVariants::Variant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.VersionVariants.Variant").msgclass - VariantsHistory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.VariantsHistory").msgclass - RolloutConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RolloutConfig").msgclass - RolloutConfig::RolloutStep = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RolloutConfig.RolloutStep").msgclass - RolloutState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RolloutState").msgclass - ListExperimentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListExperimentsRequest").msgclass - ListExperimentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListExperimentsResponse").msgclass - GetExperimentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetExperimentRequest").msgclass - CreateExperimentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateExperimentRequest").msgclass - UpdateExperimentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateExperimentRequest").msgclass - DeleteExperimentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteExperimentRequest").msgclass - StartExperimentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.StartExperimentRequest").msgclass - StopExperimentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.StopExperimentRequest").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiment_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiment_services_pb.rb deleted file mode 100644 index afd96cb6974a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiment_services_pb.rb +++ /dev/null @@ -1,67 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/cx/v3/experiment.proto for package 'Google.Cloud.Dialogflow.CX.V3' -# 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/cx/v3/experiment_pb' - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Experiments - # Service for managing [Experiments][google.cloud.dialogflow.cx.v3.Experiment]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.cx.v3.Experiments' - - # Returns the list of all experiments in the specified - # [Environment][google.cloud.dialogflow.cx.v3.Environment]. - rpc :ListExperiments, ::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListExperimentsResponse - # Retrieves the specified - # [Experiment][google.cloud.dialogflow.cx.v3.Experiment]. - rpc :GetExperiment, ::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest, ::Google::Cloud::Dialogflow::CX::V3::Experiment - # Creates an [Experiment][google.cloud.dialogflow.cx.v3.Experiment] in the - # specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. - rpc :CreateExperiment, ::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest, ::Google::Cloud::Dialogflow::CX::V3::Experiment - # Updates the specified - # [Experiment][google.cloud.dialogflow.cx.v3.Experiment]. - rpc :UpdateExperiment, ::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest, ::Google::Cloud::Dialogflow::CX::V3::Experiment - # Deletes the specified - # [Experiment][google.cloud.dialogflow.cx.v3.Experiment]. - rpc :DeleteExperiment, ::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest, ::Google::Protobuf::Empty - # Starts the specified - # [Experiment][google.cloud.dialogflow.cx.v3.Experiment]. This rpc only - # changes the state of experiment from PENDING to RUNNING. - rpc :StartExperiment, ::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest, ::Google::Cloud::Dialogflow::CX::V3::Experiment - # Stops the specified [Experiment][google.cloud.dialogflow.cx.v3.Experiment]. - # This rpc only changes the state of experiment from RUNNING to DONE. - rpc :StopExperiment, ::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest, ::Google::Cloud::Dialogflow::CX::V3::Experiment - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments.rb deleted file mode 100644 index fcb71b9d6eac..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments.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/cx/v3/version" - -require "google/cloud/dialogflow/cx/v3/experiments/credentials" -require "google/cloud/dialogflow/cx/v3/experiments/paths" -require "google/cloud/dialogflow/cx/v3/experiments/client" -require "google/cloud/dialogflow/cx/v3/experiments/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiments}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/cx/v3/experiments" - # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/cx/v3/experiments/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new - # - module Experiments - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "experiments", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/experiments/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb deleted file mode 100644 index e353ed0de832..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb +++ /dev/null @@ -1,1084 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/experiment_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Experiments - ## - # Client for the Experiments service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiments}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :experiments_stub - - ## - # Configure the Experiments Client class. - # - # See {::Google::Cloud::Dialogflow::CX::V3::Experiments::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Experiments clients - # ::Google::Cloud::Dialogflow::CX::V3::Experiments::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", "CX", "V3"] - 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 Experiments 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::CX::V3::Experiments::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 - @experiments_stub.universe_domain - end - - ## - # Create a new Experiments client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Experiments 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/cx/v3/experiment_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 - - @experiments_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::CX::V3::Experiments::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 - ) - - @experiments_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 = @experiments_stub.endpoint - config.universe_domain = @experiments_stub.universe_domain - config.logger = @experiments_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 - @experiments_stub.logger - end - - # Service calls - - ## - # Returns the list of all experiments in the specified - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. - # - # @overload list_experiments(request, options = nil) - # Pass arguments to `list_experiments` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_experiments(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_experiments` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to - # list all environments for. Format: - # `projects//locations//agents//environments/`. - # @param page_size [::Integer] - # The maximum number of items to return in a single page. By default 20 and - # at most 100. - # @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::CX::V3::Experiment>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Experiment>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest.new - # - # # Call the list_experiments method. - # result = client.list_experiments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Experiment. - # p item - # end - # - def list_experiments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest - - # Converts hash and nil to 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_experiments.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_experiments.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_experiments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @experiments_stub.call_rpc :list_experiments, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @experiments_stub, :list_experiments, 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 - # {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}. - # - # @overload get_experiment(request, options = nil) - # Pass arguments to `get_experiment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_experiment(name: nil) - # Pass arguments to `get_experiment` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. Format: - # `projects//locations//agents//environments//experiments/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest.new - # - # # Call the get_experiment method. - # result = client.get_experiment request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. - # p result - # - def get_experiment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest - - # Converts hash and nil to 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_experiment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_experiment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_experiment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @experiments_stub.call_rpc :get_experiment, request, 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 {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment} in the - # specified {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. - # - # @overload create_experiment(request, options = nil) - # Pass arguments to `create_experiment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_experiment(parent: nil, experiment: nil) - # Pass arguments to `create_experiment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The {::Google::Cloud::Dialogflow::CX::V3::Agent Agent} to create an - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} for. Format: - # `projects//locations//agents//environments/`. - # @param experiment [::Google::Cloud::Dialogflow::CX::V3::Experiment, ::Hash] - # Required. The experiment to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest.new - # - # # Call the create_experiment method. - # result = client.create_experiment request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. - # p result - # - def create_experiment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest - - # Converts hash and nil to 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_experiment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_experiment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_experiment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @experiments_stub.call_rpc :create_experiment, request, 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 - # {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}. - # - # @overload update_experiment(request, options = nil) - # Pass arguments to `update_experiment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_experiment(experiment: nil, update_mask: nil) - # Pass arguments to `update_experiment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param experiment [::Google::Cloud::Dialogflow::CX::V3::Experiment, ::Hash] - # Required. The experiment 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::CX::V3::Experiment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest.new - # - # # Call the update_experiment method. - # result = client.update_experiment request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. - # p result - # - def update_experiment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest - - # Converts hash and nil to 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_experiment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.experiment&.name - header_params["experiment.name"] = request.experiment.name - end - - request_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_experiment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_experiment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @experiments_stub.call_rpc :update_experiment, request, 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 - # {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}. - # - # @overload delete_experiment(request, options = nil) - # Pass arguments to `delete_experiment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_experiment(name: nil) - # Pass arguments to `delete_experiment` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to delete. Format: - # `projects//locations//agents//environments//experiments/`. - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest.new - # - # # Call the delete_experiment method. - # result = client.delete_experiment request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_experiment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest - - # Converts hash and nil to 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_experiment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_experiment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_experiment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @experiments_stub.call_rpc :delete_experiment, request, 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 the specified - # {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}. This rpc only - # changes the state of experiment from PENDING to RUNNING. - # - # @overload start_experiment(request, options = nil) - # Pass arguments to `start_experiment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload start_experiment(name: nil) - # Pass arguments to `start_experiment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of the experiment to start. - # Format: - # `projects//locations//agents//environments//experiments/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest.new - # - # # Call the start_experiment method. - # result = client.start_experiment request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. - # p result - # - def start_experiment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.start_experiment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.start_experiment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.start_experiment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @experiments_stub.call_rpc :start_experiment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Stops the specified {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}. - # This rpc only changes the state of experiment from RUNNING to DONE. - # - # @overload stop_experiment(request, options = nil) - # Pass arguments to `stop_experiment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload stop_experiment(name: nil) - # Pass arguments to `stop_experiment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of the experiment to stop. - # Format: - # `projects//locations//agents//environments//experiments/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest.new - # - # # Call the stop_experiment method. - # result = client.stop_experiment request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. - # p result - # - def stop_experiment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.stop_experiment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.stop_experiment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.stop_experiment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @experiments_stub.call_rpc :stop_experiment, request, 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 Experiments API. - # - # This class represents the configuration for Experiments, - # 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::CX::V3::Experiments::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_experiments to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_experiments.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_experiments.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::CX::V3::Experiments::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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 Experiments API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_experiments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_experiments - ## - # RPC-specific configuration for `get_experiment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_experiment - ## - # RPC-specific configuration for `create_experiment` - # @return [::Gapic::Config::Method] - # - attr_reader :create_experiment - ## - # RPC-specific configuration for `update_experiment` - # @return [::Gapic::Config::Method] - # - attr_reader :update_experiment - ## - # RPC-specific configuration for `delete_experiment` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_experiment - ## - # RPC-specific configuration for `start_experiment` - # @return [::Gapic::Config::Method] - # - attr_reader :start_experiment - ## - # RPC-specific configuration for `stop_experiment` - # @return [::Gapic::Config::Method] - # - attr_reader :stop_experiment - - # @private - def initialize parent_rpcs = nil - list_experiments_config = parent_rpcs.list_experiments if parent_rpcs.respond_to? :list_experiments - @list_experiments = ::Gapic::Config::Method.new list_experiments_config - get_experiment_config = parent_rpcs.get_experiment if parent_rpcs.respond_to? :get_experiment - @get_experiment = ::Gapic::Config::Method.new get_experiment_config - create_experiment_config = parent_rpcs.create_experiment if parent_rpcs.respond_to? :create_experiment - @create_experiment = ::Gapic::Config::Method.new create_experiment_config - update_experiment_config = parent_rpcs.update_experiment if parent_rpcs.respond_to? :update_experiment - @update_experiment = ::Gapic::Config::Method.new update_experiment_config - delete_experiment_config = parent_rpcs.delete_experiment if parent_rpcs.respond_to? :delete_experiment - @delete_experiment = ::Gapic::Config::Method.new delete_experiment_config - start_experiment_config = parent_rpcs.start_experiment if parent_rpcs.respond_to? :start_experiment - @start_experiment = ::Gapic::Config::Method.new start_experiment_config - stop_experiment_config = parent_rpcs.stop_experiment if parent_rpcs.respond_to? :stop_experiment - @stop_experiment = ::Gapic::Config::Method.new stop_experiment_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/credentials.rb deleted file mode 100644 index bb206cf0f8e6..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Experiments - # Credentials for the Experiments 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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/paths.rb deleted file mode 100644 index 6f27b01cbe2a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/paths.rb +++ /dev/null @@ -1,102 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - module Experiments - # Path helper methods for the Experiments API. - module Paths - ## - # Create a fully-qualified Environment resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param environment [String] - # - # @return [::String] - def environment_path project:, location:, agent:, environment: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}" - end - - ## - # Create a fully-qualified Experiment resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param environment [String] - # @param experiment [String] - # - # @return [::String] - def experiment_path project:, location:, agent:, environment:, experiment: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}/experiments/#{experiment}" - end - - ## - # Create a fully-qualified Version resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param flow [String] - # @param version [String] - # - # @return [::String] - def version_path project:, location:, agent:, flow:, version: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/versions/#{version}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest.rb deleted file mode 100644 index ac87d5b8b271..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/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/cx/v3/version" -require "google/cloud/dialogflow/cx/v3/bindings_override" - -require "google/cloud/dialogflow/cx/v3/experiments/credentials" -require "google/cloud/dialogflow/cx/v3/experiments/paths" -require "google/cloud/dialogflow/cx/v3/experiments/rest/client" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiments}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/cx/v3/experiments/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new - # - module Experiments - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/experiments/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb deleted file mode 100644 index 375da07d267e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb +++ /dev/null @@ -1,1000 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/dialogflow/cx/v3/experiment_pb" -require "google/cloud/dialogflow/cx/v3/experiments/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Experiments - module Rest - ## - # REST client for the Experiments service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiments}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :experiments_stub - - ## - # Configure the Experiments Client class. - # - # See {::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Experiments clients - # ::Google::Cloud::Dialogflow::CX::V3::Experiments::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", "CX", "V3"] - 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 Experiments 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::CX::V3::Experiments::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 - @experiments_stub.universe_domain - end - - ## - # Create a new Experiments REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Experiments 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 - - @experiments_stub = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @experiments_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 = @experiments_stub.endpoint - config.universe_domain = @experiments_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @experiments_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 - @experiments_stub.logger - end - - # Service calls - - ## - # Returns the list of all experiments in the specified - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. - # - # @overload list_experiments(request, options = nil) - # Pass arguments to `list_experiments` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_experiments(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_experiments` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to - # list all environments for. Format: - # `projects//locations//agents//environments/`. - # @param page_size [::Integer] - # The maximum number of items to return in a single page. By default 20 and - # at most 100. - # @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::CX::V3::Experiment>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Experiment>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest.new - # - # # Call the list_experiments method. - # result = client.list_experiments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Experiment. - # p item - # end - # - def list_experiments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest - - # Converts hash and nil to an 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_experiments.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_experiments.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_experiments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @experiments_stub.list_experiments request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @experiments_stub, :list_experiments, "experiments", 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 - # {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}. - # - # @overload get_experiment(request, options = nil) - # Pass arguments to `get_experiment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_experiment(name: nil) - # Pass arguments to `get_experiment` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. Format: - # `projects//locations//agents//environments//experiments/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest.new - # - # # Call the get_experiment method. - # result = client.get_experiment request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. - # p result - # - def get_experiment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest - - # Converts hash and nil to an 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_experiment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_experiment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_experiment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @experiments_stub.get_experiment request, 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 {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment} in the - # specified {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. - # - # @overload create_experiment(request, options = nil) - # Pass arguments to `create_experiment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_experiment(parent: nil, experiment: nil) - # Pass arguments to `create_experiment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The {::Google::Cloud::Dialogflow::CX::V3::Agent Agent} to create an - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} for. Format: - # `projects//locations//agents//environments/`. - # @param experiment [::Google::Cloud::Dialogflow::CX::V3::Experiment, ::Hash] - # Required. The experiment to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest.new - # - # # Call the create_experiment method. - # result = client.create_experiment request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. - # p result - # - def create_experiment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest - - # Converts hash and nil to an 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_experiment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_experiment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_experiment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @experiments_stub.create_experiment request, 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 - # {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}. - # - # @overload update_experiment(request, options = nil) - # Pass arguments to `update_experiment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_experiment(experiment: nil, update_mask: nil) - # Pass arguments to `update_experiment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param experiment [::Google::Cloud::Dialogflow::CX::V3::Experiment, ::Hash] - # Required. The experiment 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::CX::V3::Experiment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest.new - # - # # Call the update_experiment method. - # result = client.update_experiment request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. - # p result - # - def update_experiment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest - - # Converts hash and nil to an 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_experiment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_experiment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_experiment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @experiments_stub.update_experiment request, 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 - # {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}. - # - # @overload delete_experiment(request, options = nil) - # Pass arguments to `delete_experiment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_experiment(name: nil) - # Pass arguments to `delete_experiment` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to delete. Format: - # `projects//locations//agents//environments//experiments/`. - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest.new - # - # # Call the delete_experiment method. - # result = client.delete_experiment request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_experiment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest - - # Converts hash and nil to an 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_experiment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_experiment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_experiment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @experiments_stub.delete_experiment request, 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 the specified - # {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}. This rpc only - # changes the state of experiment from PENDING to RUNNING. - # - # @overload start_experiment(request, options = nil) - # Pass arguments to `start_experiment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload start_experiment(name: nil) - # Pass arguments to `start_experiment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of the experiment to start. - # Format: - # `projects//locations//agents//environments//experiments/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest.new - # - # # Call the start_experiment method. - # result = client.start_experiment request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. - # p result - # - def start_experiment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.start_experiment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.start_experiment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.start_experiment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @experiments_stub.start_experiment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Stops the specified {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}. - # This rpc only changes the state of experiment from RUNNING to DONE. - # - # @overload stop_experiment(request, options = nil) - # Pass arguments to `stop_experiment` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload stop_experiment(name: nil) - # Pass arguments to `stop_experiment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of the experiment to stop. - # Format: - # `projects//locations//agents//environments//experiments/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest.new - # - # # Call the stop_experiment method. - # result = client.stop_experiment request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. - # p result - # - def stop_experiment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.stop_experiment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.stop_experiment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.stop_experiment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @experiments_stub.stop_experiment request, 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 Experiments REST API. - # - # This class represents the configuration for Experiments 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::CX::V3::Experiments::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_experiments to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_experiments.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_experiments.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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 Experiments API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_experiments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_experiments - ## - # RPC-specific configuration for `get_experiment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_experiment - ## - # RPC-specific configuration for `create_experiment` - # @return [::Gapic::Config::Method] - # - attr_reader :create_experiment - ## - # RPC-specific configuration for `update_experiment` - # @return [::Gapic::Config::Method] - # - attr_reader :update_experiment - ## - # RPC-specific configuration for `delete_experiment` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_experiment - ## - # RPC-specific configuration for `start_experiment` - # @return [::Gapic::Config::Method] - # - attr_reader :start_experiment - ## - # RPC-specific configuration for `stop_experiment` - # @return [::Gapic::Config::Method] - # - attr_reader :stop_experiment - - # @private - def initialize parent_rpcs = nil - list_experiments_config = parent_rpcs.list_experiments if parent_rpcs.respond_to? :list_experiments - @list_experiments = ::Gapic::Config::Method.new list_experiments_config - get_experiment_config = parent_rpcs.get_experiment if parent_rpcs.respond_to? :get_experiment - @get_experiment = ::Gapic::Config::Method.new get_experiment_config - create_experiment_config = parent_rpcs.create_experiment if parent_rpcs.respond_to? :create_experiment - @create_experiment = ::Gapic::Config::Method.new create_experiment_config - update_experiment_config = parent_rpcs.update_experiment if parent_rpcs.respond_to? :update_experiment - @update_experiment = ::Gapic::Config::Method.new update_experiment_config - delete_experiment_config = parent_rpcs.delete_experiment if parent_rpcs.respond_to? :delete_experiment - @delete_experiment = ::Gapic::Config::Method.new delete_experiment_config - start_experiment_config = parent_rpcs.start_experiment if parent_rpcs.respond_to? :start_experiment - @start_experiment = ::Gapic::Config::Method.new start_experiment_config - stop_experiment_config = parent_rpcs.stop_experiment if parent_rpcs.respond_to? :stop_experiment - @stop_experiment = ::Gapic::Config::Method.new stop_experiment_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb deleted file mode 100644 index d804a036cc3a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb +++ /dev/null @@ -1,514 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/experiment_pb" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Experiments - module Rest - ## - # REST service stub for the Experiments 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_experiments REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::ListExperimentsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::ListExperimentsResponse] - # A result object deserialized from the server's reply - def list_experiments request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_experiments_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_experiments", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::ListExperimentsResponse.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_experiment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::Experiment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # A result object deserialized from the server's reply - def get_experiment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_experiment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_experiment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::Experiment.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_experiment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::Experiment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # A result object deserialized from the server's reply - def create_experiment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_experiment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_experiment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::Experiment.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_experiment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::Experiment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # A result object deserialized from the server's reply - def update_experiment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_experiment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_experiment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::Experiment.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_experiment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_experiment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_experiment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_experiment", - 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 start_experiment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::Experiment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # A result object deserialized from the server's reply - def start_experiment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_start_experiment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "start_experiment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::Experiment.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the stop_experiment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::Experiment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # A result object deserialized from the server's reply - def stop_experiment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_stop_experiment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "stop_experiment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::Experiment.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_experiments REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest] - # 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_experiments_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/experiments", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_experiment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest] - # 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_experiment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/experiments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_experiment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest] - # 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_experiment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/experiments", - body: "experiment", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_experiment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest] - # 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_experiment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v3/{experiment.name}", - body: "experiment", - matches: [ - ["experiment.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/experiments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_experiment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest] - # 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_experiment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/experiments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the start_experiment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_start_experiment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{name}:start", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/experiments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the stop_experiment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_stop_experiment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{name}:stop", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/experiments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb deleted file mode 100644 index 60fc2400f4c8..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/flow.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/cx/v3/advanced_settings_pb' -require 'google/cloud/dialogflow/cx/v3/import_strategy_pb' -require 'google/cloud/dialogflow/cx/v3/page_pb' -require 'google/cloud/dialogflow/cx/v3/parameter_definition_pb' -require 'google/cloud/dialogflow/cx/v3/validation_message_pb' -require 'google/longrunning/operations_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/cx/v3/flow.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/advanced_settings.proto\x1a\x33google/cloud/dialogflow/cx/v3/import_strategy.proto\x1a(google/cloud/dialogflow/cx/v3/page.proto\x1a\x38google/cloud/dialogflow/cx/v3/parameter_definition.proto\x1a\x36google/cloud/dialogflow/cx/v3/validation_message.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xac\x03\n\x0bNluSettings\x12H\n\nmodel_type\x18\x01 \x01(\x0e\x32\x34.google.cloud.dialogflow.cx.v3.NluSettings.ModelType\x12 \n\x18\x63lassification_threshold\x18\x03 \x01(\x02\x12Y\n\x13model_training_mode\x18\x04 \x01(\x0e\x32<.google.cloud.dialogflow.cx.v3.NluSettings.ModelTrainingMode\"Y\n\tModelType\x12\x1a\n\x16MODEL_TYPE_UNSPECIFIED\x10\x00\x12\x17\n\x13MODEL_TYPE_STANDARD\x10\x01\x12\x17\n\x13MODEL_TYPE_ADVANCED\x10\x03\"{\n\x11ModelTrainingMode\x12#\n\x1fMODEL_TRAINING_MODE_UNSPECIFIED\x10\x00\x12!\n\x1dMODEL_TRAINING_MODE_AUTOMATIC\x10\x01\x12\x1e\n\x1aMODEL_TRAINING_MODE_MANUAL\x10\x02\"\xad\x08\n\x04\x46low\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12I\n\x11transition_routes\x18\x04 \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.TransitionRoute\x12\x43\n\x0e\x65vent_handlers\x18\n \x03(\x0b\x32+.google.cloud.dialogflow.cx.v3.EventHandler\x12T\n\x17transition_route_groups\x18\x0f \x03(\tB3\xfa\x41\x30\n.dialogflow.googleapis.com/TransitionRouteGroup\x12@\n\x0cnlu_settings\x18\x0b \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.NluSettings\x12J\n\x11\x61\x64vanced_settings\x18\x0e \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x12\x64\n\x1cknowledge_connector_settings\x18\x12 \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettingsB\x03\xe0\x41\x01\x12\\\n\x1binput_parameter_definitions\x18\x1a \x03(\x0b\x32\x32.google.cloud.dialogflow.cx.v3.ParameterDefinitionB\x03\xe0\x41\x01\x12]\n\x1coutput_parameter_definitions\x18\x1b \x03(\x0b\x32\x32.google.cloud.dialogflow.cx.v3.ParameterDefinitionB\x03\xe0\x41\x01\x12_\n\x17multi_language_settings\x18\x1c \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettingsB\x03\xe0\x41\x01\x12\x0e\n\x06locked\x18\x1e \x01(\x08\x1au\n\x15MultiLanguageSettings\x12,\n\x1f\x65nable_multi_language_detection\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12.\n!supported_response_language_codes\x18\x02 \x03(\tB\x03\xe0\x41\x01:h\xea\x41\x65\n\x1e\x64ialogflow.googleapis.com/Flow\x12\x43projects/{project}/locations/{location}/agents/{agent}/flows/{flow}\"\x9a\x01\n\x11\x43reateFlowRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Flow\x12\x36\n\x04\x66low\x18\x02 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.FlowB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"X\n\x11\x44\x65leteFlowRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\"\x88\x01\n\x10ListFlowsRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Flow\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x15\n\rlanguage_code\x18\x04 \x01(\t\"`\n\x11ListFlowsResponse\x12\x32\n\x05\x66lows\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.cx.v3.Flow\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"]\n\x0eGetFlowRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\x93\x01\n\x11UpdateFlowRequest\x12\x36\n\x04\x66low\x18\x01 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.FlowB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"H\n\x10TrainFlowRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\"b\n\x13ValidateFlowRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"}\n\x1eGetFlowValidationResultRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.dialogflow.googleapis.com/FlowValidationResult\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\xb1\x02\n\x14\x46lowValidationResult\x12\x0c\n\x04name\x18\x01 \x01(\t\x12M\n\x13validation_messages\x18\x02 \x03(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.ValidationMessage\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp:\x8a\x01\xea\x41\x86\x01\n.dialogflow.googleapis.com/FlowValidationResult\x12Tprojects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult\"\xf2\x02\n\x11ImportFlowRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Flow\x12\x12\n\x08\x66low_uri\x18\x02 \x01(\tH\x00\x12\x16\n\x0c\x66low_content\x18\x03 \x01(\x0cH\x00\x12T\n\rimport_option\x18\x04 \x01(\x0e\x32=.google.cloud.dialogflow.cx.v3.ImportFlowRequest.ImportOption\x12T\n\x14\x66low_import_strategy\x18\x05 \x01(\x0b\x32\x31.google.cloud.dialogflow.cx.v3.FlowImportStrategyB\x03\xe0\x41\x01\"E\n\x0cImportOption\x12\x1d\n\x19IMPORT_OPTION_UNSPECIFIED\x10\x00\x12\x08\n\x04KEEP\x10\x01\x12\x0c\n\x08\x46\x41LLBACK\x10\x02\x42\x06\n\x04\x66low\"h\n\x12\x46lowImportStrategy\x12R\n\x16global_import_strategy\x18\x01 \x01(\x0e\x32-.google.cloud.dialogflow.cx.v3.ImportStrategyB\x03\xe0\x41\x01\"G\n\x12ImportFlowResponse\x12\x31\n\x04\x66low\x18\x01 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\"\x87\x01\n\x11\x45xportFlowRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12\x15\n\x08\x66low_uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18include_referenced_flows\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"H\n\x12\x45xportFlowResponse\x12\x12\n\x08\x66low_uri\x18\x01 \x01(\tH\x00\x12\x16\n\x0c\x66low_content\x18\x02 \x01(\x0cH\x00\x42\x06\n\x04\x66low2\x98\x10\n\x05\x46lows\x12\xb3\x01\n\nCreateFlow\x12\x30.google.cloud.dialogflow.cx.v3.CreateFlowRequest\x1a#.google.cloud.dialogflow.cx.v3.Flow\"N\xda\x41\x0bparent,flow\x82\xd3\xe4\x93\x02:\"2/v3/{parent=projects/*/locations/*/agents/*}/flows:\x04\x66low\x12\x99\x01\n\nDeleteFlow\x12\x30.google.cloud.dialogflow.cx.v3.DeleteFlowRequest\x1a\x16.google.protobuf.Empty\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34*2/v3/{name=projects/*/locations/*/agents/*/flows/*}\x12\xb3\x01\n\tListFlows\x12/.google.cloud.dialogflow.cx.v3.ListFlowsRequest\x1a\x30.google.cloud.dialogflow.cx.v3.ListFlowsResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v3/{parent=projects/*/locations/*/agents/*}/flows\x12\xa0\x01\n\x07GetFlow\x12-.google.cloud.dialogflow.cx.v3.GetFlowRequest\x1a#.google.cloud.dialogflow.cx.v3.Flow\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v3/{name=projects/*/locations/*/agents/*/flows/*}\x12\xbd\x01\n\nUpdateFlow\x12\x30.google.cloud.dialogflow.cx.v3.UpdateFlowRequest\x1a#.google.cloud.dialogflow.cx.v3.Flow\"X\xda\x41\x10\x66low,update_mask\x82\xd3\xe4\x93\x02?27/v3/{flow.name=projects/*/locations/*/agents/*/flows/*}:\x04\x66low\x12\xd9\x01\n\tTrainFlow\x12/.google.cloud.dialogflow.cx.v3.TrainFlowRequest\x1a\x1d.google.longrunning.Operation\"|\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xda\x41\x04name\x82\xd3\xe4\x93\x02=\"8/v3/{name=projects/*/locations/*/agents/*/flows/*}:train:\x01*\x12\xbf\x01\n\x0cValidateFlow\x12\x32.google.cloud.dialogflow.cx.v3.ValidateFlowRequest\x1a\x33.google.cloud.dialogflow.cx.v3.FlowValidationResult\"F\x82\xd3\xe4\x93\x02@\";/v3/{name=projects/*/locations/*/agents/*/flows/*}:validate:\x01*\x12\xe1\x01\n\x17GetFlowValidationResult\x12=.google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest\x1a\x33.google.cloud.dialogflow.cx.v3.FlowValidationResult\"R\xda\x41\x04name\x82\xd3\xe4\x93\x02\x45\x12\x43/v3/{name=projects/*/locations/*/agents/*/flows/*/validationResult}\x12\xd2\x01\n\nImportFlow\x12\x30.google.cloud.dialogflow.cx.v3.ImportFlowRequest\x1a\x1d.google.longrunning.Operation\"s\xca\x41,\n\x12ImportFlowResponse\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02>\"9/v3/{parent=projects/*/locations/*/agents/*}/flows:import:\x01*\x12\xd2\x01\n\nExportFlow\x12\x30.google.cloud.dialogflow.cx.v3.ExportFlowRequest\x1a\x1d.google.longrunning.Operation\"s\xca\x41,\n\x12\x45xportFlowResponse\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02>\"9/v3/{name=projects/*/locations/*/agents/*/flows/*}:export:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xac\x01\n!com.google.cloud.dialogflow.cx.v3B\tFlowProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.dialogflow.cx.v3.TransitionRoute", "google/cloud/dialogflow/cx/v3/page.proto"], - ["google.cloud.dialogflow.cx.v3.AdvancedSettings", "google/cloud/dialogflow/cx/v3/advanced_settings.proto"], - ["google.cloud.dialogflow.cx.v3.ParameterDefinition", "google/cloud/dialogflow/cx/v3/parameter_definition.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.cloud.dialogflow.cx.v3.ValidationMessage", "google/cloud/dialogflow/cx/v3/validation_message.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - NluSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.NluSettings").msgclass - NluSettings::ModelType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.NluSettings.ModelType").enummodule - NluSettings::ModelTrainingMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.NluSettings.ModelTrainingMode").enummodule - Flow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Flow").msgclass - Flow::MultiLanguageSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Flow.MultiLanguageSettings").msgclass - CreateFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateFlowRequest").msgclass - DeleteFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteFlowRequest").msgclass - ListFlowsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListFlowsRequest").msgclass - ListFlowsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListFlowsResponse").msgclass - GetFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetFlowRequest").msgclass - UpdateFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateFlowRequest").msgclass - TrainFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TrainFlowRequest").msgclass - ValidateFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ValidateFlowRequest").msgclass - GetFlowValidationResultRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest").msgclass - FlowValidationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.FlowValidationResult").msgclass - ImportFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportFlowRequest").msgclass - ImportFlowRequest::ImportOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportFlowRequest.ImportOption").enummodule - FlowImportStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.FlowImportStrategy").msgclass - ImportFlowResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportFlowResponse").msgclass - ExportFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportFlowRequest").msgclass - ExportFlowResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportFlowResponse").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flow_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flow_services_pb.rb deleted file mode 100644 index 3bd1fa467b74..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flow_services_pb.rb +++ /dev/null @@ -1,115 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/cx/v3/flow.proto for package 'Google.Cloud.Dialogflow.CX.V3' -# 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/cx/v3/flow_pb' - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Flows - # Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.cx.v3.Flows' - - # Creates a flow in the specified agent. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - rpc :CreateFlow, ::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest, ::Google::Cloud::Dialogflow::CX::V3::Flow - # Deletes a specified flow. - rpc :DeleteFlow, ::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest, ::Google::Protobuf::Empty - # Returns the list of all flows in the specified agent. - rpc :ListFlows, ::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListFlowsResponse - # Retrieves the specified flow. - rpc :GetFlow, ::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest, ::Google::Cloud::Dialogflow::CX::V3::Flow - # Updates the specified flow. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - rpc :UpdateFlow, ::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest, ::Google::Cloud::Dialogflow::CX::V3::Flow - # Trains the specified flow. Note that only the flow in 'draft' environment - # is trained. - # - # 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`: 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 a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - rpc :TrainFlow, ::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest, ::Google::Longrunning::Operation - # Validates the specified flow and creates or updates validation results. - # Please call this API after the training is completed to get the complete - # validation results. - rpc :ValidateFlow, ::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest, ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult - # Gets the latest flow validation result. Flow validation is performed - # when ValidateFlow is called. - rpc :GetFlowValidationResult, ::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest, ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult - # Imports the specified flow to the specified agent from a binary file. - # - # 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`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: - # [ImportFlowResponse][google.cloud.dialogflow.cx.v3.ImportFlowResponse] - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - rpc :ImportFlow, ::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest, ::Google::Longrunning::Operation - # Exports the specified flow to a binary file. - # - # 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`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: - # [ExportFlowResponse][google.cloud.dialogflow.cx.v3.ExportFlowResponse] - # - # Note that resources (e.g. intents, entities, webhooks) that the flow - # references will also be exported. - rpc :ExportFlow, ::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows.rb deleted file mode 100644 index 774ff03bdb27..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows.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/cx/v3/version" - -require "google/cloud/dialogflow/cx/v3/flows/credentials" -require "google/cloud/dialogflow/cx/v3/flows/paths" -require "google/cloud/dialogflow/cx/v3/flows/operations" -require "google/cloud/dialogflow/cx/v3/flows/client" -require "google/cloud/dialogflow/cx/v3/flows/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Flow Flows}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/cx/v3/flows" - # client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/cx/v3/flows/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new - # - module Flows - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "flows", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/flows/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/client.rb deleted file mode 100644 index ed5fc86f80f2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/client.rb +++ /dev/null @@ -1,1550 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/flow_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Flows - ## - # Client for the Flows service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Flow Flows}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :flows_stub - - ## - # Configure the Flows Client class. - # - # See {::Google::Cloud::Dialogflow::CX::V3::Flows::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Flows clients - # ::Google::Cloud::Dialogflow::CX::V3::Flows::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", "CX", "V3"] - 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 Flows 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::CX::V3::Flows::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 - @flows_stub.universe_domain - end - - ## - # Create a new Flows client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Flows 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/cx/v3/flow_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 - - @flows_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::CX::V3::Flows::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 - ) - - @flows_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 = @flows_stub.endpoint - config.universe_domain = @flows_stub.universe_domain - config.logger = @flows_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Flows::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 - @flows_stub.logger - end - - # Service calls - - ## - # Creates a flow in the specified agent. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload create_flow(request, options = nil) - # Pass arguments to `create_flow` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_flow(parent: nil, flow: nil, language_code: nil) - # Pass arguments to `create_flow` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 flow for. - # Format: `projects//locations//agents/`. - # @param flow [::Google::Cloud::Dialogflow::CX::V3::Flow, ::Hash] - # Required. The flow to create. - # @param language_code [::String] - # The language of the following fields in `flow`: - # - # * `Flow.event_handlers.trigger_fulfillment.messages` - # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` - # * `Flow.transition_routes.trigger_fulfillment.messages` - # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Flow] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest.new - # - # # Call the create_flow method. - # result = client.create_flow request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. - # p result - # - def create_flow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest - - # Converts hash and nil to 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_flow.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_flow.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_flow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @flows_stub.call_rpc :create_flow, request, 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 flow. - # - # @overload delete_flow(request, options = nil) - # Pass arguments to `delete_flow` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_flow(name: nil, force: nil) - # Pass arguments to `delete_flow` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 flow to delete. - # Format: - # `projects//locations//agents//flows/`. - # @param force [::Boolean] - # This field has no effect for flows with no incoming transitions. - # For flows with incoming transitions: - # - # * If `force` is set to false, an error will be returned with message - # indicating the incoming transitions. - # * If `force` is set to true, Dialogflow will remove the flow, as well as - # any transitions to the flow (i.e. [Target - # flow][EventHandler.target_flow] in event handlers or [Target - # flow][TransitionRoute.target_flow] in transition routes that point to - # this flow will be cleared). - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest.new - # - # # Call the delete_flow method. - # result = client.delete_flow request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_flow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest - - # Converts hash and nil to 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_flow.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_flow.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_flow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @flows_stub.call_rpc :delete_flow, request, 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 flows in the specified agent. - # - # @overload list_flows(request, options = nil) - # Pass arguments to `list_flows` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_flows(parent: nil, page_size: nil, page_token: nil, language_code: nil) - # Pass arguments to `list_flows` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 containing the flows. - # Format: `projects//locations//agents/`. - # @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. - # @param language_code [::String] - # The language to list flows for. The following fields are language - # dependent: - # - # * `Flow.event_handlers.trigger_fulfillment.messages` - # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` - # * `Flow.transition_routes.trigger_fulfillment.messages` - # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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 [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Flow>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Flow>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest.new - # - # # Call the list_flows method. - # result = client.list_flows request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Flow. - # p item - # end - # - def list_flows request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest - - # Converts hash and nil to 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_flows.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_flows.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_flows.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @flows_stub.call_rpc :list_flows, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @flows_stub, :list_flows, 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 flow. - # - # @overload get_flow(request, options = nil) - # Pass arguments to `get_flow` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_flow(name: nil, language_code: nil) - # Pass arguments to `get_flow` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 flow to get. - # Format: - # `projects//locations//agents//flows/`. - # @param language_code [::String] - # The language to retrieve the flow for. The following fields are language - # dependent: - # - # * `Flow.event_handlers.trigger_fulfillment.messages` - # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` - # * `Flow.transition_routes.trigger_fulfillment.messages` - # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Flow] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetFlowRequest.new - # - # # Call the get_flow method. - # result = client.get_flow request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. - # p result - # - def get_flow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest - - # Converts hash and nil to 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_flow.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_flow.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_flow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @flows_stub.call_rpc :get_flow, request, 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 flow. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload update_flow(request, options = nil) - # Pass arguments to `update_flow` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_flow(flow: nil, update_mask: nil, language_code: nil) - # Pass arguments to `update_flow` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param flow [::Google::Cloud::Dialogflow::CX::V3::Flow, ::Hash] - # Required. The flow to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The mask to control which fields get updated. If the mask is not present, - # all fields will be updated. - # @param language_code [::String] - # The language of the following fields in `flow`: - # - # * `Flow.event_handlers.trigger_fulfillment.messages` - # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` - # * `Flow.transition_routes.trigger_fulfillment.messages` - # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Flow] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest.new - # - # # Call the update_flow method. - # result = client.update_flow request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. - # p result - # - def update_flow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest - - # Converts hash and nil to 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_flow.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.flow&.name - header_params["flow.name"] = request.flow.name - end - - request_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_flow.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_flow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @flows_stub.call_rpc :update_flow, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Trains the specified flow. Note that only the flow in 'draft' environment - # is trained. - # - # 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`: 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 a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload train_flow(request, options = nil) - # Pass arguments to `train_flow` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_flow(name: nil) - # Pass arguments to `train_flow` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 flow to train. - # Format: - # `projects//locations//agents//flows/`. - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest.new - # - # # Call the train_flow method. - # result = client.train_flow request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_flow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest - - # Converts hash and nil to 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_flow.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_flow.timeout, - metadata: metadata, - retry_policy: @config.rpcs.train_flow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @flows_stub.call_rpc :train_flow, 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 - - ## - # Validates the specified flow and creates or updates validation results. - # Please call this API after the training is completed to get the complete - # validation results. - # - # @overload validate_flow(request, options = nil) - # Pass arguments to `validate_flow` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload validate_flow(name: nil, language_code: nil) - # Pass arguments to `validate_flow` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 flow to validate. - # Format: - # `projects//locations//agents//flows/`. - # @param language_code [::String] - # If not specified, the agent's default language is used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest.new - # - # # Call the validate_flow method. - # result = client.validate_flow request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FlowValidationResult. - # p result - # - def validate_flow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.validate_flow.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.validate_flow.timeout, - metadata: metadata, - retry_policy: @config.rpcs.validate_flow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @flows_stub.call_rpc :validate_flow, request, 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 latest flow validation result. Flow validation is performed - # when ValidateFlow is called. - # - # @overload get_flow_validation_result(request, options = nil) - # Pass arguments to `get_flow_validation_result` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_flow_validation_result(name: nil, language_code: nil) - # Pass arguments to `get_flow_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 name [::String] - # Required. The flow name. - # Format: - # `projects//locations//agents//flows//validationResult`. - # @param language_code [::String] - # If not specified, the agent's default language is used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest.new - # - # # Call the get_flow_validation_result method. - # result = client.get_flow_validation_result request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FlowValidationResult. - # p result - # - def get_flow_validation_result request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest - - # Converts hash and nil to 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_flow_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_flow_validation_result.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_flow_validation_result.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @flows_stub.call_rpc :get_flow_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 - - ## - # Imports the specified flow to the specified agent from a binary file. - # - # 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`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::ImportFlowResponse ImportFlowResponse} - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload import_flow(request, options = nil) - # Pass arguments to `import_flow` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_flow(parent: nil, flow_uri: nil, flow_content: nil, import_option: nil, flow_import_strategy: nil) - # Pass arguments to `import_flow` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 import the flow into. - # Format: `projects//locations//agents/`. - # @param flow_uri [::String] - # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI - # to import flow from. The format of this URI must be - # `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: `flow_uri`, `flow_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 flow_content [::String] - # Uncompressed raw byte content for flow. - # - # Note: The following parameters are mutually exclusive: `flow_content`, `flow_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 import_option [::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest::ImportOption] - # Flow import mode. If not specified, `KEEP` is assumed. - # @param flow_import_strategy [::Google::Cloud::Dialogflow::CX::V3::FlowImportStrategy, ::Hash] - # Optional. Specifies the import strategy used when resolving resource - # conflicts. - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest.new - # - # # Call the import_flow method. - # result = client.import_flow request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_flow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest - - # Converts hash and nil to 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_flow.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_flow.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_flow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @flows_stub.call_rpc :import_flow, 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 flow to a binary file. - # - # 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`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::ExportFlowResponse ExportFlowResponse} - # - # Note that resources (e.g. intents, entities, webhooks) that the flow - # references will also be exported. - # - # @overload export_flow(request, options = nil) - # Pass arguments to `export_flow` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_flow(name: nil, flow_uri: nil, include_referenced_flows: nil) - # Pass arguments to `export_flow` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 flow to export. - # Format: - # `projects//locations//agents//flows/`. - # @param flow_uri [::String] - # Optional. The [Google Cloud - # Storage](https://cloud.google.com/storage/docs/) URI to export the flow to. - # The format of this URI must be `gs:///`. If left - # unspecified, the serialized flow 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). - # @param include_referenced_flows [::Boolean] - # Optional. Whether to export flows referenced by the specified flow. - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest.new - # - # # Call the export_flow method. - # result = client.export_flow request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_flow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest - - # Converts hash and nil to 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_flow.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_flow.timeout, - metadata: metadata, - retry_policy: @config.rpcs.export_flow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @flows_stub.call_rpc :export_flow, 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 Flows API. - # - # This class represents the configuration for Flows, - # 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::CX::V3::Flows::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_flow to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_flow.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_flow.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::CX::V3::Flows::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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 Flows API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_flow` - # @return [::Gapic::Config::Method] - # - attr_reader :create_flow - ## - # RPC-specific configuration for `delete_flow` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_flow - ## - # RPC-specific configuration for `list_flows` - # @return [::Gapic::Config::Method] - # - attr_reader :list_flows - ## - # RPC-specific configuration for `get_flow` - # @return [::Gapic::Config::Method] - # - attr_reader :get_flow - ## - # RPC-specific configuration for `update_flow` - # @return [::Gapic::Config::Method] - # - attr_reader :update_flow - ## - # RPC-specific configuration for `train_flow` - # @return [::Gapic::Config::Method] - # - attr_reader :train_flow - ## - # RPC-specific configuration for `validate_flow` - # @return [::Gapic::Config::Method] - # - attr_reader :validate_flow - ## - # RPC-specific configuration for `get_flow_validation_result` - # @return [::Gapic::Config::Method] - # - attr_reader :get_flow_validation_result - ## - # RPC-specific configuration for `import_flow` - # @return [::Gapic::Config::Method] - # - attr_reader :import_flow - ## - # RPC-specific configuration for `export_flow` - # @return [::Gapic::Config::Method] - # - attr_reader :export_flow - - # @private - def initialize parent_rpcs = nil - create_flow_config = parent_rpcs.create_flow if parent_rpcs.respond_to? :create_flow - @create_flow = ::Gapic::Config::Method.new create_flow_config - delete_flow_config = parent_rpcs.delete_flow if parent_rpcs.respond_to? :delete_flow - @delete_flow = ::Gapic::Config::Method.new delete_flow_config - list_flows_config = parent_rpcs.list_flows if parent_rpcs.respond_to? :list_flows - @list_flows = ::Gapic::Config::Method.new list_flows_config - get_flow_config = parent_rpcs.get_flow if parent_rpcs.respond_to? :get_flow - @get_flow = ::Gapic::Config::Method.new get_flow_config - update_flow_config = parent_rpcs.update_flow if parent_rpcs.respond_to? :update_flow - @update_flow = ::Gapic::Config::Method.new update_flow_config - train_flow_config = parent_rpcs.train_flow if parent_rpcs.respond_to? :train_flow - @train_flow = ::Gapic::Config::Method.new train_flow_config - validate_flow_config = parent_rpcs.validate_flow if parent_rpcs.respond_to? :validate_flow - @validate_flow = ::Gapic::Config::Method.new validate_flow_config - get_flow_validation_result_config = parent_rpcs.get_flow_validation_result if parent_rpcs.respond_to? :get_flow_validation_result - @get_flow_validation_result = ::Gapic::Config::Method.new get_flow_validation_result_config - import_flow_config = parent_rpcs.import_flow if parent_rpcs.respond_to? :import_flow - @import_flow = ::Gapic::Config::Method.new import_flow_config - export_flow_config = parent_rpcs.export_flow if parent_rpcs.respond_to? :export_flow - @export_flow = ::Gapic::Config::Method.new export_flow_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/credentials.rb deleted file mode 100644 index cbc1e1ab30e9..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Flows - # Credentials for the Flows 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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb deleted file mode 100644 index 6ebaf85a1cf2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/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 CX - module V3 - module Flows - # 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 Flows 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 Flows 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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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. - # * `: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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/paths.rb deleted file mode 100644 index e7ef0215d2fa..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/paths.rb +++ /dev/null @@ -1,273 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Flows - # Path helper methods for the Flows API. - module Paths - ## - # Create a fully-qualified Agent resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # - # @return [::String] - def agent_path project:, location:, agent: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}" - end - - ## - # Create a fully-qualified Flow resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param flow [String] - # - # @return [::String] - def flow_path project:, location:, agent:, flow: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}" - end - - ## - # Create a fully-qualified FlowValidationResult resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param flow [String] - # - # @return [::String] - def flow_validation_result_path project:, location:, agent:, flow: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/validationResult" - end - - ## - # Create a fully-qualified Generator resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/generators/{generator}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param generator [String] - # - # @return [::String] - def generator_path project:, location:, agent:, generator: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/generators/#{generator}" - end - - ## - # Create a fully-qualified Intent resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/intents/{intent}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param intent [String] - # - # @return [::String] - def intent_path project:, location:, agent:, intent: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/intents/#{intent}" - end - - ## - # Create a fully-qualified Page resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param flow [String] - # @param page [String] - # - # @return [::String] - def page_path project:, location:, agent:, flow:, page: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/pages/#{page}" - end - - ## - # Create a fully-qualified Playbook resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param playbook [String] - # - # @return [::String] - def playbook_path project:, location:, agent:, playbook: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}" - end - - ## - # Create a fully-qualified Tool resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/tools/{tool}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param tool [String] - # - # @return [::String] - def tool_path project:, location:, agent:, tool: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/tools/#{tool}" - end - - ## - # Create a fully-qualified TransitionRouteGroup resource string. - # - # @overload transition_route_group_path(project:, location:, agent:, flow:, transition_route_group:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param flow [String] - # @param transition_route_group [String] - # - # @overload transition_route_group_path(project:, location:, agent:, transition_route_group:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param transition_route_group [String] - # - # @return [::String] - def transition_route_group_path **args - resources = { - "agent:flow:location:project:transition_route_group" => (proc do |project:, location:, agent:, flow:, transition_route_group:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/transitionRouteGroups/#{transition_route_group}" - end), - "agent:location:project:transition_route_group" => (proc do |project:, location:, agent:, transition_route_group:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/transitionRouteGroups/#{transition_route_group}" - 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 Webhook resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param webhook [String] - # - # @return [::String] - def webhook_path project:, location:, agent:, webhook: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/webhooks/#{webhook}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest.rb deleted file mode 100644 index f216c0c31665..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/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/cx/v3/version" -require "google/cloud/dialogflow/cx/v3/bindings_override" - -require "google/cloud/dialogflow/cx/v3/flows/credentials" -require "google/cloud/dialogflow/cx/v3/flows/paths" -require "google/cloud/dialogflow/cx/v3/flows/rest/operations" -require "google/cloud/dialogflow/cx/v3/flows/rest/client" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Flow Flows}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/cx/v3/flows/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new - # - module Flows - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/flows/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb deleted file mode 100644 index 70e1f5ba77e2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb +++ /dev/null @@ -1,1445 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/flow_pb" -require "google/cloud/dialogflow/cx/v3/flows/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Flows - module Rest - ## - # REST client for the Flows service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Flow Flows}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :flows_stub - - ## - # Configure the Flows Client class. - # - # See {::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Flows clients - # ::Google::Cloud::Dialogflow::CX::V3::Flows::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", "CX", "V3"] - 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 Flows 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::CX::V3::Flows::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 - @flows_stub.universe_domain - end - - ## - # Create a new Flows REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Flows 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::CX::V3::Flows::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 - - @flows_stub = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @flows_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 = @flows_stub.endpoint - config.universe_domain = @flows_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @flows_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Flows::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 - @flows_stub.logger - end - - # Service calls - - ## - # Creates a flow in the specified agent. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload create_flow(request, options = nil) - # Pass arguments to `create_flow` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_flow(parent: nil, flow: nil, language_code: nil) - # Pass arguments to `create_flow` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 flow for. - # Format: `projects//locations//agents/`. - # @param flow [::Google::Cloud::Dialogflow::CX::V3::Flow, ::Hash] - # Required. The flow to create. - # @param language_code [::String] - # The language of the following fields in `flow`: - # - # * `Flow.event_handlers.trigger_fulfillment.messages` - # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` - # * `Flow.transition_routes.trigger_fulfillment.messages` - # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Flow] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest.new - # - # # Call the create_flow method. - # result = client.create_flow request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. - # p result - # - def create_flow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest - - # Converts hash and nil to an 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_flow.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_flow.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_flow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @flows_stub.create_flow request, 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 flow. - # - # @overload delete_flow(request, options = nil) - # Pass arguments to `delete_flow` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_flow(name: nil, force: nil) - # Pass arguments to `delete_flow` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 flow to delete. - # Format: - # `projects//locations//agents//flows/`. - # @param force [::Boolean] - # This field has no effect for flows with no incoming transitions. - # For flows with incoming transitions: - # - # * If `force` is set to false, an error will be returned with message - # indicating the incoming transitions. - # * If `force` is set to true, Dialogflow will remove the flow, as well as - # any transitions to the flow (i.e. [Target - # flow][EventHandler.target_flow] in event handlers or [Target - # flow][TransitionRoute.target_flow] in transition routes that point to - # this flow will be cleared). - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest.new - # - # # Call the delete_flow method. - # result = client.delete_flow request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_flow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest - - # Converts hash and nil to an 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_flow.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_flow.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_flow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @flows_stub.delete_flow request, 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 flows in the specified agent. - # - # @overload list_flows(request, options = nil) - # Pass arguments to `list_flows` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_flows(parent: nil, page_size: nil, page_token: nil, language_code: nil) - # Pass arguments to `list_flows` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 containing the flows. - # Format: `projects//locations//agents/`. - # @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. - # @param language_code [::String] - # The language to list flows for. The following fields are language - # dependent: - # - # * `Flow.event_handlers.trigger_fulfillment.messages` - # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` - # * `Flow.transition_routes.trigger_fulfillment.messages` - # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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 [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Flow>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Flow>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest.new - # - # # Call the list_flows method. - # result = client.list_flows request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Flow. - # p item - # end - # - def list_flows request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest - - # Converts hash and nil to an 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_flows.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_flows.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_flows.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @flows_stub.list_flows request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @flows_stub, :list_flows, "flows", 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 flow. - # - # @overload get_flow(request, options = nil) - # Pass arguments to `get_flow` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_flow(name: nil, language_code: nil) - # Pass arguments to `get_flow` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 flow to get. - # Format: - # `projects//locations//agents//flows/`. - # @param language_code [::String] - # The language to retrieve the flow for. The following fields are language - # dependent: - # - # * `Flow.event_handlers.trigger_fulfillment.messages` - # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` - # * `Flow.transition_routes.trigger_fulfillment.messages` - # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Flow] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetFlowRequest.new - # - # # Call the get_flow method. - # result = client.get_flow request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. - # p result - # - def get_flow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest - - # Converts hash and nil to an 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_flow.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_flow.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_flow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @flows_stub.get_flow request, 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 flow. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload update_flow(request, options = nil) - # Pass arguments to `update_flow` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_flow(flow: nil, update_mask: nil, language_code: nil) - # Pass arguments to `update_flow` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param flow [::Google::Cloud::Dialogflow::CX::V3::Flow, ::Hash] - # Required. The flow to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The mask to control which fields get updated. If the mask is not present, - # all fields will be updated. - # @param language_code [::String] - # The language of the following fields in `flow`: - # - # * `Flow.event_handlers.trigger_fulfillment.messages` - # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` - # * `Flow.transition_routes.trigger_fulfillment.messages` - # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Flow] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest.new - # - # # Call the update_flow method. - # result = client.update_flow request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. - # p result - # - def update_flow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest - - # Converts hash and nil to an 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_flow.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_flow.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_flow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @flows_stub.update_flow request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Trains the specified flow. Note that only the flow in 'draft' environment - # is trained. - # - # 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`: 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 a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload train_flow(request, options = nil) - # Pass arguments to `train_flow` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_flow(name: nil) - # Pass arguments to `train_flow` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 flow to train. - # Format: - # `projects//locations//agents//flows/`. - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest.new - # - # # Call the train_flow method. - # result = client.train_flow request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_flow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest - - # Converts hash and nil to an 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_flow.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_flow.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.train_flow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @flows_stub.train_flow 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 - - ## - # Validates the specified flow and creates or updates validation results. - # Please call this API after the training is completed to get the complete - # validation results. - # - # @overload validate_flow(request, options = nil) - # Pass arguments to `validate_flow` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload validate_flow(name: nil, language_code: nil) - # Pass arguments to `validate_flow` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 flow to validate. - # Format: - # `projects//locations//agents//flows/`. - # @param language_code [::String] - # If not specified, the agent's default language is used. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest.new - # - # # Call the validate_flow method. - # result = client.validate_flow request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FlowValidationResult. - # p result - # - def validate_flow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.validate_flow.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.validate_flow.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.validate_flow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @flows_stub.validate_flow request, 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 latest flow validation result. Flow validation is performed - # when ValidateFlow is called. - # - # @overload get_flow_validation_result(request, options = nil) - # Pass arguments to `get_flow_validation_result` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_flow_validation_result(name: nil, language_code: nil) - # Pass arguments to `get_flow_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 name [::String] - # Required. The flow name. - # Format: - # `projects//locations//agents//flows//validationResult`. - # @param language_code [::String] - # If not specified, the agent's default language is used. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest.new - # - # # Call the get_flow_validation_result method. - # result = client.get_flow_validation_result request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FlowValidationResult. - # p result - # - def get_flow_validation_result request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest - - # Converts hash and nil to an 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_flow_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_flow_validation_result.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_flow_validation_result.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @flows_stub.get_flow_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 - - ## - # Imports the specified flow to the specified agent from a binary file. - # - # 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`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::ImportFlowResponse ImportFlowResponse} - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload import_flow(request, options = nil) - # Pass arguments to `import_flow` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_flow(parent: nil, flow_uri: nil, flow_content: nil, import_option: nil, flow_import_strategy: nil) - # Pass arguments to `import_flow` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 import the flow into. - # Format: `projects//locations//agents/`. - # @param flow_uri [::String] - # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI - # to import flow from. The format of this URI must be - # `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: `flow_uri`, `flow_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 flow_content [::String] - # Uncompressed raw byte content for flow. - # - # Note: The following parameters are mutually exclusive: `flow_content`, `flow_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 import_option [::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest::ImportOption] - # Flow import mode. If not specified, `KEEP` is assumed. - # @param flow_import_strategy [::Google::Cloud::Dialogflow::CX::V3::FlowImportStrategy, ::Hash] - # Optional. Specifies the import strategy used when resolving resource - # conflicts. - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest.new - # - # # Call the import_flow method. - # result = client.import_flow request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_flow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest - - # Converts hash and nil to an 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_flow.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_flow.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_flow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @flows_stub.import_flow 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 flow to a binary file. - # - # 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`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::ExportFlowResponse ExportFlowResponse} - # - # Note that resources (e.g. intents, entities, webhooks) that the flow - # references will also be exported. - # - # @overload export_flow(request, options = nil) - # Pass arguments to `export_flow` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_flow(name: nil, flow_uri: nil, include_referenced_flows: nil) - # Pass arguments to `export_flow` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 flow to export. - # Format: - # `projects//locations//agents//flows/`. - # @param flow_uri [::String] - # Optional. The [Google Cloud - # Storage](https://cloud.google.com/storage/docs/) URI to export the flow to. - # The format of this URI must be `gs:///`. If left - # unspecified, the serialized flow 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). - # @param include_referenced_flows [::Boolean] - # Optional. Whether to export flows referenced by the specified flow. - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest.new - # - # # Call the export_flow method. - # result = client.export_flow request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_flow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest - - # Converts hash and nil to an 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_flow.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_flow.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.export_flow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @flows_stub.export_flow 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 Flows REST API. - # - # This class represents the configuration for Flows 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::CX::V3::Flows::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_flow to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_flow.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_flow.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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 Flows API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_flow` - # @return [::Gapic::Config::Method] - # - attr_reader :create_flow - ## - # RPC-specific configuration for `delete_flow` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_flow - ## - # RPC-specific configuration for `list_flows` - # @return [::Gapic::Config::Method] - # - attr_reader :list_flows - ## - # RPC-specific configuration for `get_flow` - # @return [::Gapic::Config::Method] - # - attr_reader :get_flow - ## - # RPC-specific configuration for `update_flow` - # @return [::Gapic::Config::Method] - # - attr_reader :update_flow - ## - # RPC-specific configuration for `train_flow` - # @return [::Gapic::Config::Method] - # - attr_reader :train_flow - ## - # RPC-specific configuration for `validate_flow` - # @return [::Gapic::Config::Method] - # - attr_reader :validate_flow - ## - # RPC-specific configuration for `get_flow_validation_result` - # @return [::Gapic::Config::Method] - # - attr_reader :get_flow_validation_result - ## - # RPC-specific configuration for `import_flow` - # @return [::Gapic::Config::Method] - # - attr_reader :import_flow - ## - # RPC-specific configuration for `export_flow` - # @return [::Gapic::Config::Method] - # - attr_reader :export_flow - - # @private - def initialize parent_rpcs = nil - create_flow_config = parent_rpcs.create_flow if parent_rpcs.respond_to? :create_flow - @create_flow = ::Gapic::Config::Method.new create_flow_config - delete_flow_config = parent_rpcs.delete_flow if parent_rpcs.respond_to? :delete_flow - @delete_flow = ::Gapic::Config::Method.new delete_flow_config - list_flows_config = parent_rpcs.list_flows if parent_rpcs.respond_to? :list_flows - @list_flows = ::Gapic::Config::Method.new list_flows_config - get_flow_config = parent_rpcs.get_flow if parent_rpcs.respond_to? :get_flow - @get_flow = ::Gapic::Config::Method.new get_flow_config - update_flow_config = parent_rpcs.update_flow if parent_rpcs.respond_to? :update_flow - @update_flow = ::Gapic::Config::Method.new update_flow_config - train_flow_config = parent_rpcs.train_flow if parent_rpcs.respond_to? :train_flow - @train_flow = ::Gapic::Config::Method.new train_flow_config - validate_flow_config = parent_rpcs.validate_flow if parent_rpcs.respond_to? :validate_flow - @validate_flow = ::Gapic::Config::Method.new validate_flow_config - get_flow_validation_result_config = parent_rpcs.get_flow_validation_result if parent_rpcs.respond_to? :get_flow_validation_result - @get_flow_validation_result = ::Gapic::Config::Method.new get_flow_validation_result_config - import_flow_config = parent_rpcs.import_flow if parent_rpcs.respond_to? :import_flow - @import_flow = ::Gapic::Config::Method.new import_flow_config - export_flow_config = parent_rpcs.export_flow if parent_rpcs.respond_to? :export_flow - @export_flow = ::Gapic::Config::Method.new export_flow_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb deleted file mode 100644 index 2a8fb909b5ad..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/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 CX - module V3 - module Flows - 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 Flows 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 Flows 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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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. - # * `: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: "/v3/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3/{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: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3/{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: "/v3/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v3/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb deleted file mode 100644 index 02942aecb8a3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb +++ /dev/null @@ -1,699 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/flow_pb" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Flows - module Rest - ## - # REST service stub for the Flows 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_flow REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::Flow] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] - # A result object deserialized from the server's reply - def create_flow request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_flow_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_flow", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::Flow.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_flow REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_flow request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_flow_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_flow", - 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_flows REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::ListFlowsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::ListFlowsResponse] - # A result object deserialized from the server's reply - def list_flows request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_flows_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_flows", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::ListFlowsResponse.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_flow REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::Flow] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] - # A result object deserialized from the server's reply - def get_flow request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_flow_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_flow", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::Flow.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_flow REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::Flow] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] - # A result object deserialized from the server's reply - def update_flow request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_flow_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_flow", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::Flow.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_flow REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_flow request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_train_flow_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_flow", - 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 validate_flow REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::FlowValidationResult] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] - # A result object deserialized from the server's reply - def validate_flow request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_validate_flow_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "validate_flow", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult.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_flow_validation_result REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::FlowValidationResult] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] - # A result object deserialized from the server's reply - def get_flow_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_flow_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_flow_validation_result", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult.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_flow REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_flow request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_flow_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_flow", - 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_flow REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_flow request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_export_flow_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_flow", - 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_flow REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest] - # 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_flow_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/flows", - body: "flow", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_flow REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest] - # 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_flow_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_flows REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest] - # 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_flows_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/flows", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_flow REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest] - # 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_flow_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_flow REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest] - # 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_flow_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v3/{flow.name}", - body: "flow", - matches: [ - ["flow.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the train_flow REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest] - # 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_flow_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{name}:train", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the validate_flow REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_validate_flow_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{name}:validate", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_flow_validation_result REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest] - # 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_flow_validation_result_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/validationResult/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_flow REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest] - # 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_flow_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/flows:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the export_flow REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest] - # 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_flow_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{name}:export", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/fulfillment_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/fulfillment_pb.rb deleted file mode 100644 index 93aa68ce32a9..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/fulfillment_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/cx/v3/fulfillment.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/dialogflow/cx/v3/advanced_settings_pb' -require 'google/cloud/dialogflow/cx/v3/response_message_pb' -require 'google/protobuf/struct_pb' - - -descriptor_data = "\n/google/cloud/dialogflow/cx/v3/fulfillment.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x35google/cloud/dialogflow/cx/v3/advanced_settings.proto\x1a\x34google/cloud/dialogflow/cx/v3/response_message.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xbf\n\n\x0b\x46ulfillment\x12@\n\x08messages\x18\x01 \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.ResponseMessage\x12\x37\n\x07webhook\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Webhook\x12 \n\x18return_partial_responses\x18\x08 \x01(\x08\x12\x0b\n\x03tag\x18\x03 \x01(\t\x12\\\n\x15set_parameter_actions\x18\x04 \x03(\x0b\x32=.google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction\x12V\n\x11\x63onditional_cases\x18\x05 \x03(\x0b\x32;.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases\x12J\n\x11\x61\x64vanced_settings\x18\x07 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x12\"\n\x1a\x65nable_generative_fallback\x18\x0c \x01(\x08\x12P\n\ngenerators\x18\r \x03(\x0b\x32<.google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings\x1aN\n\x12SetParameterAction\x12\x11\n\tparameter\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value\x1a\xa3\x03\n\x10\x43onditionalCases\x12O\n\x05\x63\x61ses\x18\x01 \x03(\x0b\x32@.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case\x1a\xbd\x02\n\x04\x43\x61se\x12\x11\n\tcondition\x18\x01 \x01(\t\x12\x62\n\x0c\x63\x61se_content\x18\x02 \x03(\x0b\x32L.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent\x1a\xbd\x01\n\x0b\x43\x61seContent\x12\x41\n\x07message\x18\x01 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.ResponseMessageH\x00\x12W\n\x10\x61\x64\x64itional_cases\x18\x02 \x01(\x0b\x32;.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCasesH\x00\x42\x12\n\x10\x63\x61ses_or_message\x1a\x97\x02\n\x11GeneratorSettings\x12>\n\tgenerator\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#dialogflow.googleapis.com/Generator\x12k\n\x10input_parameters\x18\x02 \x03(\x0b\x32Q.google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings.InputParametersEntry\x12\x1d\n\x10output_parameter\x18\x03 \x01(\tB\x03\xe0\x41\x02\x1a\x36\n\x14InputParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\xb3\x01\n!com.google.cloud.dialogflow.cx.v3B\x10\x46ulfillmentProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.dialogflow.cx.v3.ResponseMessage", "google/cloud/dialogflow/cx/v3/response_message.proto"], - ["google.cloud.dialogflow.cx.v3.AdvancedSettings", "google/cloud/dialogflow/cx/v3/advanced_settings.proto"], - ["google.protobuf.Value", "google/protobuf/struct.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - Fulfillment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Fulfillment").msgclass - Fulfillment::SetParameterAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Fulfillment.SetParameterAction").msgclass - Fulfillment::ConditionalCases = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases").msgclass - Fulfillment::ConditionalCases::Case = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case").msgclass - Fulfillment::ConditionalCases::Case::CaseContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.Case.CaseContent").msgclass - Fulfillment::GeneratorSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Fulfillment.GeneratorSettings").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/gcs_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/gcs_pb.rb deleted file mode 100644 index fbc23e0bf3cc..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/gcs_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/cx/v3/gcs.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' - - -descriptor_data = "\n\'google/cloud/dialogflow/cx/v3/gcs.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\"\"\n\x0eGcsDestination\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x42\xab\x01\n!com.google.cloud.dialogflow.cx.v3B\x08GcsProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - GcsDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GcsDestination").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generative_settings_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generative_settings_pb.rb deleted file mode 100644 index 3738fddbe12b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generative_settings_pb.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/generative_settings.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/cloud/dialogflow/cx/v3/safety_settings_pb' - - -descriptor_data = "\n7google/cloud/dialogflow/cx/v3/generative_settings.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x19google/api/resource.proto\x1a\x33google/cloud/dialogflow/cx/v3/safety_settings.proto\"\xc8\x07\n\x12GenerativeSettings\x12\x0c\n\x04name\x18\x05 \x01(\t\x12]\n\x11\x66\x61llback_settings\x18\x01 \x01(\x0b\x32\x42.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings\x12Q\n\x1agenerative_safety_settings\x18\x03 \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.SafetySettings\x12r\n\x1cknowledge_connector_settings\x18\x07 \x01(\x0b\x32L.google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings\x12\x15\n\rlanguage_code\x18\x04 \x01(\t\x12K\n\x12llm_model_settings\x18\x08 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.LlmModelSettings\x1a\xe5\x01\n\x10\x46\x61llbackSettings\x12\x17\n\x0fselected_prompt\x18\x03 \x01(\t\x12k\n\x10prompt_templates\x18\x04 \x03(\x0b\x32Q.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate\x1aK\n\x0ePromptTemplate\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x13\n\x0bprompt_text\x18\x02 \x01(\t\x12\x0e\n\x06\x66rozen\x18\x03 \x01(\x08\x1a\xad\x01\n\x1aKnowledgeConnectorSettings\x12\x10\n\x08\x62usiness\x18\x01 \x01(\t\x12\r\n\x05\x61gent\x18\x02 \x01(\t\x12\x16\n\x0e\x61gent_identity\x18\x03 \x01(\t\x12\x1c\n\x14\x62usiness_description\x18\x04 \x01(\t\x12\x13\n\x0b\x61gent_scope\x18\x05 \x01(\t\x12#\n\x1b\x64isable_data_store_fallback\x18\x08 \x01(\x08:\x81\x01\xea\x41~\n1dialogflow.googleapis.com/AgentGenerativeSettings\x12Iprojects/{project}/locations/{location}/agents/{agent}/generativeSettings\"6\n\x10LlmModelSettings\x12\r\n\x05model\x18\x01 \x01(\t\x12\x13\n\x0bprompt_text\x18\x02 \x01(\tB\xba\x01\n!com.google.cloud.dialogflow.cx.v3B\x17GenerativeSettingsProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.dialogflow.cx.v3.SafetySettings", "google/cloud/dialogflow/cx/v3/safety_settings.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - GenerativeSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GenerativeSettings").msgclass - GenerativeSettings::FallbackSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings").msgclass - GenerativeSettings::FallbackSettings::PromptTemplate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplate").msgclass - GenerativeSettings::KnowledgeConnectorSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings").msgclass - LlmModelSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.LlmModelSettings").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generator_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generator_pb.rb deleted file mode 100644 index d058a7f513e2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generator_pb.rb +++ /dev/null @@ -1,63 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/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/cx/v3/generative_settings_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n-google/cloud/dialogflow/cx/v3/generator.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x37google/cloud/dialogflow/cx/v3/generative_settings.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xb4\x05\n\tGenerator\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12?\n\x0bprompt_text\x18\x03 \x01(\x0b\x32%.google.cloud.dialogflow.cx.v3.PhraseB\x03\xe0\x41\x02\x12O\n\x0cplaceholders\x18\x05 \x03(\x0b\x32\x34.google.cloud.dialogflow.cx.v3.Generator.PlaceholderB\x03\xe0\x41\x01\x12K\n\x12llm_model_settings\x18\t \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.LlmModelSettings\x12P\n\x0fmodel_parameter\x18\x08 \x01(\x0b\x32\x37.google.cloud.dialogflow.cx.v3.Generator.ModelParameter\x1a\'\n\x0bPlaceholder\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x1a\xaa\x01\n\x0eModelParameter\x12\x18\n\x0btemperature\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x1d\n\x10max_decode_steps\x18\x02 \x01(\x05H\x01\x88\x01\x01\x12\x12\n\x05top_p\x18\x03 \x01(\x02H\x02\x88\x01\x01\x12\x12\n\x05top_k\x18\x04 \x01(\x05H\x03\x88\x01\x01\x42\x0e\n\x0c_temperatureB\x13\n\x11_max_decode_stepsB\x08\n\x06_top_pB\x08\n\x06_top_k:w\xea\x41t\n#dialogflow.googleapis.com/Generator\x12Mprojects/{project}/locations/{location}/agents/{agent}/generators/{generator}\"\x1b\n\x06Phrase\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\x92\x01\n\x15ListGeneratorsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#dialogflow.googleapis.com/Generator\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"o\n\x16ListGeneratorsResponse\x12<\n\ngenerators\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.cx.v3.Generator\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"g\n\x13GetGeneratorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#dialogflow.googleapis.com/Generator\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\xae\x01\n\x16\x43reateGeneratorRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#dialogflow.googleapis.com/Generator\x12@\n\tgenerator\x18\x02 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.GeneratorB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"\xa2\x01\n\x16UpdateGeneratorRequest\x12@\n\tgenerator\x18\x01 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.GeneratorB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"b\n\x16\x44\x65leteGeneratorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#dialogflow.googleapis.com/Generator\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\x32\xe9\x08\n\nGenerators\x12\xc7\x01\n\x0eListGenerators\x12\x34.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest\x1a\x35.google.cloud.dialogflow.cx.v3.ListGeneratorsResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v3/{parent=projects/*/locations/*/agents/*}/generators\x12\xb4\x01\n\x0cGetGenerator\x12\x32.google.cloud.dialogflow.cx.v3.GetGeneratorRequest\x1a(.google.cloud.dialogflow.cx.v3.Generator\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\x12\x37/v3/{name=projects/*/locations/*/agents/*/generators/*}\x12\xd1\x01\n\x0f\x43reateGenerator\x12\x35.google.cloud.dialogflow.cx.v3.CreateGeneratorRequest\x1a(.google.cloud.dialogflow.cx.v3.Generator\"]\xda\x41\x10parent,generator\x82\xd3\xe4\x93\x02\x44\"7/v3/{parent=projects/*/locations/*/agents/*}/generators:\tgenerator\x12\xe0\x01\n\x0fUpdateGenerator\x12\x35.google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest\x1a(.google.cloud.dialogflow.cx.v3.Generator\"l\xda\x41\x15generator,update_mask\x82\xd3\xe4\x93\x02N2A/v3/{generator.name=projects/*/locations/*/agents/*/generators/*}:\tgenerator\x12\xa8\x01\n\x0f\x44\x65leteGenerator\x12\x35.google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest\x1a\x16.google.protobuf.Empty\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39*7/v3/{name=projects/*/locations/*/agents/*/generators/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xb1\x01\n!com.google.cloud.dialogflow.cx.v3B\x0eGeneratorProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.dialogflow.cx.v3.LlmModelSettings", "google/cloud/dialogflow/cx/v3/generative_settings.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - Generator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Generator").msgclass - Generator::Placeholder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Generator.Placeholder").msgclass - Generator::ModelParameter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Generator.ModelParameter").msgclass - Phrase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Phrase").msgclass - ListGeneratorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListGeneratorsRequest").msgclass - ListGeneratorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListGeneratorsResponse").msgclass - GetGeneratorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetGeneratorRequest").msgclass - CreateGeneratorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateGeneratorRequest").msgclass - UpdateGeneratorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest").msgclass - DeleteGeneratorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generator_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generator_services_pb.rb deleted file mode 100644 index b48bcdd42dc3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generator_services_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/cx/v3/generator.proto for package 'Google.Cloud.Dialogflow.CX.V3' -# 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/cx/v3/generator_pb' - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Generators - # Service for managing [Generators][google.cloud.dialogflow.cx.v3.Generator] - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.cx.v3.Generators' - - # Returns the list of all generators in the specified agent. - rpc :ListGenerators, ::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsResponse - # Retrieves the specified generator. - rpc :GetGenerator, ::Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest, ::Google::Cloud::Dialogflow::CX::V3::Generator - # Creates a generator in the specified agent. - rpc :CreateGenerator, ::Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest, ::Google::Cloud::Dialogflow::CX::V3::Generator - # Update the specified generator. - rpc :UpdateGenerator, ::Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest, ::Google::Cloud::Dialogflow::CX::V3::Generator - # Deletes the specified generators. - rpc :DeleteGenerator, ::Google::Cloud::Dialogflow::CX::V3::DeleteGeneratorRequest, ::Google::Protobuf::Empty - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators.rb deleted file mode 100644 index 8026dc792fcf..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators.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/cx/v3/version" - -require "google/cloud/dialogflow/cx/v3/generators/credentials" -require "google/cloud/dialogflow/cx/v3/generators/paths" -require "google/cloud/dialogflow/cx/v3/generators/client" -require "google/cloud/dialogflow/cx/v3/generators/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Generator Generators} - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/cx/v3/generators" - # client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/cx/v3/generators/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new - # - module Generators - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "generators", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/generators/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/client.rb deleted file mode 100644 index 17f30e754d70..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/client.rb +++ /dev/null @@ -1,906 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/generator_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Generators - ## - # Client for the Generators service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Generator Generators} - # - 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::CX::V3::Generators::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Generators clients - # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] - 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::CX::V3::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::CX::V3::Generators::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::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/cx/v3/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::CX::V3::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 - - ## - # Returns the list of all generators in the specified agent. - # - # @overload list_generators(request, options = nil) - # Pass arguments to `list_generators` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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, language_code: 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 agent to list all generators for. - # Format: `projects//locations//agents/`. - # @param language_code [::String] - # The language to list generators for. - # @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::CX::V3::Generator>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Generator>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Generators::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-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 - - ## - # Retrieves the specified generator. - # - # @overload get_generator(request, options = nil) - # Pass arguments to `get_generator` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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, language_code: 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 name of the generator. - # Format: - # `projects//locations//agents//generators/`. - # @param language_code [::String] - # The language to list generators for. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Generator] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Generator] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Generators::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest.new - # - # # Call the get_generator method. - # result = client.get_generator request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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 - - ## - # Creates a generator in the specified agent. - # - # @overload create_generator(request, options = nil) - # Pass arguments to `create_generator` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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, language_code: 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 agent to create a generator for. - # Format: `projects//locations//agents/`. - # @param generator [::Google::Cloud::Dialogflow::CX::V3::Generator, ::Hash] - # Required. The generator to create. - # @param language_code [::String] - # The language to create generators for the following fields: - # * `Generator.prompt_text.text` - # If not specified, the agent's default language is used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Generator] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Generator] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Generators::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest.new - # - # # Call the create_generator method. - # result = client.create_generator request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-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 - - ## - # Update the specified generator. - # - # @overload update_generator(request, options = nil) - # Pass arguments to `update_generator` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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, language_code: 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::CX::V3::Generator, ::Hash] - # Required. The generator to update. - # @param language_code [::String] - # The language to list generators for. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # 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::CX::V3::Generator] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Generator] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Generators::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest.new - # - # # Call the update_generator method. - # result = client.update_generator request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-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 - - ## - # Deletes the specified generators. - # - # @overload delete_generator(request, options = nil) - # Pass arguments to `delete_generator` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeleteGeneratorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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, force: 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 name of the generator to delete. - # Format: - # `projects//locations//agents//generators/`. - # @param force [::Boolean] - # This field has no effect for generators not being used. - # For generators that are used by pages/flows/transition route groups: - # - # * If `force` is set to false, an error will be returned with message - # indicating the referenced resources. - # * If `force` is set to true, Dialogflow will remove the generator, as well - # as any references to the generator (i.e. - # [Generator][Fulfillment.generator]) in fulfillments. - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Generators::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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 - - ## - # 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::CX::V3::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 - # # list_generators to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::Generators::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_generators.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_generators.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::CX::V3::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. - # * `: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. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_generators` - # @return [::Gapic::Config::Method] - # - attr_reader :list_generators - ## - # RPC-specific configuration for `get_generator` - # @return [::Gapic::Config::Method] - # - attr_reader :get_generator - ## - # RPC-specific configuration for `create_generator` - # @return [::Gapic::Config::Method] - # - attr_reader :create_generator - ## - # RPC-specific configuration for `update_generator` - # @return [::Gapic::Config::Method] - # - attr_reader :update_generator - ## - # RPC-specific configuration for `delete_generator` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_generator - - # @private - def initialize parent_rpcs = nil - list_generators_config = parent_rpcs.list_generators if parent_rpcs.respond_to? :list_generators - @list_generators = ::Gapic::Config::Method.new list_generators_config - get_generator_config = parent_rpcs.get_generator if parent_rpcs.respond_to? :get_generator - @get_generator = ::Gapic::Config::Method.new get_generator_config - create_generator_config = parent_rpcs.create_generator if parent_rpcs.respond_to? :create_generator - @create_generator = ::Gapic::Config::Method.new create_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 - delete_generator_config = parent_rpcs.delete_generator if parent_rpcs.respond_to? :delete_generator - @delete_generator = ::Gapic::Config::Method.new delete_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/credentials.rb deleted file mode 100644 index f2281ff02688..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - 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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/paths.rb deleted file mode 100644 index 10dc7ef20ae4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/paths.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! - - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Generators - # Path helper methods for the Generators API. - module Paths - ## - # Create a fully-qualified Agent resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # - # @return [::String] - def agent_path project:, location:, agent: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}" - end - - ## - # Create a fully-qualified Generator resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/generators/{generator}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param generator [String] - # - # @return [::String] - def generator_path project:, location:, agent:, generator: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/generators/#{generator}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest.rb deleted file mode 100644 index 9ded45d58f2e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/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/cx/v3/version" -require "google/cloud/dialogflow/cx/v3/bindings_override" - -require "google/cloud/dialogflow/cx/v3/generators/credentials" -require "google/cloud/dialogflow/cx/v3/generators/paths" -require "google/cloud/dialogflow/cx/v3/generators/rest/client" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Generator Generators} - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/cx/v3/generators/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new - # - module Generators - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/generators/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb deleted file mode 100644 index c17d663fda66..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb +++ /dev/null @@ -1,836 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/generator_pb" -require "google/cloud/dialogflow/cx/v3/generators/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Generators - module Rest - ## - # REST client for the Generators service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Generator Generators} - # - 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::CX::V3::Generators::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Generators clients - # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] - 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::CX::V3::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::CX::V3::Generators::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 - - ## - # Returns the list of all generators in the specified agent. - # - # @overload list_generators(request, options = nil) - # Pass arguments to `list_generators` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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, language_code: 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 agent to list all generators for. - # Format: `projects//locations//agents/`. - # @param language_code [::String] - # The language to list generators for. - # @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::CX::V3::Generator>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Generator>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - ## - # Retrieves the specified generator. - # - # @overload get_generator(request, options = nil) - # Pass arguments to `get_generator` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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, language_code: 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 name of the generator. - # Format: - # `projects//locations//agents//generators/`. - # @param language_code [::String] - # The language to list generators for. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Generator] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Generator] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest.new - # - # # Call the get_generator method. - # result = client.get_generator request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - ## - # Creates a generator in the specified agent. - # - # @overload create_generator(request, options = nil) - # Pass arguments to `create_generator` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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, language_code: 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 agent to create a generator for. - # Format: `projects//locations//agents/`. - # @param generator [::Google::Cloud::Dialogflow::CX::V3::Generator, ::Hash] - # Required. The generator to create. - # @param language_code [::String] - # The language to create generators for the following fields: - # * `Generator.prompt_text.text` - # If not specified, the agent's default language is used. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Generator] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Generator] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest.new - # - # # Call the create_generator method. - # result = client.create_generator request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - ## - # Update the specified generator. - # - # @overload update_generator(request, options = nil) - # Pass arguments to `update_generator` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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, language_code: 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::CX::V3::Generator, ::Hash] - # Required. The generator to update. - # @param language_code [::String] - # The language to list generators for. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # 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::CX::V3::Generator] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Generator] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest.new - # - # # Call the update_generator method. - # result = client.update_generator request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - ## - # Deletes the specified generators. - # - # @overload delete_generator(request, options = nil) - # Pass arguments to `delete_generator` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeleteGeneratorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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, force: 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 name of the generator to delete. - # Format: - # `projects//locations//agents//generators/`. - # @param force [::Boolean] - # This field has no effect for generators not being used. - # For generators that are used by pages/flows/transition route groups: - # - # * If `force` is set to false, an error will be returned with message - # indicating the referenced resources. - # * If `force` is set to true, Dialogflow will remove the generator, as well - # as any references to the generator (i.e. - # [Generator][Fulfillment.generator]) in fulfillments. - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - ## - # 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::CX::V3::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 - # # list_generators to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_generators.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_generators.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_generators` - # @return [::Gapic::Config::Method] - # - attr_reader :list_generators - ## - # RPC-specific configuration for `get_generator` - # @return [::Gapic::Config::Method] - # - attr_reader :get_generator - ## - # RPC-specific configuration for `create_generator` - # @return [::Gapic::Config::Method] - # - attr_reader :create_generator - ## - # RPC-specific configuration for `update_generator` - # @return [::Gapic::Config::Method] - # - attr_reader :update_generator - ## - # RPC-specific configuration for `delete_generator` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_generator - - # @private - def initialize parent_rpcs = nil - list_generators_config = parent_rpcs.list_generators if parent_rpcs.respond_to? :list_generators - @list_generators = ::Gapic::Config::Method.new list_generators_config - get_generator_config = parent_rpcs.get_generator if parent_rpcs.respond_to? :get_generator - @get_generator = ::Gapic::Config::Method.new get_generator_config - create_generator_config = parent_rpcs.create_generator if parent_rpcs.respond_to? :create_generator - @create_generator = ::Gapic::Config::Method.new create_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 - delete_generator_config = parent_rpcs.delete_generator if parent_rpcs.respond_to? :delete_generator - @delete_generator = ::Gapic::Config::Method.new delete_generator_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/service_stub.rb deleted file mode 100644 index 834b60aea2f3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/service_stub.rb +++ /dev/null @@ -1,390 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/generator_pb" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - 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 list_generators REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::ListGeneratorsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 get_generator REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Generator] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 create_generator REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Generator] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 update_generator REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Generator] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 delete_generator REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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 - - ## - # @private - # - # GRPC transcoding helper method for the list_generators REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{parent}/generators", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_generator REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/generators/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_generator REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{parent}/generators", - body: "generator", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_generator REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{generator.name}", - body: "generator", - matches: [ - ["generator.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/generators/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_generator REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/generators/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/import_strategy_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/import_strategy_pb.rb deleted file mode 100644 index 96cd7e3eae83..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/import_strategy_pb.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/import_strategy.proto - -require 'google/protobuf' - - -descriptor_data = "\n3google/cloud/dialogflow/cx/v3/import_strategy.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3*\xc4\x01\n\x0eImportStrategy\x12\x1f\n\x1bIMPORT_STRATEGY_UNSPECIFIED\x10\x00\x12\x1e\n\x1aIMPORT_STRATEGY_CREATE_NEW\x10\x01\x12\x1b\n\x17IMPORT_STRATEGY_REPLACE\x10\x02\x12\x18\n\x14IMPORT_STRATEGY_KEEP\x10\x03\x12\x19\n\x15IMPORT_STRATEGY_MERGE\x10\x04\x12\x1f\n\x1bIMPORT_STRATEGY_THROW_ERROR\x10\x05\x42\xb6\x01\n!com.google.cloud.dialogflow.cx.v3B\x13ImportStrategyProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ImportStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportStrategy").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/inline_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/inline_pb.rb deleted file mode 100644 index 7a2160b7ef43..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/inline_pb.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/inline.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' - - -descriptor_data = "\n*google/cloud/dialogflow/cx/v3/inline.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\")\n\x11InlineDestination\x12\x14\n\x07\x63ontent\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x03\"\x1f\n\x0cInlineSource\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x42\xae\x01\n!com.google.cloud.dialogflow.cx.v3B\x0bInlineProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - InlineDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.InlineDestination").msgclass - InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.InlineSource").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intent_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intent_pb.rb deleted file mode 100644 index 220663b4cd95..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intent_pb.rb +++ /dev/null @@ -1,74 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/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/cx/v3/inline_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n*google/cloud/dialogflow/cx/v3/intent.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/inline.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xa1\x06\n\x06Intent\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12N\n\x10training_phrases\x18\x03 \x03(\x0b\x32\x34.google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase\x12\x43\n\nparameters\x18\x04 \x03(\x0b\x32/.google.cloud.dialogflow.cx.v3.Intent.Parameter\x12\x10\n\x08priority\x18\x05 \x01(\x05\x12\x13\n\x0bis_fallback\x18\x06 \x01(\x08\x12\x41\n\x06labels\x18\x07 \x03(\x0b\x32\x31.google.cloud.dialogflow.cx.v3.Intent.LabelsEntry\x12\x13\n\x0b\x64\x65scription\x18\x08 \x01(\t\x1a\xb7\x01\n\x0eTrainingPhrase\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12M\n\x05parts\x18\x02 \x03(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.PartB\x03\xe0\x41\x02\x12\x14\n\x0crepeat_count\x18\x03 \x01(\x05\x1a/\n\x04Part\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0cparameter_id\x18\x02 \x01(\t\x1a\x80\x01\n\tParameter\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x0b\x65ntity_type\x18\x02 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/EntityType\x12\x0f\n\x07is_list\x18\x03 \x01(\x08\x12\x0e\n\x06redact\x18\x04 \x01(\x08\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:n\xea\x41k\n dialogflow.googleapis.com/Intent\x12Gprojects/{project}/locations/{location}/agents/{agent}/intents/{intent}\"\xcc\x01\n\x12ListIntentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 dialogflow.googleapis.com/Intent\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12>\n\x0bintent_view\x18\x05 \x01(\x0e\x32).google.cloud.dialogflow.cx.v3.IntentView\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"f\n\x13ListIntentsResponse\x12\x36\n\x07intents\x18\x01 \x03(\x0b\x32%.google.cloud.dialogflow.cx.v3.Intent\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"a\n\x10GetIntentRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n dialogflow.googleapis.com/Intent\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\xa2\x01\n\x13\x43reateIntentRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 dialogflow.googleapis.com/Intent\x12:\n\x06intent\x18\x02 \x01(\x0b\x32%.google.cloud.dialogflow.cx.v3.IntentB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"\x99\x01\n\x13UpdateIntentRequest\x12:\n\x06intent\x18\x01 \x01(\x0b\x32%.google.cloud.dialogflow.cx.v3.IntentB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"M\n\x13\x44\x65leteIntentRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n dialogflow.googleapis.com/Intent\"\x91\x03\n\x14ImportIntentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 dialogflow.googleapis.com/Intent\x12\x15\n\x0bintents_uri\x18\x02 \x01(\tH\x00\x12\x46\n\x0fintents_content\x18\x03 \x01(\x0b\x32+.google.cloud.dialogflow.cx.v3.InlineSourceH\x00\x12U\n\x0cmerge_option\x18\x04 \x01(\x0e\x32?.google.cloud.dialogflow.cx.v3.ImportIntentsRequest.MergeOption\"~\n\x0bMergeOption\x12\x1c\n\x18MERGE_OPTION_UNSPECIFIED\x10\x00\x12\x0e\n\x06REJECT\x10\x01\x1a\x02\x08\x01\x12\x0b\n\x07REPLACE\x10\x02\x12\t\n\x05MERGE\x10\x03\x12\n\n\x06RENAME\x10\x04\x12\x13\n\x0fREPORT_CONFLICT\x10\x05\x12\x08\n\x04KEEP\x10\x06\x42\t\n\x07intents\"\x8d\x02\n\x15ImportIntentsResponse\x12\x36\n\x07intents\x18\x01 \x03(\tB%\xfa\x41\"\n dialogflow.googleapis.com/Intent\x12h\n\x15\x63onflicting_resources\x18\x02 \x01(\x0b\x32I.google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources\x1aR\n\x14\x43onflictingResources\x12\x1c\n\x14intent_display_names\x18\x01 \x03(\t\x12\x1c\n\x14\x65ntity_display_names\x18\x02 \x03(\t\"\x17\n\x15ImportIntentsMetadata\"\xda\x02\n\x14\x45xportIntentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 dialogflow.googleapis.com/Intent\x12\x14\n\x07intents\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12\x1a\n\x0bintents_uri\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x12%\n\x16intents_content_inline\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x12X\n\x0b\x64\x61ta_format\x18\x05 \x01(\x0e\x32>.google.cloud.dialogflow.cx.v3.ExportIntentsRequest.DataFormatB\x03\xe0\x41\x01\"F\n\nDataFormat\x12\x1b\n\x17\x44\x41TA_FORMAT_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42LOB\x10\x01\x12\x08\n\x04JSON\x10\x02\x12\x07\n\x03\x43SV\x10\x03\x42\r\n\x0b\x64\x65stination\"\x86\x01\n\x15\x45xportIntentsResponse\x12\x15\n\x0bintents_uri\x18\x01 \x01(\tH\x00\x12K\n\x0fintents_content\x18\x02 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.InlineDestinationH\x00\x42\t\n\x07intents\"\x17\n\x15\x45xportIntentsMetadata*X\n\nIntentView\x12\x1b\n\x17INTENT_VIEW_UNSPECIFIED\x10\x00\x12\x17\n\x13INTENT_VIEW_PARTIAL\x10\x01\x12\x14\n\x10INTENT_VIEW_FULL\x10\x02\x32\xdc\x0b\n\x07Intents\x12\xbb\x01\n\x0bListIntents\x12\x31.google.cloud.dialogflow.cx.v3.ListIntentsRequest\x1a\x32.google.cloud.dialogflow.cx.v3.ListIntentsResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v3/{parent=projects/*/locations/*/agents/*}/intents\x12\xa8\x01\n\tGetIntent\x12/.google.cloud.dialogflow.cx.v3.GetIntentRequest\x1a%.google.cloud.dialogflow.cx.v3.Intent\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v3/{name=projects/*/locations/*/agents/*/intents/*}\x12\xbf\x01\n\x0c\x43reateIntent\x12\x32.google.cloud.dialogflow.cx.v3.CreateIntentRequest\x1a%.google.cloud.dialogflow.cx.v3.Intent\"T\xda\x41\rparent,intent\x82\xd3\xe4\x93\x02>\"4/v3/{parent=projects/*/locations/*/agents/*}/intents:\x06intent\x12\xcb\x01\n\x0cUpdateIntent\x12\x32.google.cloud.dialogflow.cx.v3.UpdateIntentRequest\x1a%.google.cloud.dialogflow.cx.v3.Intent\"`\xda\x41\x12intent,update_mask\x82\xd3\xe4\x93\x02\x45\x32;/v3/{intent.name=projects/*/locations/*/agents/*/intents/*}:\x06intent\x12\x9f\x01\n\x0c\x44\x65leteIntent\x12\x32.google.cloud.dialogflow.cx.v3.DeleteIntentRequest\x1a\x16.google.protobuf.Empty\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36*4/v3/{name=projects/*/locations/*/agents/*/intents/*}\x12\xdc\x01\n\rImportIntents\x12\x33.google.cloud.dialogflow.cx.v3.ImportIntentsRequest\x1a\x1d.google.longrunning.Operation\"w\xca\x41.\n\x15ImportIntentsResponse\x12\x15ImportIntentsMetadata\x82\xd3\xe4\x93\x02@\";/v3/{parent=projects/*/locations/*/agents/*}/intents:import:\x01*\x12\xdc\x01\n\rExportIntents\x12\x33.google.cloud.dialogflow.cx.v3.ExportIntentsRequest\x1a\x1d.google.longrunning.Operation\"w\xca\x41.\n\x15\x45xportIntentsResponse\x12\x15\x45xportIntentsMetadata\x82\xd3\xe4\x93\x02@\";/v3/{parent=projects/*/locations/*/agents/*}/intents:export:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xae\x01\n!com.google.cloud.dialogflow.cx.v3B\x0bIntentProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.cloud.dialogflow.cx.v3.InlineSource", "google/cloud/dialogflow/cx/v3/inline.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - Intent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Intent").msgclass - Intent::TrainingPhrase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase").msgclass - Intent::TrainingPhrase::Part = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part").msgclass - Intent::Parameter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Intent.Parameter").msgclass - ListIntentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListIntentsRequest").msgclass - ListIntentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListIntentsResponse").msgclass - GetIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetIntentRequest").msgclass - CreateIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateIntentRequest").msgclass - UpdateIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateIntentRequest").msgclass - DeleteIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteIntentRequest").msgclass - ImportIntentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportIntentsRequest").msgclass - ImportIntentsRequest::MergeOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportIntentsRequest.MergeOption").enummodule - ImportIntentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportIntentsResponse").msgclass - ImportIntentsResponse::ConflictingResources = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportIntentsResponse.ConflictingResources").msgclass - ImportIntentsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportIntentsMetadata").msgclass - ExportIntentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportIntentsRequest").msgclass - ExportIntentsRequest::DataFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportIntentsRequest.DataFormat").enummodule - ExportIntentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportIntentsResponse").msgclass - ExportIntentsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportIntentsMetadata").msgclass - IntentView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.IntentView").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intent_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intent_services_pb.rb deleted file mode 100644 index e138edac0379..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intent_services_pb.rb +++ /dev/null @@ -1,89 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/cx/v3/intent.proto for package 'Google.Cloud.Dialogflow.CX.V3' -# 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/cx/v3/intent_pb' - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Intents - # Service for managing [Intents][google.cloud.dialogflow.cx.v3.Intent]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.cx.v3.Intents' - - # Returns the list of all intents in the specified agent. - rpc :ListIntents, ::Google::Cloud::Dialogflow::CX::V3::ListIntentsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListIntentsResponse - # Retrieves the specified intent. - rpc :GetIntent, ::Google::Cloud::Dialogflow::CX::V3::GetIntentRequest, ::Google::Cloud::Dialogflow::CX::V3::Intent - # Creates an intent in the specified agent. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - rpc :CreateIntent, ::Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest, ::Google::Cloud::Dialogflow::CX::V3::Intent - # Updates the specified intent. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - rpc :UpdateIntent, ::Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest, ::Google::Cloud::Dialogflow::CX::V3::Intent - # Deletes the specified intent. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - rpc :DeleteIntent, ::Google::Cloud::Dialogflow::CX::V3::DeleteIntentRequest, ::Google::Protobuf::Empty - # Imports the specified intents into the agent. - # - # 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`: - # [ImportIntentsMetadata][google.cloud.dialogflow.cx.v3.ImportIntentsMetadata] - # - `response`: - # [ImportIntentsResponse][google.cloud.dialogflow.cx.v3.ImportIntentsResponse] - rpc :ImportIntents, ::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest, ::Google::Longrunning::Operation - # Exports the selected intents. - # - # 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`: - # [ExportIntentsMetadata][google.cloud.dialogflow.cx.v3.ExportIntentsMetadata] - # - `response`: - # [ExportIntentsResponse][google.cloud.dialogflow.cx.v3.ExportIntentsResponse] - rpc :ExportIntents, ::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents.rb deleted file mode 100644 index e7d896e6dffd..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents.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/cx/v3/version" - -require "google/cloud/dialogflow/cx/v3/intents/credentials" -require "google/cloud/dialogflow/cx/v3/intents/paths" -require "google/cloud/dialogflow/cx/v3/intents/operations" -require "google/cloud/dialogflow/cx/v3/intents/client" -require "google/cloud/dialogflow/cx/v3/intents/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Intent Intents}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/cx/v3/intents" - # client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/cx/v3/intents/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new - # - module Intents - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "intents", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/intents/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/client.rb deleted file mode 100644 index 806cd72bd2a4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/client.rb +++ /dev/null @@ -1,1221 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/intent_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Intents - ## - # Client for the Intents service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Intents::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Intents clients - # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] - 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::CX::V3::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::CX::V3::Intents::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::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/cx/v3/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::CX::V3::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::CX::V3::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::CX::V3::ListIntentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 for. - # Format: `projects//locations//agents/`. - # @param language_code [::String] - # The language to list intents for. The following fields are language - # dependent: - # - # * `Intent.training_phrases.parts.text` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - # @param intent_view [::Google::Cloud::Dialogflow::CX::V3::IntentView] - # The resource view to apply to the returned intent. - # @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::CX::V3::Intent>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Intent>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-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::CX::V3::GetIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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) - # 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//locations//agents//intents/`. - # @param language_code [::String] - # The language to retrieve the intent for. The following fields are language - # dependent: - # - # * `Intent.training_phrases.parts.text` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Intent] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetIntentRequest.new - # - # # Call the get_intent method. - # result = client.get_intent request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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 a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload create_intent(request, options = nil) - # Pass arguments to `create_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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) - # 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 an intent for. - # Format: `projects//locations//agents/`. - # @param intent [::Google::Cloud::Dialogflow::CX::V3::Intent, ::Hash] - # Required. The intent to create. - # @param language_code [::String] - # The language of the following fields in `intent`: - # - # * `Intent.training_phrases.parts.text` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Intent] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest.new - # - # # Call the create_intent method. - # result = client.create_intent request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-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 a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload update_intent(request, options = nil) - # Pass arguments to `update_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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) - # 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::CX::V3::Intent, ::Hash] - # Required. The intent to update. - # @param language_code [::String] - # The language of the following fields in `intent`: - # - # * `Intent.training_phrases.parts.text` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # 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::CX::V3::Intent] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest.new - # - # # Call the update_intent method. - # result = client.update_intent request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-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. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload delete_intent(request, options = nil) - # Pass arguments to `delete_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeleteIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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. - # Format: - # `projects//locations//agents//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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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 - - ## - # Imports the specified intents into the agent. - # - # 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::CX::V3::ImportIntentsMetadata ImportIntentsMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::ImportIntentsResponse ImportIntentsResponse} - # - # @overload import_intents(request, options = nil) - # Pass arguments to `import_intents` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_intents(parent: nil, intents_uri: nil, intents_content: nil, merge_option: nil) - # Pass arguments to `import_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 import the intents into. - # Format: `projects//locations//agents/`. - # @param intents_uri [::String] - # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI - # to import intents from. The format of this URI must be - # `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: `intents_uri`, `intents_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 intents_content [::Google::Cloud::Dialogflow::CX::V3::InlineSource, ::Hash] - # Uncompressed byte content of intents. - # - # Note: The following parameters are mutually exclusive: `intents_content`, `intents_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 merge_option [::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest::MergeOption] - # Merge option for importing intents. If not specified, `REJECT` is assumed. - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest.new - # - # # Call the import_intents method. - # result = client.import_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 import_intents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest - - # Converts hash and nil to 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_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::CX::V3::VERSION - metadata[:"x-goog-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_intents.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_intents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @intents_stub.call_rpc :import_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 - - ## - # Exports the selected intents. - # - # 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::CX::V3::ExportIntentsMetadata ExportIntentsMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::ExportIntentsResponse ExportIntentsResponse} - # - # @overload export_intents(request, options = nil) - # Pass arguments to `export_intents` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_intents(parent: nil, intents: nil, intents_uri: nil, intents_content_inline: nil, data_format: nil) - # Pass arguments to `export_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 parent agent to export intents. - # Format: `projects//locations//agents/`. - # @param intents [::Array<::String>] - # Required. The name of the intents to export. - # Format: - # `projects//locations//agents//intents/`. - # @param intents_uri [::String] - # Optional. The [Google Cloud - # Storage](https://cloud.google.com/storage/docs/) URI to export the - # intents to. The format of this URI must be - # `gs:///`. - # - # 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). - # - # Note: The following parameters are mutually exclusive: `intents_uri`, `intents_content_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 intents_content_inline [::Boolean] - # Optional. The option to return the serialized intents inline. - # - # Note: The following parameters are mutually exclusive: `intents_content_inline`, `intents_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 data_format [::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest::DataFormat] - # Optional. The data format of the exported intents. If not specified, `BLOB` - # is assumed. - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest.new - # - # # Call the export_intents method. - # result = client.export_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 export_intents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest - - # Converts hash and nil to 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_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::CX::V3::VERSION - metadata[:"x-goog-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_intents.timeout, - metadata: metadata, - retry_policy: @config.rpcs.export_intents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @intents_stub.call_rpc :export_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::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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. - # * `: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. - # * `: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 `import_intents` - # @return [::Gapic::Config::Method] - # - attr_reader :import_intents - ## - # RPC-specific configuration for `export_intents` - # @return [::Gapic::Config::Method] - # - attr_reader :export_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 - import_intents_config = parent_rpcs.import_intents if parent_rpcs.respond_to? :import_intents - @import_intents = ::Gapic::Config::Method.new import_intents_config - export_intents_config = parent_rpcs.export_intents if parent_rpcs.respond_to? :export_intents - @export_intents = ::Gapic::Config::Method.new export_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/credentials.rb deleted file mode 100644 index 17666cab9cb4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - 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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/operations.rb deleted file mode 100644 index adf8fc7869b1..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/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 CX - module V3 - 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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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. - # * `: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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/paths.rb deleted file mode 100644 index ccee74067453..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/paths.rb +++ /dev/null @@ -1,96 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - module Intents - # Path helper methods for the Intents API. - module Paths - ## - # Create a fully-qualified Agent resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # - # @return [::String] - def agent_path project:, location:, agent: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}" - end - - ## - # Create a fully-qualified EntityType resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param entity_type [String] - # - # @return [::String] - def entity_type_path project:, location:, agent:, entity_type: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/entityTypes/#{entity_type}" - end - - ## - # Create a fully-qualified Intent resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/intents/{intent}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param intent [String] - # - # @return [::String] - def intent_path project:, location:, agent:, intent: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/intents/#{intent}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest.rb deleted file mode 100644 index fcdfb8b5fea5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/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/cx/v3/version" -require "google/cloud/dialogflow/cx/v3/bindings_override" - -require "google/cloud/dialogflow/cx/v3/intents/credentials" -require "google/cloud/dialogflow/cx/v3/intents/paths" -require "google/cloud/dialogflow/cx/v3/intents/rest/operations" -require "google/cloud/dialogflow/cx/v3/intents/rest/client" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Intent Intents}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/cx/v3/intents/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new - # - module Intents - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/intents/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb deleted file mode 100644 index f46dc8ef8223..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb +++ /dev/null @@ -1,1137 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/intent_pb" -require "google/cloud/dialogflow/cx/v3/intents/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Intents - module Rest - ## - # REST client for the Intents service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Intents::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Intents clients - # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] - 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::CX::V3::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::CX::V3::Intents::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::ListIntentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 for. - # Format: `projects//locations//agents/`. - # @param language_code [::String] - # The language to list intents for. The following fields are language - # dependent: - # - # * `Intent.training_phrases.parts.text` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - # @param intent_view [::Google::Cloud::Dialogflow::CX::V3::IntentView] - # The resource view to apply to the returned intent. - # @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::CX::V3::Intent>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Intent>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::GetIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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) - # 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//locations//agents//intents/`. - # @param language_code [::String] - # The language to retrieve the intent for. The following fields are language - # dependent: - # - # * `Intent.training_phrases.parts.text` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Intent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetIntentRequest.new - # - # # Call the get_intent method. - # result = client.get_intent request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload create_intent(request, options = nil) - # Pass arguments to `create_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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) - # 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 an intent for. - # Format: `projects//locations//agents/`. - # @param intent [::Google::Cloud::Dialogflow::CX::V3::Intent, ::Hash] - # Required. The intent to create. - # @param language_code [::String] - # The language of the following fields in `intent`: - # - # * `Intent.training_phrases.parts.text` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Intent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest.new - # - # # Call the create_intent method. - # result = client.create_intent request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload update_intent(request, options = nil) - # Pass arguments to `update_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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) - # 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::CX::V3::Intent, ::Hash] - # Required. The intent to update. - # @param language_code [::String] - # The language of the following fields in `intent`: - # - # * `Intent.training_phrases.parts.text` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # 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::CX::V3::Intent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest.new - # - # # Call the update_intent method. - # result = client.update_intent request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload delete_intent(request, options = nil) - # Pass arguments to `delete_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeleteIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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. - # Format: - # `projects//locations//agents//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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - ## - # Imports the specified intents into the agent. - # - # 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::CX::V3::ImportIntentsMetadata ImportIntentsMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::ImportIntentsResponse ImportIntentsResponse} - # - # @overload import_intents(request, options = nil) - # Pass arguments to `import_intents` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_intents(parent: nil, intents_uri: nil, intents_content: nil, merge_option: nil) - # Pass arguments to `import_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 import the intents into. - # Format: `projects//locations//agents/`. - # @param intents_uri [::String] - # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI - # to import intents from. The format of this URI must be - # `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: `intents_uri`, `intents_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 intents_content [::Google::Cloud::Dialogflow::CX::V3::InlineSource, ::Hash] - # Uncompressed byte content of intents. - # - # Note: The following parameters are mutually exclusive: `intents_content`, `intents_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 merge_option [::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest::MergeOption] - # Merge option for importing intents. If not specified, `REJECT` is assumed. - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest.new - # - # # Call the import_intents method. - # result = client.import_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 import_intents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest - - # Converts hash and nil to an 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_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_intents.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_intents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @intents_stub.import_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 - - ## - # Exports the selected intents. - # - # 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::CX::V3::ExportIntentsMetadata ExportIntentsMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::ExportIntentsResponse ExportIntentsResponse} - # - # @overload export_intents(request, options = nil) - # Pass arguments to `export_intents` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_intents(parent: nil, intents: nil, intents_uri: nil, intents_content_inline: nil, data_format: nil) - # Pass arguments to `export_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 parent agent to export intents. - # Format: `projects//locations//agents/`. - # @param intents [::Array<::String>] - # Required. The name of the intents to export. - # Format: - # `projects//locations//agents//intents/`. - # @param intents_uri [::String] - # Optional. The [Google Cloud - # Storage](https://cloud.google.com/storage/docs/) URI to export the - # intents to. The format of this URI must be - # `gs:///`. - # - # 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). - # - # Note: The following parameters are mutually exclusive: `intents_uri`, `intents_content_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 intents_content_inline [::Boolean] - # Optional. The option to return the serialized intents inline. - # - # Note: The following parameters are mutually exclusive: `intents_content_inline`, `intents_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 data_format [::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest::DataFormat] - # Optional. The data format of the exported intents. If not specified, `BLOB` - # is assumed. - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest.new - # - # # Call the export_intents method. - # result = client.export_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 export_intents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest - - # Converts hash and nil to an 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_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_intents.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.export_intents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @intents_stub.export_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::CX::V3::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::CX::V3::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::CX::V3::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. - # * `: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. - # * `: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 `import_intents` - # @return [::Gapic::Config::Method] - # - attr_reader :import_intents - ## - # RPC-specific configuration for `export_intents` - # @return [::Gapic::Config::Method] - # - attr_reader :export_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 - import_intents_config = parent_rpcs.import_intents if parent_rpcs.respond_to? :import_intents - @import_intents = ::Gapic::Config::Method.new import_intents_config - export_intents_config = parent_rpcs.export_intents if parent_rpcs.respond_to? :export_intents - @export_intents = ::Gapic::Config::Method.new export_intents_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/operations.rb deleted file mode 100644 index 819f9b26d6e9..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/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 CX - module V3 - 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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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. - # * `: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: "/v3/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3/{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: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3/{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: "/v3/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v3/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb deleted file mode 100644 index 0025171de07b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb +++ /dev/null @@ -1,514 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/intent_pb" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - 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::CX::V3::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::CX::V3::ListIntentsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::Intent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::Intent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::Intent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 import_intents REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_intents request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_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: "import_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 export_intents REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_intents request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_export_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: "export_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::CX::V3::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: "/v3/{parent}/intents", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_intent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/intents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_intent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{parent}/intents", - body: "intent", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_intent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{intent.name}", - body: "intent", - matches: [ - ["intent.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/intents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_intent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/intents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_intents REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest] - # 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_intents_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/intents:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the export_intents REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest] - # 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_intents_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/intents:export", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/page_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/page_pb.rb deleted file mode 100644 index 1ae09710a286..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/page_pb.rb +++ /dev/null @@ -1,72 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/page.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/cx/v3/advanced_settings_pb' -require 'google/cloud/dialogflow/cx/v3/data_store_connection_pb' -require 'google/cloud/dialogflow/cx/v3/fulfillment_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/struct_pb' - - -descriptor_data = "\n(google/cloud/dialogflow/cx/v3/page.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/advanced_settings.proto\x1a\x39google/cloud/dialogflow/cx/v3/data_store_connection.proto\x1a/google/cloud/dialogflow/cx/v3/fulfillment.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xcd\x05\n\x04Page\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x13 \x01(\t\x12\x45\n\x11\x65ntry_fulfillment\x18\x07 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.Fulfillment\x12\x31\n\x04\x66orm\x18\x04 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.Form\x12T\n\x17transition_route_groups\x18\x0b \x03(\tB3\xfa\x41\x30\n.dialogflow.googleapis.com/TransitionRouteGroup\x12I\n\x11transition_routes\x18\t \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.TransitionRoute\x12\x43\n\x0e\x65vent_handlers\x18\n \x03(\x0b\x32+.google.cloud.dialogflow.cx.v3.EventHandler\x12J\n\x11\x61\x64vanced_settings\x18\r \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x12\x64\n\x1cknowledge_connector_settings\x18\x12 \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettingsB\x03\xe0\x41\x01:u\xea\x41r\n\x1e\x64ialogflow.googleapis.com/Page\x12Pprojects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}\"\xef\x04\n\x04\x46orm\x12\x41\n\nparameters\x18\x01 \x03(\x0b\x32-.google.cloud.dialogflow.cx.v3.Form.Parameter\x1a\xa3\x04\n\tParameter\x12\x19\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x08required\x18\x02 \x01(\x08\x12\x41\n\x0b\x65ntity_type\x18\x03 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/EntityType\x12\x0f\n\x07is_list\x18\x04 \x01(\x08\x12V\n\rfill_behavior\x18\x07 \x01(\x0b\x32:.google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehaviorB\x03\xe0\x41\x02\x12-\n\rdefault_value\x18\t \x01(\x0b\x32\x16.google.protobuf.Value\x12\x0e\n\x06redact\x18\x0b \x01(\x08\x12J\n\x11\x61\x64vanced_settings\x18\x0c \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x1a\xb1\x01\n\x0c\x46illBehavior\x12S\n\x1ainitial_prompt_fulfillment\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.FulfillmentB\x03\xe0\x41\x02\x12L\n\x17reprompt_event_handlers\x18\x05 \x03(\x0b\x32+.google.cloud.dialogflow.cx.v3.EventHandler\"\xc4\x02\n\x0c\x45ventHandler\x12\x11\n\x04name\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05\x65vent\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12G\n\x13trigger_fulfillment\x18\x05 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.Fulfillment\x12:\n\x0btarget_page\x18\x02 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/PageH\x00\x12:\n\x0btarget_flow\x18\x03 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/FlowH\x00\x12\x42\n\x0ftarget_playbook\x18\x07 \x01(\tB\'\xfa\x41$\n\"dialogflow.googleapis.com/PlaybookH\x00\x42\x08\n\x06target\"\xd3\x02\n\x0fTransitionRoute\x12\x11\n\x04name\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12\x35\n\x06intent\x18\x01 \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/Intent\x12\x11\n\tcondition\x18\x02 \x01(\t\x12G\n\x13trigger_fulfillment\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.Fulfillment\x12:\n\x0btarget_page\x18\x04 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/PageH\x00\x12:\n\x0btarget_flow\x18\x05 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/FlowH\x00\x42\x08\n\x06target\"\x88\x01\n\x10ListPagesRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Page\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"`\n\x11ListPagesResponse\x12\x32\n\x05pages\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.cx.v3.Page\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"]\n\x0eGetPageRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Page\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\x9a\x01\n\x11\x43reatePageRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Page\x12\x36\n\x04page\x18\x02 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.PageB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"\x93\x01\n\x11UpdatePageRequest\x12\x36\n\x04page\x18\x01 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.PageB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"X\n\x11\x44\x65letePageRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Page\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\"\xd1\x02\n\x1aKnowledgeConnectorSettings\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12G\n\x13trigger_fulfillment\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.Fulfillment\x12:\n\x0btarget_page\x18\x04 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/PageH\x00\x12:\n\x0btarget_flow\x18\x05 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/FlowH\x00\x12W\n\x16\x64\x61ta_store_connections\x18\x06 \x03(\x0b\x32\x32.google.cloud.dialogflow.cx.v3.DataStoreConnectionB\x03\xe0\x41\x01\x42\x08\n\x06target2\x94\x08\n\x05Pages\x12\xbb\x01\n\tListPages\x12/.google.cloud.dialogflow.cx.v3.ListPagesRequest\x1a\x30.google.cloud.dialogflow.cx.v3.ListPagesResponse\"K\xda\x41\x06parent\x82\xd3\xe4\x93\x02<\x12:/v3/{parent=projects/*/locations/*/agents/*/flows/*}/pages\x12\xa8\x01\n\x07GetPage\x12-.google.cloud.dialogflow.cx.v3.GetPageRequest\x1a#.google.cloud.dialogflow.cx.v3.Page\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\x12:/v3/{name=projects/*/locations/*/agents/*/flows/*/pages/*}\x12\xbb\x01\n\nCreatePage\x12\x30.google.cloud.dialogflow.cx.v3.CreatePageRequest\x1a#.google.cloud.dialogflow.cx.v3.Page\"V\xda\x41\x0bparent,page\x82\xd3\xe4\x93\x02\x42\":/v3/{parent=projects/*/locations/*/agents/*/flows/*}/pages:\x04page\x12\xc5\x01\n\nUpdatePage\x12\x30.google.cloud.dialogflow.cx.v3.UpdatePageRequest\x1a#.google.cloud.dialogflow.cx.v3.Page\"`\xda\x41\x10page,update_mask\x82\xd3\xe4\x93\x02G2?/v3/{page.name=projects/*/locations/*/agents/*/flows/*/pages/*}:\x04page\x12\xa1\x01\n\nDeletePage\x12\x30.google.cloud.dialogflow.cx.v3.DeletePageRequest\x1a\x16.google.protobuf.Empty\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<*:/v3/{name=projects/*/locations/*/agents/*/flows/*/pages/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xac\x01\n!com.google.cloud.dialogflow.cx.v3B\tPageProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.dialogflow.cx.v3.Fulfillment", "google/cloud/dialogflow/cx/v3/fulfillment.proto"], - ["google.cloud.dialogflow.cx.v3.AdvancedSettings", "google/cloud/dialogflow/cx/v3/advanced_settings.proto"], - ["google.protobuf.Value", "google/protobuf/struct.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.cloud.dialogflow.cx.v3.DataStoreConnection", "google/cloud/dialogflow/cx/v3/data_store_connection.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - Page = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Page").msgclass - Form = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Form").msgclass - Form::Parameter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Form.Parameter").msgclass - Form::Parameter::FillBehavior = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior").msgclass - EventHandler = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.EventHandler").msgclass - TransitionRoute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TransitionRoute").msgclass - ListPagesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListPagesRequest").msgclass - ListPagesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListPagesResponse").msgclass - GetPageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetPageRequest").msgclass - CreatePageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreatePageRequest").msgclass - UpdatePageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdatePageRequest").msgclass - DeletePageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeletePageRequest").msgclass - KnowledgeConnectorSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.KnowledgeConnectorSettings").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/page_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/page_services_pb.rb deleted file mode 100644 index 07d7822faa9c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/page_services_pb.rb +++ /dev/null @@ -1,67 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/cx/v3/page.proto for package 'Google.Cloud.Dialogflow.CX.V3' -# 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/cx/v3/page_pb' - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Pages - # Service for managing [Pages][google.cloud.dialogflow.cx.v3.Page]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.cx.v3.Pages' - - # Returns the list of all pages in the specified flow. - rpc :ListPages, ::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest, ::Google::Cloud::Dialogflow::CX::V3::ListPagesResponse - # Retrieves the specified page. - rpc :GetPage, ::Google::Cloud::Dialogflow::CX::V3::GetPageRequest, ::Google::Cloud::Dialogflow::CX::V3::Page - # Creates a page in the specified flow. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - rpc :CreatePage, ::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest, ::Google::Cloud::Dialogflow::CX::V3::Page - # Updates the specified page. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - rpc :UpdatePage, ::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest, ::Google::Cloud::Dialogflow::CX::V3::Page - # Deletes the specified page. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - rpc :DeletePage, ::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest, ::Google::Protobuf::Empty - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages.rb deleted file mode 100644 index 024ce1d207ec..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages.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/cx/v3/version" - -require "google/cloud/dialogflow/cx/v3/pages/credentials" -require "google/cloud/dialogflow/cx/v3/pages/paths" -require "google/cloud/dialogflow/cx/v3/pages/client" -require "google/cloud/dialogflow/cx/v3/pages/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Page Pages}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/cx/v3/pages" - # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/cx/v3/pages/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new - # - module Pages - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "pages", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/pages/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/client.rb deleted file mode 100644 index 92a5b764207a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/client.rb +++ /dev/null @@ -1,998 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/page_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Pages - ## - # Client for the Pages service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Page Pages}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :pages_stub - - ## - # Configure the Pages Client class. - # - # See {::Google::Cloud::Dialogflow::CX::V3::Pages::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Pages clients - # ::Google::Cloud::Dialogflow::CX::V3::Pages::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", "CX", "V3"] - 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 Pages 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::CX::V3::Pages::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 - @pages_stub.universe_domain - end - - ## - # Create a new Pages client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Pages 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/cx/v3/page_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 - - @pages_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::CX::V3::Pages::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 - ) - - @pages_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 = @pages_stub.endpoint - config.universe_domain = @pages_stub.universe_domain - config.logger = @pages_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 - @pages_stub.logger - end - - # Service calls - - ## - # Returns the list of all pages in the specified flow. - # - # @overload list_pages(request, options = nil) - # Pass arguments to `list_pages` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pages(parent: nil, language_code: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_pages` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The flow to list all pages for. - # Format: - # `projects//locations//agents//flows/`. - # @param language_code [::String] - # The language to list pages for. The following fields are language - # dependent: - # - # * `Page.entry_fulfillment.messages` - # * `Page.entry_fulfillment.conditional_cases` - # * `Page.event_handlers.trigger_fulfillment.messages` - # * `Page.event_handlers.trigger_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` - # * - # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` - # * - # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` - # * `Page.transition_routes.trigger_fulfillment.messages` - # * `Page.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - # @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::CX::V3::Page>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Page>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListPagesRequest.new - # - # # Call the list_pages method. - # result = client.list_pages request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Page. - # p item - # end - # - def list_pages request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest - - # Converts hash and nil to 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_pages.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_pages.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_pages.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @pages_stub.call_rpc :list_pages, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @pages_stub, :list_pages, 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 page. - # - # @overload get_page(request, options = nil) - # Pass arguments to `get_page` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetPageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetPageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_page(name: nil, language_code: nil) - # Pass arguments to `get_page` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 page. - # Format: - # `projects//locations//agents//flows//pages/`. - # @param language_code [::String] - # The language to retrieve the page for. The following fields are language - # dependent: - # - # * `Page.entry_fulfillment.messages` - # * `Page.entry_fulfillment.conditional_cases` - # * `Page.event_handlers.trigger_fulfillment.messages` - # * `Page.event_handlers.trigger_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` - # * - # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` - # * - # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` - # * `Page.transition_routes.trigger_fulfillment.messages` - # * `Page.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Page] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Page] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetPageRequest.new - # - # # Call the get_page method. - # result = client.get_page request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. - # p result - # - def get_page request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetPageRequest - - # Converts hash and nil to 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_page.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_page.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_page.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @pages_stub.call_rpc :get_page, request, 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 page in the specified flow. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload create_page(request, options = nil) - # Pass arguments to `create_page` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_page(parent: nil, page: nil, language_code: nil) - # Pass arguments to `create_page` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The flow to create a page for. - # Format: - # `projects//locations//agents//flows/`. - # @param page [::Google::Cloud::Dialogflow::CX::V3::Page, ::Hash] - # Required. The page to create. - # @param language_code [::String] - # The language of the following fields in `page`: - # - # * `Page.entry_fulfillment.messages` - # * `Page.entry_fulfillment.conditional_cases` - # * `Page.event_handlers.trigger_fulfillment.messages` - # * `Page.event_handlers.trigger_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` - # * - # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` - # * - # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` - # * `Page.transition_routes.trigger_fulfillment.messages` - # * `Page.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Page] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Page] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreatePageRequest.new - # - # # Call the create_page method. - # result = client.create_page request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. - # p result - # - def create_page request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest - - # Converts hash and nil to 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_page.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_page.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_page.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @pages_stub.call_rpc :create_page, request, 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 page. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload update_page(request, options = nil) - # Pass arguments to `update_page` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_page(page: nil, language_code: nil, update_mask: nil) - # Pass arguments to `update_page` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param page [::Google::Cloud::Dialogflow::CX::V3::Page, ::Hash] - # Required. The page to update. - # @param language_code [::String] - # The language of the following fields in `page`: - # - # * `Page.entry_fulfillment.messages` - # * `Page.entry_fulfillment.conditional_cases` - # * `Page.event_handlers.trigger_fulfillment.messages` - # * `Page.event_handlers.trigger_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` - # * - # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` - # * - # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` - # * `Page.transition_routes.trigger_fulfillment.messages` - # * `Page.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # 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::CX::V3::Page] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Page] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest.new - # - # # Call the update_page method. - # result = client.update_page request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. - # p result - # - def update_page request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest - - # Converts hash and nil to 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_page.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.page&.name - header_params["page.name"] = request.page.name - end - - request_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_page.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_page.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @pages_stub.call_rpc :update_page, request, 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 page. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload delete_page(request, options = nil) - # Pass arguments to `delete_page` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_page(name: nil, force: nil) - # Pass arguments to `delete_page` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 page to delete. - # Format: - # `projects//locations//agents//Flows//pages/`. - # @param force [::Boolean] - # This field has no effect for pages with no incoming transitions. - # For pages with incoming transitions: - # - # * If `force` is set to false, an error will be returned with message - # indicating the incoming transitions. - # * If `force` is set to true, Dialogflow will remove the page, as well as - # any transitions to the page (i.e. [Target - # page][EventHandler.target_page] in event handlers or [Target - # page][TransitionRoute.target_page] in transition routes that point to - # this page will be cleared). - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::DeletePageRequest.new - # - # # Call the delete_page method. - # result = client.delete_page request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_page request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest - - # Converts hash and nil to 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_page.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_page.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_page.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @pages_stub.call_rpc :delete_page, request, 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 Pages API. - # - # This class represents the configuration for Pages, - # 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::CX::V3::Pages::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_pages to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_pages.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_pages.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::CX::V3::Pages::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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 Pages API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_pages` - # @return [::Gapic::Config::Method] - # - attr_reader :list_pages - ## - # RPC-specific configuration for `get_page` - # @return [::Gapic::Config::Method] - # - attr_reader :get_page - ## - # RPC-specific configuration for `create_page` - # @return [::Gapic::Config::Method] - # - attr_reader :create_page - ## - # RPC-specific configuration for `update_page` - # @return [::Gapic::Config::Method] - # - attr_reader :update_page - ## - # RPC-specific configuration for `delete_page` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_page - - # @private - def initialize parent_rpcs = nil - list_pages_config = parent_rpcs.list_pages if parent_rpcs.respond_to? :list_pages - @list_pages = ::Gapic::Config::Method.new list_pages_config - get_page_config = parent_rpcs.get_page if parent_rpcs.respond_to? :get_page - @get_page = ::Gapic::Config::Method.new get_page_config - create_page_config = parent_rpcs.create_page if parent_rpcs.respond_to? :create_page - @create_page = ::Gapic::Config::Method.new create_page_config - update_page_config = parent_rpcs.update_page if parent_rpcs.respond_to? :update_page - @update_page = ::Gapic::Config::Method.new update_page_config - delete_page_config = parent_rpcs.delete_page if parent_rpcs.respond_to? :delete_page - @delete_page = ::Gapic::Config::Method.new delete_page_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/credentials.rb deleted file mode 100644 index 09a036378445..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Pages - # Credentials for the Pages 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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/paths.rb deleted file mode 100644 index 802e31a05a7e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/paths.rb +++ /dev/null @@ -1,254 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - module Pages - # Path helper methods for the Pages API. - module Paths - ## - # Create a fully-qualified EntityType resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param entity_type [String] - # - # @return [::String] - def entity_type_path project:, location:, agent:, entity_type: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/entityTypes/#{entity_type}" - end - - ## - # Create a fully-qualified Flow resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param flow [String] - # - # @return [::String] - def flow_path project:, location:, agent:, flow: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}" - end - - ## - # Create a fully-qualified Generator resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/generators/{generator}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param generator [String] - # - # @return [::String] - def generator_path project:, location:, agent:, generator: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/generators/#{generator}" - end - - ## - # Create a fully-qualified Intent resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/intents/{intent}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param intent [String] - # - # @return [::String] - def intent_path project:, location:, agent:, intent: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/intents/#{intent}" - end - - ## - # Create a fully-qualified Page resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param flow [String] - # @param page [String] - # - # @return [::String] - def page_path project:, location:, agent:, flow:, page: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/pages/#{page}" - end - - ## - # Create a fully-qualified Playbook resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param playbook [String] - # - # @return [::String] - def playbook_path project:, location:, agent:, playbook: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}" - end - - ## - # Create a fully-qualified Tool resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/tools/{tool}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param tool [String] - # - # @return [::String] - def tool_path project:, location:, agent:, tool: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/tools/#{tool}" - end - - ## - # Create a fully-qualified TransitionRouteGroup resource string. - # - # @overload transition_route_group_path(project:, location:, agent:, flow:, transition_route_group:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param flow [String] - # @param transition_route_group [String] - # - # @overload transition_route_group_path(project:, location:, agent:, transition_route_group:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param transition_route_group [String] - # - # @return [::String] - def transition_route_group_path **args - resources = { - "agent:flow:location:project:transition_route_group" => (proc do |project:, location:, agent:, flow:, transition_route_group:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/transitionRouteGroups/#{transition_route_group}" - end), - "agent:location:project:transition_route_group" => (proc do |project:, location:, agent:, transition_route_group:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/transitionRouteGroups/#{transition_route_group}" - 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 Webhook resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param webhook [String] - # - # @return [::String] - def webhook_path project:, location:, agent:, webhook: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/webhooks/#{webhook}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest.rb deleted file mode 100644 index 9964ecb67288..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/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/cx/v3/version" -require "google/cloud/dialogflow/cx/v3/bindings_override" - -require "google/cloud/dialogflow/cx/v3/pages/credentials" -require "google/cloud/dialogflow/cx/v3/pages/paths" -require "google/cloud/dialogflow/cx/v3/pages/rest/client" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Page Pages}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/cx/v3/pages/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new - # - module Pages - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/pages/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb deleted file mode 100644 index 18ea3b406063..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb +++ /dev/null @@ -1,928 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/page_pb" -require "google/cloud/dialogflow/cx/v3/pages/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Pages - module Rest - ## - # REST client for the Pages service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Page Pages}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :pages_stub - - ## - # Configure the Pages Client class. - # - # See {::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Pages clients - # ::Google::Cloud::Dialogflow::CX::V3::Pages::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", "CX", "V3"] - 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 Pages 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::CX::V3::Pages::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 - @pages_stub.universe_domain - end - - ## - # Create a new Pages REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Pages 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 - - @pages_stub = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @pages_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 = @pages_stub.endpoint - config.universe_domain = @pages_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @pages_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 - @pages_stub.logger - end - - # Service calls - - ## - # Returns the list of all pages in the specified flow. - # - # @overload list_pages(request, options = nil) - # Pass arguments to `list_pages` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pages(parent: nil, language_code: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_pages` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The flow to list all pages for. - # Format: - # `projects//locations//agents//flows/`. - # @param language_code [::String] - # The language to list pages for. The following fields are language - # dependent: - # - # * `Page.entry_fulfillment.messages` - # * `Page.entry_fulfillment.conditional_cases` - # * `Page.event_handlers.trigger_fulfillment.messages` - # * `Page.event_handlers.trigger_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` - # * - # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` - # * - # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` - # * `Page.transition_routes.trigger_fulfillment.messages` - # * `Page.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - # @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::CX::V3::Page>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Page>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListPagesRequest.new - # - # # Call the list_pages method. - # result = client.list_pages request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Page. - # p item - # end - # - def list_pages request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest - - # Converts hash and nil to an 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_pages.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_pages.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_pages.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @pages_stub.list_pages request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @pages_stub, :list_pages, "pages", 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 page. - # - # @overload get_page(request, options = nil) - # Pass arguments to `get_page` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetPageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetPageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_page(name: nil, language_code: nil) - # Pass arguments to `get_page` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 page. - # Format: - # `projects//locations//agents//flows//pages/`. - # @param language_code [::String] - # The language to retrieve the page for. The following fields are language - # dependent: - # - # * `Page.entry_fulfillment.messages` - # * `Page.entry_fulfillment.conditional_cases` - # * `Page.event_handlers.trigger_fulfillment.messages` - # * `Page.event_handlers.trigger_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` - # * - # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` - # * - # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` - # * `Page.transition_routes.trigger_fulfillment.messages` - # * `Page.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Page] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Page] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetPageRequest.new - # - # # Call the get_page method. - # result = client.get_page request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. - # p result - # - def get_page request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetPageRequest - - # Converts hash and nil to an 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_page.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_page.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_page.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @pages_stub.get_page request, 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 page in the specified flow. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload create_page(request, options = nil) - # Pass arguments to `create_page` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_page(parent: nil, page: nil, language_code: nil) - # Pass arguments to `create_page` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The flow to create a page for. - # Format: - # `projects//locations//agents//flows/`. - # @param page [::Google::Cloud::Dialogflow::CX::V3::Page, ::Hash] - # Required. The page to create. - # @param language_code [::String] - # The language of the following fields in `page`: - # - # * `Page.entry_fulfillment.messages` - # * `Page.entry_fulfillment.conditional_cases` - # * `Page.event_handlers.trigger_fulfillment.messages` - # * `Page.event_handlers.trigger_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` - # * - # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` - # * - # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` - # * `Page.transition_routes.trigger_fulfillment.messages` - # * `Page.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::Page] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Page] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreatePageRequest.new - # - # # Call the create_page method. - # result = client.create_page request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. - # p result - # - def create_page request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest - - # Converts hash and nil to an 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_page.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_page.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_page.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @pages_stub.create_page request, 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 page. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload update_page(request, options = nil) - # Pass arguments to `update_page` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_page(page: nil, language_code: nil, update_mask: nil) - # Pass arguments to `update_page` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param page [::Google::Cloud::Dialogflow::CX::V3::Page, ::Hash] - # Required. The page to update. - # @param language_code [::String] - # The language of the following fields in `page`: - # - # * `Page.entry_fulfillment.messages` - # * `Page.entry_fulfillment.conditional_cases` - # * `Page.event_handlers.trigger_fulfillment.messages` - # * `Page.event_handlers.trigger_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` - # * - # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` - # * - # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` - # * `Page.transition_routes.trigger_fulfillment.messages` - # * `Page.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # 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::CX::V3::Page] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Page] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest.new - # - # # Call the update_page method. - # result = client.update_page request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. - # p result - # - def update_page request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest - - # Converts hash and nil to an 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_page.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_page.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_page.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @pages_stub.update_page request, 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 page. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload delete_page(request, options = nil) - # Pass arguments to `delete_page` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_page(name: nil, force: nil) - # Pass arguments to `delete_page` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 page to delete. - # Format: - # `projects//locations//agents//Flows//pages/`. - # @param force [::Boolean] - # This field has no effect for pages with no incoming transitions. - # For pages with incoming transitions: - # - # * If `force` is set to false, an error will be returned with message - # indicating the incoming transitions. - # * If `force` is set to true, Dialogflow will remove the page, as well as - # any transitions to the page (i.e. [Target - # page][EventHandler.target_page] in event handlers or [Target - # page][TransitionRoute.target_page] in transition routes that point to - # this page will be cleared). - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::DeletePageRequest.new - # - # # Call the delete_page method. - # result = client.delete_page request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_page request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest - - # Converts hash and nil to an 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_page.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_page.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_page.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @pages_stub.delete_page request, 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 Pages REST API. - # - # This class represents the configuration for Pages 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::CX::V3::Pages::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_pages to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_pages.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_pages.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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 Pages API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_pages` - # @return [::Gapic::Config::Method] - # - attr_reader :list_pages - ## - # RPC-specific configuration for `get_page` - # @return [::Gapic::Config::Method] - # - attr_reader :get_page - ## - # RPC-specific configuration for `create_page` - # @return [::Gapic::Config::Method] - # - attr_reader :create_page - ## - # RPC-specific configuration for `update_page` - # @return [::Gapic::Config::Method] - # - attr_reader :update_page - ## - # RPC-specific configuration for `delete_page` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_page - - # @private - def initialize parent_rpcs = nil - list_pages_config = parent_rpcs.list_pages if parent_rpcs.respond_to? :list_pages - @list_pages = ::Gapic::Config::Method.new list_pages_config - get_page_config = parent_rpcs.get_page if parent_rpcs.respond_to? :get_page - @get_page = ::Gapic::Config::Method.new get_page_config - create_page_config = parent_rpcs.create_page if parent_rpcs.respond_to? :create_page - @create_page = ::Gapic::Config::Method.new create_page_config - update_page_config = parent_rpcs.update_page if parent_rpcs.respond_to? :update_page - @update_page = ::Gapic::Config::Method.new update_page_config - delete_page_config = parent_rpcs.delete_page if parent_rpcs.respond_to? :delete_page - @delete_page = ::Gapic::Config::Method.new delete_page_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb deleted file mode 100644 index 36af238bdcd3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb +++ /dev/null @@ -1,390 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/page_pb" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Pages - module Rest - ## - # REST service stub for the Pages 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_pages REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::ListPagesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::ListPagesResponse] - # A result object deserialized from the server's reply - def list_pages request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_pages_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_pages", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::ListPagesResponse.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_page REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetPageRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::Page] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Page] - # A result object deserialized from the server's reply - def get_page request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_page_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_page", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::Page.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_page REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::Page] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Page] - # A result object deserialized from the server's reply - def create_page request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_page_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_page", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::Page.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_page REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::Page] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Page] - # A result object deserialized from the server's reply - def update_page request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_page_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_page", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::Page.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_page REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_page request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_page_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_page", - 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_pages REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest] - # 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_pages_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/pages", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_page REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetPageRequest] - # 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_page_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/pages/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_page REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest] - # 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_page_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/pages", - body: "page", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_page REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest] - # 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_page_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v3/{page.name}", - body: "page", - matches: [ - ["page.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/pages/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_page REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest] - # 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_page_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/pages/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/response_message_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/response_message_pb.rb deleted file mode 100644 index 7457aceacf3b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/response_message_pb.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/response_message.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/cloud/dialogflow/cx/v3/tool_call_pb' -require 'google/protobuf/struct_pb' - - -descriptor_data = "\n4google/cloud/dialogflow/cx/v3/response_message.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a-google/cloud/dialogflow/cx/v3/tool_call.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xaf\x0e\n\x0fResponseMessage\x12\x43\n\x04text\x18\x01 \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.ResponseMessage.TextH\x00\x12*\n\x07payload\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x12\x62\n\x14\x63onversation_success\x18\t \x01(\x0b\x32\x42.google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccessH\x00\x12[\n\x11output_audio_text\x18\x08 \x01(\x0b\x32>.google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioTextH\x00\x12]\n\x12live_agent_handoff\x18\n \x01(\x0b\x32?.google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoffH\x00\x12]\n\x0f\x65nd_interaction\x18\x0b \x01(\x0b\x32=.google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteractionB\x03\xe0\x41\x03H\x00\x12N\n\nplay_audio\x18\x0c \x01(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudioH\x00\x12U\n\x0bmixed_audio\x18\r \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudioB\x03\xe0\x41\x03H\x00\x12g\n\x17telephony_transfer_call\x18\x12 \x01(\x0b\x32\x44.google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCallH\x00\x12_\n\x13knowledge_info_card\x18\x14 \x01(\x0b\x32@.google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCardH\x00\x12<\n\ttool_call\x18\x16 \x01(\x0b\x32\'.google.cloud.dialogflow.cx.v3.ToolCallH\x00\x12R\n\rresponse_type\x18\x04 \x01(\x0e\x32;.google.cloud.dialogflow.cx.v3.ResponseMessage.ResponseType\x12\x0f\n\x07\x63hannel\x18\x13 \x01(\t\x1a\x43\n\x04Text\x12\x11\n\x04text\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12(\n\x1b\x61llow_playback_interruption\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03\x1a=\n\x10LiveAgentHandoff\x12)\n\x08metadata\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a@\n\x13\x43onversationSuccess\x12)\n\x08metadata\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a\x65\n\x0fOutputAudioText\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x0e\n\x04ssml\x18\x02 \x01(\tH\x00\x12(\n\x1b\x61llow_playback_interruption\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03\x42\x08\n\x06source\x1a\x10\n\x0e\x45ndInteraction\x1aM\n\tPlayAudio\x12\x16\n\taudio_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12(\n\x1b\x61llow_playback_interruption\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03\x1a\xc1\x01\n\nMixedAudio\x12S\n\x08segments\x18\x01 \x03(\x0b\x32\x41.google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment\x1a^\n\x07Segment\x12\x0f\n\x05\x61udio\x18\x01 \x01(\x0cH\x00\x12\r\n\x03uri\x18\x02 \x01(\tH\x00\x12(\n\x1b\x61llow_playback_interruption\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03\x42\t\n\x07\x63ontent\x1a;\n\x15TelephonyTransferCall\x12\x16\n\x0cphone_number\x18\x01 \x01(\tH\x00\x42\n\n\x08\x65ndpoint\x1a\x13\n\x11KnowledgeInfoCard\"i\n\x0cResponseType\x12\x1d\n\x19RESPONSE_TYPE_UNSPECIFIED\x10\x00\x12\x10\n\x0c\x45NTRY_PROMPT\x10\x01\x12\x14\n\x10PARAMETER_PROMPT\x10\x02\x12\x12\n\x0eHANDLER_PROMPT\x10\x03\x42\t\n\x07messageB\xb7\x01\n!com.google.cloud.dialogflow.cx.v3B\x14ResponseMessageProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Struct", "google/protobuf/struct.proto"], - ["google.cloud.dialogflow.cx.v3.ToolCall", "google/cloud/dialogflow/cx/v3/tool_call.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ResponseMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage").msgclass - ResponseMessage::Text = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.Text").msgclass - ResponseMessage::LiveAgentHandoff = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.LiveAgentHandoff").msgclass - ResponseMessage::ConversationSuccess = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess").msgclass - ResponseMessage::OutputAudioText = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.OutputAudioText").msgclass - ResponseMessage::EndInteraction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.EndInteraction").msgclass - ResponseMessage::PlayAudio = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.PlayAudio").msgclass - ResponseMessage::MixedAudio = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio").msgclass - ResponseMessage::MixedAudio::Segment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.MixedAudio.Segment").msgclass - ResponseMessage::TelephonyTransferCall = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.TelephonyTransferCall").msgclass - ResponseMessage::KnowledgeInfoCard = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.KnowledgeInfoCard").msgclass - ResponseMessage::ResponseType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResponseMessage.ResponseType").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/rest.rb deleted file mode 100644 index 46d341588c3c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/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/cx/v3/pages/rest" -require "google/cloud/dialogflow/cx/v3/flows/rest" -require "google/cloud/dialogflow/cx/v3/agents/rest" -require "google/cloud/dialogflow/cx/v3/changelogs/rest" -require "google/cloud/dialogflow/cx/v3/deployments/rest" -require "google/cloud/dialogflow/cx/v3/entity_types/rest" -require "google/cloud/dialogflow/cx/v3/intents/rest" -require "google/cloud/dialogflow/cx/v3/session_entity_types/rest" -require "google/cloud/dialogflow/cx/v3/sessions/rest" -require "google/cloud/dialogflow/cx/v3/transition_route_groups/rest" -require "google/cloud/dialogflow/cx/v3/test_cases/rest" -require "google/cloud/dialogflow/cx/v3/webhooks/rest" -require "google/cloud/dialogflow/cx/v3/environments/rest" -require "google/cloud/dialogflow/cx/v3/examples/rest" -require "google/cloud/dialogflow/cx/v3/experiments/rest" -require "google/cloud/dialogflow/cx/v3/generators/rest" -require "google/cloud/dialogflow/cx/v3/playbooks/rest" -require "google/cloud/dialogflow/cx/v3/security_settings_service/rest" -require "google/cloud/dialogflow/cx/v3/tools/rest" -require "google/cloud/dialogflow/cx/v3/versions/rest" -require "google/cloud/dialogflow/cx/v3/bindings_override" -require "google/cloud/dialogflow/cx/v3/version" - -module Google - module Cloud - module Dialogflow - module CX - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/dialogflow/cx/v3/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new - # - module V3 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/safety_settings_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/safety_settings_pb.rb deleted file mode 100644 index 5943f64c629f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/safety_settings_pb.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/safety_settings.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' - - -descriptor_data = "\n3google/cloud/dialogflow/cx/v3/safety_settings.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\"\xa0\n\n\x0eSafetySettings\x12t\n$default_banned_phrase_match_strategy\x18\x04 \x01(\x0e\x32\x41.google.cloud.dialogflow.cx.v3.SafetySettings.PhraseMatchStrategyB\x03\xe0\x41\x01\x12L\n\x0e\x62\x61nned_phrases\x18\x01 \x03(\x0b\x32\x34.google.cloud.dialogflow.cx.v3.SafetySettings.Phrase\x12T\n\x0crai_settings\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettingsB\x03\xe0\x41\x01\x12_\n\x14\x64\x65\x66\x61ult_rai_settings\x18\x03 \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettingsB\x06\xe0\x41\x01\xe0\x41\x05\x12k\n\x18prompt_security_settings\x18\x08 \x01(\x0b\x32\x44.google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettingsB\x03\xe0\x41\x01\x1a\x37\n\x06Phrase\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\x1a\xcc\x04\n\x0bRaiSettings\x12g\n\x10\x63\x61tegory_filters\x18\x03 \x03(\x0b\x32H.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilterB\x03\xe0\x41\x01\x1a\xcf\x01\n\x0e\x43\x61tegoryFilter\x12Z\n\x08\x63\x61tegory\x18\x01 \x01(\x0e\x32H.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyCategory\x12\x61\n\x0c\x66ilter_level\x18\x02 \x01(\x0e\x32K.google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyFilterLevel\"w\n\x11SafetyFilterLevel\x12#\n\x1fSAFETY_FILTER_LEVEL_UNSPECIFIED\x10\x00\x12\x0e\n\nBLOCK_NONE\x10\x01\x12\r\n\tBLOCK_FEW\x10\x02\x12\x0e\n\nBLOCK_SOME\x10\x03\x12\x0e\n\nBLOCK_MOST\x10\x04\"\x88\x01\n\x0eSafetyCategory\x12\x1f\n\x1bSAFETY_CATEGORY_UNSPECIFIED\x10\x00\x12\x15\n\x11\x44\x41NGEROUS_CONTENT\x10\x01\x12\x0f\n\x0bHATE_SPEECH\x10\x02\x12\x0e\n\nHARASSMENT\x10\x03\x12\x1d\n\x19SEXUALLY_EXPLICIT_CONTENT\x10\x04\x1a=\n\x16PromptSecuritySettings\x12#\n\x16\x65nable_prompt_security\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\"_\n\x13PhraseMatchStrategy\x12%\n!PHRASE_MATCH_STRATEGY_UNSPECIFIED\x10\x00\x12\x11\n\rPARTIAL_MATCH\x10\x01\x12\x0e\n\nWORD_MATCH\x10\x02\x42\xb6\x01\n!com.google.cloud.dialogflow.cx.v3B\x13SafetySettingsProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - SafetySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings").msgclass - SafetySettings::Phrase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings.Phrase").msgclass - SafetySettings::RaiSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings").msgclass - SafetySettings::RaiSettings::CategoryFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.CategoryFilter").msgclass - SafetySettings::RaiSettings::SafetyFilterLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyFilterLevel").enummodule - SafetySettings::RaiSettings::SafetyCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings.RaiSettings.SafetyCategory").enummodule - SafetySettings::PromptSecuritySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings.PromptSecuritySettings").msgclass - SafetySettings::PhraseMatchStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SafetySettings.PhraseMatchStrategy").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_pb.rb deleted file mode 100644 index 3c76cfb09a55..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_pb.rb +++ /dev/null @@ -1,65 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/security_settings.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 = "\n5google/cloud/dialogflow/cx/v3/security_settings.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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\"^\n\x1aGetSecuritySettingsRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*dialogflow.googleapis.com/SecuritySettings\"\xa6\x01\n\x1dUpdateSecuritySettingsRequest\x12O\n\x11security_settings\x18\x01 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.SecuritySettingsB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x88\x01\n\x1bListSecuritySettingsRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*dialogflow.googleapis.com/SecuritySettings\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x83\x01\n\x1cListSecuritySettingsResponse\x12J\n\x11security_settings\x18\x01 \x03(\x0b\x32/.google.cloud.dialogflow.cx.v3.SecuritySettings\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb4\x01\n\x1d\x43reateSecuritySettingsRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*dialogflow.googleapis.com/SecuritySettings\x12O\n\x11security_settings\x18\x02 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.SecuritySettingsB\x03\xe0\x41\x02\"a\n\x1d\x44\x65leteSecuritySettingsRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*dialogflow.googleapis.com/SecuritySettings\"\xe7\x0c\n\x10SecuritySettings\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12]\n\x12redaction_strategy\x18\x03 \x01(\x0e\x32\x41.google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionStrategy\x12W\n\x0fredaction_scope\x18\x04 \x01(\x0e\x32>.google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionScope\x12\x41\n\x10inspect_template\x18\t \x01(\tB\'\xfa\x41$\n\"dlp.googleapis.com/InspectTemplate\x12G\n\x13\x64\x65identify_template\x18\x11 \x01(\tB*\xfa\x41\'\n%dlp.googleapis.com/DeidentifyTemplate\x12\x1f\n\x15retention_window_days\x18\x06 \x01(\x05H\x00\x12_\n\x12retention_strategy\x18\x07 \x01(\x0e\x32\x41.google.cloud.dialogflow.cx.v3.SecuritySettings.RetentionStrategyH\x00\x12W\n\x10purge_data_types\x18\x08 \x03(\x0e\x32=.google.cloud.dialogflow.cx.v3.SecuritySettings.PurgeDataType\x12\x62\n\x15\x61udio_export_settings\x18\x0c \x01(\x0b\x32\x43.google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings\x12h\n\x18insights_export_settings\x18\r \x01(\x0b\x32\x46.google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings\x1a\xb1\x02\n\x13\x41udioExportSettings\x12\x12\n\ngcs_bucket\x18\x01 \x01(\t\x12\x1c\n\x14\x61udio_export_pattern\x18\x02 \x01(\t\x12\x1e\n\x16\x65nable_audio_redaction\x18\x03 \x01(\x08\x12\x65\n\x0c\x61udio_format\x18\x04 \x01(\x0e\x32O.google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.AudioFormat\x12\x17\n\x0fstore_tts_audio\x18\x06 \x01(\x08\"H\n\x0b\x41udioFormat\x12\x1c\n\x18\x41UDIO_FORMAT_UNSPECIFIED\x10\x00\x12\t\n\x05MULAW\x10\x01\x12\x07\n\x03MP3\x10\x02\x12\x07\n\x03OGG\x10\x03\x1a\x38\n\x16InsightsExportSettings\x12\x1e\n\x16\x65nable_insights_export\x18\x01 \x01(\x08\"P\n\x11RedactionStrategy\x12\"\n\x1eREDACTION_STRATEGY_UNSPECIFIED\x10\x00\x12\x17\n\x13REDACT_WITH_SERVICE\x10\x01\"J\n\x0eRedactionScope\x12\x1f\n\x1bREDACTION_SCOPE_UNSPECIFIED\x10\x00\x12\x17\n\x13REDACT_DISK_STORAGE\x10\x02\"V\n\x11RetentionStrategy\x12\"\n\x1eRETENTION_STRATEGY_UNSPECIFIED\x10\x00\x12\x1d\n\x19REMOVE_AFTER_CONVERSATION\x10\x01\"H\n\rPurgeDataType\x12\x1f\n\x1bPURGE_DATA_TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12\x44IALOGFLOW_HISTORY\x10\x01:}\xea\x41z\n*dialogflow.googleapis.com/SecuritySettings\x12Lprojects/{project}/locations/{location}/securitySettings/{security_settings}B\x10\n\x0e\x64\x61ta_retention2\xef\t\n\x17SecuritySettingsService\x12\xf3\x01\n\x16\x43reateSecuritySettings\x12<.google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest\x1a/.google.cloud.dialogflow.cx.v3.SecuritySettings\"j\xda\x41\x18parent,security_settings\x82\xd3\xe4\x93\x02I\"4/v3/{parent=projects/*/locations/*}/securitySettings:\x11security_settings\x12\xc6\x01\n\x13GetSecuritySettings\x12\x39.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest\x1a/.google.cloud.dialogflow.cx.v3.SecuritySettings\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v3/{name=projects/*/locations/*/securitySettings/*}\x12\x8b\x02\n\x16UpdateSecuritySettings\x12<.google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest\x1a/.google.cloud.dialogflow.cx.v3.SecuritySettings\"\x81\x01\xda\x41\x1dsecurity_settings,update_mask\x82\xd3\xe4\x93\x02[2F/v3/{security_settings.name=projects/*/locations/*/securitySettings/*}:\x11security_settings\x12\xd6\x01\n\x14ListSecuritySettings\x12:.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest\x1a;.google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v3/{parent=projects/*/locations/*}/securitySettings\x12\xb3\x01\n\x16\x44\x65leteSecuritySettings\x12<.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest\x1a\x16.google.protobuf.Empty\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36*4/v3/{name=projects/*/locations/*/securitySettings/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xdf\x04\n!com.google.cloud.dialogflow.cx.v3B\x15SecuritySettingsProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3\xea\x41\xc8\x01\n\"dlp.googleapis.com/InspectTemplate\x12Uorganizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}\x12Kprojects/{project}/locations/{location}/inspectTemplates/{inspect_template}\xea\x41\xd7\x01\n%dlp.googleapis.com/DeidentifyTemplate\x12[organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}\x12Qprojects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - GetSecuritySettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest").msgclass - UpdateSecuritySettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest").msgclass - ListSecuritySettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest").msgclass - ListSecuritySettingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse").msgclass - CreateSecuritySettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest").msgclass - DeleteSecuritySettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest").msgclass - SecuritySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SecuritySettings").msgclass - SecuritySettings::AudioExportSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings").msgclass - SecuritySettings::AudioExportSettings::AudioFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SecuritySettings.AudioExportSettings.AudioFormat").enummodule - SecuritySettings::InsightsExportSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SecuritySettings.InsightsExportSettings").msgclass - SecuritySettings::RedactionStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionStrategy").enummodule - SecuritySettings::RedactionScope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SecuritySettings.RedactionScope").enummodule - SecuritySettings::RetentionStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SecuritySettings.RetentionStrategy").enummodule - SecuritySettings::PurgeDataType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SecuritySettings.PurgeDataType").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service.rb deleted file mode 100644 index e1775b790637..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/dialogflow/cx/v3/version" - -require "google/cloud/dialogflow/cx/v3/security_settings_service/credentials" -require "google/cloud/dialogflow/cx/v3/security_settings_service/paths" -require "google/cloud/dialogflow/cx/v3/security_settings_service/client" -require "google/cloud/dialogflow/cx/v3/security_settings_service/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing security settings for Dialogflow. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/cx/v3/security_settings_service" - # client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/cx/v3/security_settings_service/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new - # - module SecuritySettingsService - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "security_settings_service", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/security_settings_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb deleted file mode 100644 index 7b7335919b7f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb +++ /dev/null @@ -1,894 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/security_settings_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module SecuritySettingsService - ## - # Client for the SecuritySettingsService service. - # - # Service for managing security settings for Dialogflow. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :security_settings_service_stub - - ## - # Configure the SecuritySettingsService Client class. - # - # See {::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SecuritySettingsService clients - # ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::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", "CX", "V3"] - 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 SecuritySettingsService 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::CX::V3::SecuritySettingsService::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 - @security_settings_service_stub.universe_domain - end - - ## - # Create a new SecuritySettingsService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SecuritySettingsService 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/cx/v3/security_settings_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 - - @security_settings_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::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 - ) - - @security_settings_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 = @security_settings_service_stub.endpoint - config.universe_domain = @security_settings_service_stub.universe_domain - config.logger = @security_settings_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @security_settings_service_stub.logger - end - - # Service calls - - ## - # Create security settings in the specified location. - # - # @overload create_security_settings(request, options = nil) - # Pass arguments to `create_security_settings` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_settings(parent: nil, security_settings: nil) - # Pass arguments to `create_security_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 an - # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings} for. - # Format: `projects//locations/`. - # @param security_settings [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings, ::Hash] - # Required. The security settings to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest.new - # - # # Call the create_security_settings method. - # result = client.create_security_settings request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. - # p result - # - def create_security_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest - - # Converts hash and nil to 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_security_settings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_security_settings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_security_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_settings_service_stub.call_rpc :create_security_settings, request, 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 the specified - # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings}. The - # returned settings may be stale by up to 1 minute. - # - # @overload get_security_settings(request, options = nil) - # Pass arguments to `get_security_settings` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_settings(name: nil) - # Pass arguments to `get_security_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of the settings. - # Format: - # `projects//locations//securitySettings/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest.new - # - # # Call the get_security_settings method. - # result = client.get_security_settings request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. - # p result - # - def get_security_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest - - # Converts hash and nil to 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_security_settings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_security_settings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_security_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_settings_service_stub.call_rpc :get_security_settings, request, 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 - # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings}. - # - # @overload update_security_settings(request, options = nil) - # Pass arguments to `update_security_settings` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_settings(security_settings: nil, update_mask: nil) - # Pass arguments to `update_security_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param security_settings [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings, ::Hash] - # Required. [SecuritySettings] object that contains values for each of the - # fields 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::CX::V3::SecuritySettings] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest.new - # - # # Call the update_security_settings method. - # result = client.update_security_settings request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. - # p result - # - def update_security_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest - - # Converts hash and nil to 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_security_settings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.security_settings&.name - header_params["security_settings.name"] = request.security_settings.name - end - - request_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_security_settings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_security_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_settings_service_stub.call_rpc :update_security_settings, request, 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 security settings in the specified location. - # - # @overload list_security_settings(request, options = nil) - # Pass arguments to `list_security_settings` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_settings(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_security_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 all security settings for. - # Format: `projects//locations/`. - # @param page_size [::Integer] - # The maximum number of items to return in a single page. By default 20 and - # at most 100. - # @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::CX::V3::SecuritySettings>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::SecuritySettings>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest.new - # - # # Call the list_security_settings method. - # result = client.list_security_settings request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::SecuritySettings. - # p item - # end - # - def list_security_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest - - # Converts hash and nil to 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_security_settings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_security_settings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_security_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_settings_service_stub.call_rpc :list_security_settings, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_settings_service_stub, :list_security_settings, 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 - # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings}. - # - # @overload delete_security_settings(request, options = nil) - # Pass arguments to `delete_security_settings` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_settings(name: nil) - # Pass arguments to `delete_security_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 - # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings} to - # delete. Format: - # `projects//locations//securitySettings/`. - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest.new - # - # # Call the delete_security_settings method. - # result = client.delete_security_settings request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_security_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest - - # Converts hash and nil to 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_security_settings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_security_settings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_security_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_settings_service_stub.call_rpc :delete_security_settings, request, 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 SecuritySettingsService API. - # - # This class represents the configuration for SecuritySettingsService, - # 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::CX::V3::SecuritySettingsService::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_security_settings to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_security_settings.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_security_settings.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::CX::V3::SecuritySettingsService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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 SecuritySettingsService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_security_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :create_security_settings - ## - # RPC-specific configuration for `get_security_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :get_security_settings - ## - # RPC-specific configuration for `update_security_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :update_security_settings - ## - # RPC-specific configuration for `list_security_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_security_settings - ## - # RPC-specific configuration for `delete_security_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_security_settings - - # @private - def initialize parent_rpcs = nil - create_security_settings_config = parent_rpcs.create_security_settings if parent_rpcs.respond_to? :create_security_settings - @create_security_settings = ::Gapic::Config::Method.new create_security_settings_config - get_security_settings_config = parent_rpcs.get_security_settings if parent_rpcs.respond_to? :get_security_settings - @get_security_settings = ::Gapic::Config::Method.new get_security_settings_config - update_security_settings_config = parent_rpcs.update_security_settings if parent_rpcs.respond_to? :update_security_settings - @update_security_settings = ::Gapic::Config::Method.new update_security_settings_config - list_security_settings_config = parent_rpcs.list_security_settings if parent_rpcs.respond_to? :list_security_settings - @list_security_settings = ::Gapic::Config::Method.new list_security_settings_config - delete_security_settings_config = parent_rpcs.delete_security_settings if parent_rpcs.respond_to? :delete_security_settings - @delete_security_settings = ::Gapic::Config::Method.new delete_security_settings_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/credentials.rb deleted file mode 100644 index 0beea234b10a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module SecuritySettingsService - # Credentials for the SecuritySettingsService 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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/paths.rb deleted file mode 100644 index 5fbd5a07e384..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/paths.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! - - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module SecuritySettingsService - # Path helper methods for the SecuritySettingsService API. - module Paths - ## - # Create a fully-qualified DeidentifyTemplate resource string. - # - # @overload deidentify_template_path(organization:, location:, deidentify_template:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}` - # - # @param organization [String] - # @param location [String] - # @param deidentify_template [String] - # - # @overload deidentify_template_path(project:, location:, deidentify_template:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}` - # - # @param project [String] - # @param location [String] - # @param deidentify_template [String] - # - # @return [::String] - def deidentify_template_path **args - resources = { - "deidentify_template:location:organization" => (proc do |organization:, location:, deidentify_template:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/deidentifyTemplates/#{deidentify_template}" - end), - "deidentify_template:location:project" => (proc do |project:, location:, deidentify_template:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/deidentifyTemplates/#{deidentify_template}" - 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 InspectTemplate resource string. - # - # @overload inspect_template_path(organization:, location:, inspect_template:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}` - # - # @param organization [String] - # @param location [String] - # @param inspect_template [String] - # - # @overload inspect_template_path(project:, location:, inspect_template:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/inspectTemplates/{inspect_template}` - # - # @param project [String] - # @param location [String] - # @param inspect_template [String] - # - # @return [::String] - def inspect_template_path **args - resources = { - "inspect_template:location:organization" => (proc do |organization:, location:, inspect_template:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/inspectTemplates/#{inspect_template}" - end), - "inspect_template:location:project" => (proc do |project:, location:, inspect_template:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/inspectTemplates/#{inspect_template}" - 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 SecuritySettings 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 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 - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest.rb deleted file mode 100644 index 1e754c394ee4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/dialogflow/cx/v3/version" -require "google/cloud/dialogflow/cx/v3/bindings_override" - -require "google/cloud/dialogflow/cx/v3/security_settings_service/credentials" -require "google/cloud/dialogflow/cx/v3/security_settings_service/paths" -require "google/cloud/dialogflow/cx/v3/security_settings_service/rest/client" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing security settings for Dialogflow. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/cx/v3/security_settings_service/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new - # - module SecuritySettingsService - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/security_settings_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb deleted file mode 100644 index b6cc8e9ca84a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb +++ /dev/null @@ -1,824 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/security_settings_pb" -require "google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module SecuritySettingsService - module Rest - ## - # REST client for the SecuritySettingsService service. - # - # Service for managing security settings for Dialogflow. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :security_settings_service_stub - - ## - # Configure the SecuritySettingsService Client class. - # - # See {::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SecuritySettingsService clients - # ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::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", "CX", "V3"] - 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 SecuritySettingsService 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::CX::V3::SecuritySettingsService::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 - @security_settings_service_stub.universe_domain - end - - ## - # Create a new SecuritySettingsService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SecuritySettingsService 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 - - @security_settings_service_stub = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @security_settings_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 = @security_settings_service_stub.endpoint - config.universe_domain = @security_settings_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @security_settings_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @security_settings_service_stub.logger - end - - # Service calls - - ## - # Create security settings in the specified location. - # - # @overload create_security_settings(request, options = nil) - # Pass arguments to `create_security_settings` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_settings(parent: nil, security_settings: nil) - # Pass arguments to `create_security_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 an - # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings} for. - # Format: `projects//locations/`. - # @param security_settings [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings, ::Hash] - # Required. The security settings to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest.new - # - # # Call the create_security_settings method. - # result = client.create_security_settings request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. - # p result - # - def create_security_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest - - # Converts hash and nil to an 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_security_settings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_security_settings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_security_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_settings_service_stub.create_security_settings request, 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 the specified - # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings}. The - # returned settings may be stale by up to 1 minute. - # - # @overload get_security_settings(request, options = nil) - # Pass arguments to `get_security_settings` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_settings(name: nil) - # Pass arguments to `get_security_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of the settings. - # Format: - # `projects//locations//securitySettings/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest.new - # - # # Call the get_security_settings method. - # result = client.get_security_settings request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. - # p result - # - def get_security_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest - - # Converts hash and nil to an 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_security_settings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_security_settings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_security_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_settings_service_stub.get_security_settings request, 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 - # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings}. - # - # @overload update_security_settings(request, options = nil) - # Pass arguments to `update_security_settings` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_settings(security_settings: nil, update_mask: nil) - # Pass arguments to `update_security_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param security_settings [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings, ::Hash] - # Required. [SecuritySettings] object that contains values for each of the - # fields 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::CX::V3::SecuritySettings] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest.new - # - # # Call the update_security_settings method. - # result = client.update_security_settings request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. - # p result - # - def update_security_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest - - # Converts hash and nil to an 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_security_settings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_security_settings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_security_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_settings_service_stub.update_security_settings request, 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 security settings in the specified location. - # - # @overload list_security_settings(request, options = nil) - # Pass arguments to `list_security_settings` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_settings(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_security_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 all security settings for. - # Format: `projects//locations/`. - # @param page_size [::Integer] - # The maximum number of items to return in a single page. By default 20 and - # at most 100. - # @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::CX::V3::SecuritySettings>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::SecuritySettings>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest.new - # - # # Call the list_security_settings method. - # result = client.list_security_settings request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::SecuritySettings. - # p item - # end - # - def list_security_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest - - # Converts hash and nil to an 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_security_settings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_security_settings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_security_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_settings_service_stub.list_security_settings request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_settings_service_stub, :list_security_settings, "security_settings", 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 - # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings}. - # - # @overload delete_security_settings(request, options = nil) - # Pass arguments to `delete_security_settings` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_settings(name: nil) - # Pass arguments to `delete_security_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 - # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings} to - # delete. Format: - # `projects//locations//securitySettings/`. - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest.new - # - # # Call the delete_security_settings method. - # result = client.delete_security_settings request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_security_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest - - # Converts hash and nil to an 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_security_settings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_security_settings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_security_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_settings_service_stub.delete_security_settings request, 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 SecuritySettingsService REST API. - # - # This class represents the configuration for SecuritySettingsService 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::CX::V3::SecuritySettingsService::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_security_settings to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_security_settings.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_security_settings.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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 SecuritySettingsService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_security_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :create_security_settings - ## - # RPC-specific configuration for `get_security_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :get_security_settings - ## - # RPC-specific configuration for `update_security_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :update_security_settings - ## - # RPC-specific configuration for `list_security_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_security_settings - ## - # RPC-specific configuration for `delete_security_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_security_settings - - # @private - def initialize parent_rpcs = nil - create_security_settings_config = parent_rpcs.create_security_settings if parent_rpcs.respond_to? :create_security_settings - @create_security_settings = ::Gapic::Config::Method.new create_security_settings_config - get_security_settings_config = parent_rpcs.get_security_settings if parent_rpcs.respond_to? :get_security_settings - @get_security_settings = ::Gapic::Config::Method.new get_security_settings_config - update_security_settings_config = parent_rpcs.update_security_settings if parent_rpcs.respond_to? :update_security_settings - @update_security_settings = ::Gapic::Config::Method.new update_security_settings_config - list_security_settings_config = parent_rpcs.list_security_settings if parent_rpcs.respond_to? :list_security_settings - @list_security_settings = ::Gapic::Config::Method.new list_security_settings_config - delete_security_settings_config = parent_rpcs.delete_security_settings if parent_rpcs.respond_to? :delete_security_settings - @delete_security_settings = ::Gapic::Config::Method.new delete_security_settings_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb deleted file mode 100644 index a6987639fc2b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb +++ /dev/null @@ -1,390 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/security_settings_pb" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module SecuritySettingsService - module Rest - ## - # REST service stub for the SecuritySettingsService 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_security_settings REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::SecuritySettings] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] - # A result object deserialized from the server's reply - def create_security_settings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_security_settings_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_security_settings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings.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_security_settings REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::SecuritySettings] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] - # A result object deserialized from the server's reply - def get_security_settings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_security_settings_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_security_settings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings.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_security_settings REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::SecuritySettings] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] - # A result object deserialized from the server's reply - def update_security_settings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_security_settings_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_security_settings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings.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_security_settings REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::ListSecuritySettingsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsResponse] - # A result object deserialized from the server's reply - def list_security_settings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_security_settings_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_security_settings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsResponse.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_security_settings REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_security_settings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_security_settings_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_security_settings", - 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_security_settings REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest] - # 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_security_settings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/securitySettings", - body: "security_settings", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_security_settings REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest] - # 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_security_settings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/securitySettings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_security_settings REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest] - # 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_security_settings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v3/{security_settings.name}", - body: "security_settings", - matches: [ - ["security_settings.name", %r{^projects/[^/]+/locations/[^/]+/securitySettings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_security_settings REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest] - # 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_security_settings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/securitySettings", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_security_settings REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest] - # 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_security_settings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/securitySettings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_services_pb.rb deleted file mode 100644 index 2b5dd9181e26..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_services_pb.rb +++ /dev/null @@ -1,59 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/cx/v3/security_settings.proto for package 'Google.Cloud.Dialogflow.CX.V3' -# 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/cx/v3/security_settings_pb' - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module SecuritySettingsService - # Service for managing security settings for Dialogflow. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.cx.v3.SecuritySettingsService' - - # Create security settings in the specified location. - rpc :CreateSecuritySettings, ::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest, ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings - # Retrieves the specified - # [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. The - # returned settings may be stale by up to 1 minute. - rpc :GetSecuritySettings, ::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest, ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings - # Updates the specified - # [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. - rpc :UpdateSecuritySettings, ::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest, ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings - # Returns the list of all security settings in the specified location. - rpc :ListSecuritySettings, ::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsResponse - # Deletes the specified - # [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. - rpc :DeleteSecuritySettings, ::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest, ::Google::Protobuf::Empty - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_type_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_type_pb.rb deleted file mode 100644 index 847ce9867bd6..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_type_pb.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/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/cx/v3/entity_type_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n7google/cloud/dialogflow/cx/v3/session_entity_type.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/entity_type.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xf5\x04\n\x11SessionEntityType\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x66\n\x14\x65ntity_override_mode\x18\x03 \x01(\x0e\x32\x43.google.cloud.dialogflow.cx.v3.SessionEntityType.EntityOverrideModeB\x03\xe0\x41\x02\x12G\n\x08\x65ntities\x18\x04 \x03(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.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:\x96\x02\xea\x41\x92\x02\n+dialogflow.googleapis.com/SessionEntityType\x12\x63projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}\x12~projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}\"\x8b\x01\n\x1dListSessionEntityTypesRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+dialogflow.googleapis.com/SessionEntityType\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x89\x01\n\x1eListSessionEntityTypesResponse\x12N\n\x14session_entity_types\x18\x01 \x03(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.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\"\xb9\x01\n\x1e\x43reateSessionEntityTypeRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+dialogflow.googleapis.com/SessionEntityType\x12R\n\x13session_entity_type\x18\x02 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.SessionEntityTypeB\x03\xe0\x41\x02\"\xa5\x01\n\x1eUpdateSessionEntityTypeRequest\x12R\n\x13session_entity_type\x18\x01 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.SessionEntityTypeB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"c\n\x1e\x44\x65leteSessionEntityTypeRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+dialogflow.googleapis.com/SessionEntityType2\xc5\x0e\n\x12SessionEntityTypes\x12\xc3\x02\n\x16ListSessionEntityTypes\x12<.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest\x1a=.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse\"\xab\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x9b\x01\x12\x43/v3/{parent=projects/*/locations/*/agents/*/sessions/*}/entityTypesZT\x12R/v3/{parent=projects/*/locations/*/agents/*/environments/*/sessions/*}/entityTypes\x12\xb0\x02\n\x14GetSessionEntityType\x12:.google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest\x1a\x30.google.cloud.dialogflow.cx.v3.SessionEntityType\"\xa9\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x9b\x01\x12\x43/v3/{name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}ZT\x12R/v3/{name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}\x12\xf6\x02\n\x17\x43reateSessionEntityType\x12=.google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest\x1a\x30.google.cloud.dialogflow.cx.v3.SessionEntityType\"\xe9\x01\xda\x41\x1aparent,session_entity_type\x82\xd3\xe4\x93\x02\xc5\x01\"C/v3/{parent=projects/*/locations/*/agents/*/sessions/*}/entityTypes:\x13session_entity_typeZi\"R/v3/{parent=projects/*/locations/*/agents/*/environments/*/sessions/*}/entityTypes:\x13session_entity_type\x12\xa3\x03\n\x17UpdateSessionEntityType\x12=.google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest\x1a\x30.google.cloud.dialogflow.cx.v3.SessionEntityType\"\x96\x02\xda\x41\x1fsession_entity_type,update_mask\x82\xd3\xe4\x93\x02\xed\x01\x32W/v3/{session_entity_type.name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}:\x13session_entity_typeZ}2f/v3/{session_entity_type.name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}:\x13session_entity_type\x12\x9c\x02\n\x17\x44\x65leteSessionEntityType\x12=.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest\x1a\x16.google.protobuf.Empty\"\xa9\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x9b\x01*C/v3/{name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}ZT*R/v3/{name=projects/*/locations/*/agents/*/environments/*/sessions/*/entityTypes/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xb9\x01\n!com.google.cloud.dialogflow.cx.v3B\x16SessionEntityTypeProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.dialogflow.cx.v3.EntityType.Entity", "google/cloud/dialogflow/cx/v3/entity_type.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - SessionEntityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SessionEntityType").msgclass - SessionEntityType::EntityOverrideMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SessionEntityType.EntityOverrideMode").enummodule - ListSessionEntityTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest").msgclass - ListSessionEntityTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse").msgclass - GetSessionEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest").msgclass - CreateSessionEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest").msgclass - UpdateSessionEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest").msgclass - DeleteSessionEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_type_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_type_services_pb.rb deleted file mode 100644 index 76668def184d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_type_services_pb.rb +++ /dev/null @@ -1,56 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/cx/v3/session_entity_type.proto for package 'Google.Cloud.Dialogflow.CX.V3' -# 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/cx/v3/session_entity_type_pb' - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module SessionEntityTypes - # Service for managing - # [SessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityType]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.cx.v3.SessionEntityTypes' - - # Returns the list of all session entity types in the specified session. - rpc :ListSessionEntityTypes, ::Google::Cloud::Dialogflow::CX::V3::ListSessionEntityTypesRequest, ::Google::Cloud::Dialogflow::CX::V3::ListSessionEntityTypesResponse - # Retrieves the specified session entity type. - rpc :GetSessionEntityType, ::Google::Cloud::Dialogflow::CX::V3::GetSessionEntityTypeRequest, ::Google::Cloud::Dialogflow::CX::V3::SessionEntityType - # Creates a session entity type. - rpc :CreateSessionEntityType, ::Google::Cloud::Dialogflow::CX::V3::CreateSessionEntityTypeRequest, ::Google::Cloud::Dialogflow::CX::V3::SessionEntityType - # Updates the specified session entity type. - rpc :UpdateSessionEntityType, ::Google::Cloud::Dialogflow::CX::V3::UpdateSessionEntityTypeRequest, ::Google::Cloud::Dialogflow::CX::V3::SessionEntityType - # Deletes the specified session entity type. - rpc :DeleteSessionEntityType, ::Google::Cloud::Dialogflow::CX::V3::DeleteSessionEntityTypeRequest, ::Google::Protobuf::Empty - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types.rb deleted file mode 100644 index e98527de8c5b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types.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/cx/v3/version" - -require "google/cloud/dialogflow/cx/v3/session_entity_types/credentials" -require "google/cloud/dialogflow/cx/v3/session_entity_types/paths" -require "google/cloud/dialogflow/cx/v3/session_entity_types/client" -require "google/cloud/dialogflow/cx/v3/session_entity_types/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing - # {::Google::Cloud::Dialogflow::CX::V3::SessionEntityType SessionEntityTypes}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/cx/v3/session_entity_types" - # client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/cx/v3/session_entity_types/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new - # - module SessionEntityTypes - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "session_entity_types", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/session_entity_types/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb deleted file mode 100644 index 0b7a5d67f7a1..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb +++ /dev/null @@ -1,911 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/dialogflow/cx/v3/session_entity_type_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module SessionEntityTypes - ## - # Client for the SessionEntityTypes service. - # - # Service for managing - # {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityTypes::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SessionEntityTypes clients - # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] - 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::CX::V3::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::CX::V3::SessionEntityTypes::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::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/cx/v3/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::CX::V3::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. - # - # @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::CX::V3::ListSessionEntityTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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//locations//agents//sessions/` - # or - # `projects//locations//agents//environments//sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. - # @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::CX::V3::SessionEntityType>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::SessionEntityType>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-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. - # - # @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::CX::V3::GetSessionEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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//locations//agents//sessions//entityTypes/` - # or - # `projects//locations//agents//environments//sessions//entityTypes/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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. - # - # @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::CX::V3::CreateSessionEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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//locations//agents//sessions/` - # or - # `projects//locations//agents//environments//sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. - # @param session_entity_type [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityType] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-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. - # - # @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::CX::V3::UpdateSessionEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityType, ::Hash] - # Required. The session entity type to update. - # Format: - # `projects//locations//agents//sessions//entityTypes/` - # or - # `projects//locations//agents//environments//sessions//entityTypes/`. - # If `Environment ID` is not specified, - # we assume default 'draft' environment. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The mask to control which fields get updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-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. - # - # @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::CX::V3::DeleteSessionEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 session entity type to delete. - # Format: - # `projects//locations//agents//sessions//entityTypes/` - # or - # `projects//locations//agents//environments//sessions//entityTypes/`. - # If `Environment ID` is not specified, - # we assume default 'draft' environment. - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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. - # * `: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. - # * `: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-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/credentials.rb deleted file mode 100644 index 639602e34074..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - 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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/paths.rb deleted file mode 100644 index 955bbddd5d5a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/paths.rb +++ /dev/null @@ -1,137 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module SessionEntityTypes - # Path helper methods for the SessionEntityTypes API. - module Paths - ## - # Create a fully-qualified Session resource string. - # - # @overload session_path(project:, location:, agent:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param session [String] - # - # @overload session_path(project:, location:, agent:, environment:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param environment [String] - # @param session [String] - # - # @return [::String] - def session_path **args - resources = { - "agent:location:project:session" => (proc do |project:, location:, agent:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/sessions/#{session}" - end), - "agent:environment:location:project:session" => (proc do |project:, location:, agent:, environment:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}/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:, location:, agent:, session:, entity_type:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param session [String] - # @param entity_type [String] - # - # @overload session_entity_type_path(project:, location:, agent:, environment:, session:, entity_type:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param environment [String] - # @param session [String] - # @param entity_type [String] - # - # @return [::String] - def session_entity_type_path **args - resources = { - "agent:entity_type:location:project:session" => (proc do |project:, location:, agent:, 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, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/sessions/#{session}/entityTypes/#{entity_type}" - end), - "agent:entity_type:environment:location:project:session" => (proc do |project:, location:, agent:, environment:, 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, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}/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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest.rb deleted file mode 100644 index b5b410a5a089..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/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/cx/v3/version" -require "google/cloud/dialogflow/cx/v3/bindings_override" - -require "google/cloud/dialogflow/cx/v3/session_entity_types/credentials" -require "google/cloud/dialogflow/cx/v3/session_entity_types/paths" -require "google/cloud/dialogflow/cx/v3/session_entity_types/rest/client" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing - # {::Google::Cloud::Dialogflow::CX::V3::SessionEntityType SessionEntityTypes}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/cx/v3/session_entity_types/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new - # - module SessionEntityTypes - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/session_entity_types/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb deleted file mode 100644 index 7eccd2b1c4fe..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/dialogflow/cx/v3/session_entity_type_pb" -require "google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module SessionEntityTypes - module Rest - ## - # REST client for the SessionEntityTypes service. - # - # Service for managing - # {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityTypes::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SessionEntityTypes clients - # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] - 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::CX::V3::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::CX::V3::SessionEntityTypes::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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. - # - # @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::CX::V3::ListSessionEntityTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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//locations//agents//sessions/` - # or - # `projects//locations//agents//environments//sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. - # @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::CX::V3::SessionEntityType>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::SessionEntityType>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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. - # - # @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::CX::V3::GetSessionEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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//locations//agents//sessions//entityTypes/` - # or - # `projects//locations//agents//environments//sessions//entityTypes/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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. - # - # @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::CX::V3::CreateSessionEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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//locations//agents//sessions/` - # or - # `projects//locations//agents//environments//sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. - # @param session_entity_type [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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. - # - # @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::CX::V3::UpdateSessionEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityType, ::Hash] - # Required. The session entity type to update. - # Format: - # `projects//locations//agents//sessions//entityTypes/` - # or - # `projects//locations//agents//environments//sessions//entityTypes/`. - # If `Environment ID` is not specified, - # we assume default 'draft' environment. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The mask to control which fields get updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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. - # - # @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::CX::V3::DeleteSessionEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 session entity type to delete. - # Format: - # `projects//locations//agents//sessions//entityTypes/` - # or - # `projects//locations//agents//environments//sessions//entityTypes/`. - # If `Environment ID` is not specified, - # we assume default 'draft' environment. - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::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::CX::V3::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::CX::V3::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. - # * `: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. - # * `: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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.rb deleted file mode 100644 index fce6f42fb4a1..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.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 "google/cloud/dialogflow/cx/v3/session_entity_type_pb" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - 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::CX::V3::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::CX::V3::ListSessionEntityTypesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::SessionEntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::SessionEntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::SessionEntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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: "/v3/{parent}/entityTypes", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/entityTypes", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/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::CX::V3::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: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/sessions/[^/]+/entityTypes/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/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::CX::V3::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: "/v3/{parent}/entityTypes", - body: "session_entity_type", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/entityTypes", - body: "session_entity_type", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/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::CX::V3::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: "/v3/{session_entity_type.name}", - body: "session_entity_type", - matches: [ - ["session_entity_type.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/sessions/[^/]+/entityTypes/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v3/{session_entity_type.name}", - body: "session_entity_type", - matches: [ - ["session_entity_type.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/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::CX::V3::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: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/sessions/[^/]+/entityTypes/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/sessions/[^/]+/entityTypes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_pb.rb deleted file mode 100644 index 74b0a540997a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_pb.rb +++ /dev/null @@ -1,115 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/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/cx/v3/advanced_settings_pb' -require 'google/cloud/dialogflow/cx/v3/audio_config_pb' -require 'google/cloud/dialogflow/cx/v3/data_store_connection_pb' -require 'google/cloud/dialogflow/cx/v3/flow_pb' -require 'google/cloud/dialogflow/cx/v3/generative_settings_pb' -require 'google/cloud/dialogflow/cx/v3/intent_pb' -require 'google/cloud/dialogflow/cx/v3/page_pb' -require 'google/cloud/dialogflow/cx/v3/response_message_pb' -require 'google/cloud/dialogflow/cx/v3/session_entity_type_pb' -require 'google/cloud/dialogflow/cx/v3/tool_call_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/cx/v3/session.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/advanced_settings.proto\x1a\x30google/cloud/dialogflow/cx/v3/audio_config.proto\x1a\x39google/cloud/dialogflow/cx/v3/data_store_connection.proto\x1a(google/cloud/dialogflow/cx/v3/flow.proto\x1a\x37google/cloud/dialogflow/cx/v3/generative_settings.proto\x1a*google/cloud/dialogflow/cx/v3/intent.proto\x1a(google/cloud/dialogflow/cx/v3/page.proto\x1a\x34google/cloud/dialogflow/cx/v3/response_message.proto\x1a\x37google/cloud/dialogflow/cx/v3/session_entity_type.proto\x1a-google/cloud/dialogflow/cx/v3/tool_call.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\"\xd4\x02\n\x0e\x41nswerFeedback\x12I\n\x06rating\x18\x01 \x01(\x0e\x32\x34.google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingB\x03\xe0\x41\x01\x12V\n\rrating_reason\x18\x02 \x01(\x0b\x32:.google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReasonB\x03\xe0\x41\x01\x12\x1a\n\rcustom_rating\x18\x03 \x01(\tB\x03\xe0\x41\x01\x1a\x41\n\x0cRatingReason\x12\x1a\n\rreason_labels\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x15\n\x08\x66\x65\x65\x64\x62\x61\x63k\x18\x02 \x01(\tB\x03\xe0\x41\x01\"@\n\x06Rating\x12\x16\n\x12RATING_UNSPECIFIED\x10\x00\x12\r\n\tTHUMBS_UP\x10\x01\x12\x0f\n\x0bTHUMBS_DOWN\x10\x02\"\xf6\x01\n\x1bSubmitAnswerFeedbackRequest\x12:\n\x07session\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Session\x12\x18\n\x0bresponse_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12K\n\x0f\x61nswer_feedback\x18\x03 \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.AnswerFeedbackB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\x80\x03\n\x13\x44\x65tectIntentRequest\x12:\n\x07session\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Session\x12\x44\n\x0cquery_params\x18\x02 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.QueryParameters\x12\x43\n\x0bquery_input\x18\x03 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.QueryInputB\x03\xe0\x41\x02\x12M\n\x13output_audio_config\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.OutputAudioConfig\x12S\n\rresponse_view\x18\t \x01(\x0e\x32\x37.google.cloud.dialogflow.cx.v3.DetectIntentResponseViewB\x03\xe0\x41\x01\"\x8e\x03\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.cx.v3.QueryResult\x12\x14\n\x0coutput_audio\x18\x04 \x01(\x0c\x12M\n\x13output_audio_config\x18\x05 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.OutputAudioConfig\x12W\n\rresponse_type\x18\x06 \x01(\x0e\x32@.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType\x12\x1a\n\x12\x61llow_cancellation\x18\x07 \x01(\x08\"E\n\x0cResponseType\x12\x1d\n\x19RESPONSE_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PARTIAL\x10\x01\x12\t\n\x05\x46INAL\x10\x02\"\xc6\x03\n\x1cStreamingDetectIntentRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Session\x12\x44\n\x0cquery_params\x18\x02 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.QueryParameters\x12\x43\n\x0bquery_input\x18\x03 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.QueryInputB\x03\xe0\x41\x02\x12M\n\x13output_audio_config\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.OutputAudioConfig\x12\x1f\n\x17\x65nable_partial_response\x18\x05 \x01(\x08\x12\x1d\n\x15\x65nable_debugging_info\x18\x08 \x01(\x08\x12S\n\rresponse_view\x18\x10 \x01(\x0e\x32\x37.google.cloud.dialogflow.cx.v3.DetectIntentResponseViewB\x03\xe0\x41\x01\"\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\"\xb2\x02\n\x1dStreamingDetectIntentResponse\x12W\n\x12recognition_result\x18\x01 \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.StreamingRecognitionResultH\x00\x12U\n\x16\x64\x65tect_intent_response\x18\x02 \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.DetectIntentResponseH\x00\x12U\n\x0e\x64\x65\x62ugging_info\x18\x04 \x01(\x0b\x32=.google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfoB\n\n\x08response\"\xb6\x03\n\x1aStreamingRecognitionResult\x12[\n\x0cmessage_type\x18\x01 \x01(\x0e\x32\x45.google.cloud.dialogflow.cx.v3.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\x11\n\tstability\x18\x06 \x01(\x02\x12G\n\x10speech_word_info\x18\x07 \x03(\x0b\x32-.google.cloud.dialogflow.cx.v3.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\"\xf3\x07\n\x0fQueryParameters\x12\x11\n\ttime_zone\x18\x01 \x01(\t\x12)\n\x0cgeo_location\x18\x02 \x01(\x0b\x32\x13.google.type.LatLng\x12N\n\x14session_entity_types\x18\x03 \x03(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.SessionEntityType\x12(\n\x07payload\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12+\n\nparameters\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x17\n\x0fparameter_scope\x18\x0c \x01(\t\x12\x39\n\x0c\x63urrent_page\x18\x06 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Page\x12\x17\n\x0f\x64isable_webhook\x18\x07 \x01(\x08\x12$\n\x1c\x61nalyze_query_text_sentiment\x18\x08 \x01(\x08\x12[\n\x0fwebhook_headers\x18\n \x03(\x0b\x32\x42.google.cloud.dialogflow.cx.v3.QueryParameters.WebhookHeadersEntry\x12=\n\rflow_versions\x18\x0e \x03(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Version\x12\x44\n\x10\x63urrent_playbook\x18\x13 \x01(\tB*\xe0\x41\x01\xfa\x41$\n\"dialogflow.googleapis.com/Playbook\x12P\n\x12llm_model_settings\x18\x15 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.LlmModelSettingsB\x03\xe0\x41\x01\x12\x0f\n\x07\x63hannel\x18\x0f \x01(\t\x12\x33\n\x0bsession_ttl\x18\x10 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x37\n\x11\x65nd_user_metadata\x18\x12 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12G\n\rsearch_config\x18\x14 \x01(\x0b\x32+.google.cloud.dialogflow.cx.v3.SearchConfigB\x03\xe0\x41\x01\x12\x35\n&populate_data_store_connection_signals\x18\x19 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x1a\x35\n\x13WebhookHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x9a\x01\n\x0cSearchConfig\x12\x43\n\x0b\x62oost_specs\x18\x01 \x03(\x0b\x32).google.cloud.dialogflow.cx.v3.BoostSpecsB\x03\xe0\x41\x01\x12\x45\n\x0c\x66ilter_specs\x18\x02 \x03(\x0b\x32*.google.cloud.dialogflow.cx.v3.FilterSpecsB\x03\xe0\x41\x01\"\x9b\x07\n\tBoostSpec\x12_\n\x15\x63ondition_boost_specs\x18\x01 \x03(\x0b\x32;.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpecB\x03\xe0\x41\x01\x1a\xac\x06\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\x12m\n\x12\x62oost_control_spec\x18\x04 \x01(\x0b\x32L.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpecB\x03\xe0\x41\x01\x1a\xfa\x04\n\x10\x42oostControlSpec\x12\x17\n\nfield_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12w\n\x0e\x61ttribute_type\x18\x02 \x01(\x0e\x32Z.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeTypeB\x03\xe0\x41\x01\x12\x7f\n\x12interpolation_type\x18\x03 \x01(\x0e\x32^.google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationTypeB\x03\xe0\x41\x01\x12v\n\x0e\x63ontrol_points\x18\x04 \x03(\x0b\x32Y.google.cloud.dialogflow.cx.v3.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\"\x90\x01\n\nBoostSpecs\x12\x45\n\x0b\x64\x61ta_stores\x18\x01 \x03(\tB0\xe0\x41\x01\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12;\n\x04spec\x18\x02 \x03(\x0b\x32(.google.cloud.dialogflow.cx.v3.BoostSpecB\x03\xe0\x41\x01\"i\n\x0b\x46ilterSpecs\x12\x45\n\x0b\x64\x61ta_stores\x18\x01 \x03(\tB0\xe0\x41\x01\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xa6\x03\n\nQueryInput\x12\x38\n\x04text\x18\x02 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.TextInputH\x00\x12<\n\x06intent\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.IntentInputH\x00\x12:\n\x05\x61udio\x18\x05 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.AudioInputH\x00\x12:\n\x05\x65vent\x18\x06 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.EventInputH\x00\x12\x38\n\x04\x64tmf\x18\x07 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.DtmfInputH\x00\x12I\n\x10tool_call_result\x18\x0b \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.ToolCallResultH\x00\x12\x1a\n\rlanguage_code\x18\x04 \x01(\tB\x03\xe0\x41\x02\x42\x07\n\x05input\"\xae\x08\n\x0bQueryResult\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12?\n\x0etrigger_intent\x18\x0b \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/IntentH\x00\x12\x14\n\ntranscript\x18\x0c \x01(\tH\x00\x12\x17\n\rtrigger_event\x18\x0e \x01(\tH\x00\x12\x38\n\x04\x64tmf\x18\x17 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.DtmfInputH\x00\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12+\n\nparameters\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\x12I\n\x11response_messages\x18\x04 \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.ResponseMessage\x12,\n\x10webhook_statuses\x18\r \x03(\x0b\x32\x12.google.rpc.Status\x12\x31\n\x10webhook_payloads\x18\x06 \x03(\x0b\x32\x17.google.protobuf.Struct\x12\x39\n\x0c\x63urrent_page\x18\x07 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.Page\x12\x39\n\x0c\x63urrent_flow\x18\x1f \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.Flow\x12\x39\n\x06intent\x18\x08 \x01(\x0b\x32%.google.cloud.dialogflow.cx.v3.IntentB\x02\x18\x01\x12\'\n\x1bintent_detection_confidence\x18\t \x01(\x02\x42\x02\x18\x01\x12\x33\n\x05match\x18\x0f \x01(\x0b\x32$.google.cloud.dialogflow.cx.v3.Match\x12\x30\n\x0f\x64iagnostic_info\x18\n \x01(\x0b\x32\x17.google.protobuf.Struct\x12Y\n\x19sentiment_analysis_result\x18\x11 \x01(\x0b\x32\x36.google.cloud.dialogflow.cx.v3.SentimentAnalysisResult\x12J\n\x11\x61\x64vanced_settings\x18\x15 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.AdvancedSettings\x12\x1d\n\x15\x61llow_answer_feedback\x18 \x01(\x08\x12\x65\n\x1d\x64\x61ta_store_connection_signals\x18# \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.DataStoreConnectionSignalsB\x03\xe0\x41\x01\x42\x07\n\x05query\"\x1e\n\tTextInput\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\"G\n\x0bIntentInput\x12\x38\n\x06intent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n dialogflow.googleapis.com/Intent\"a\n\nAudioInput\x12\x44\n\x06\x63onfig\x18\x01 \x01(\x0b\x32/.google.cloud.dialogflow.cx.v3.InputAudioConfigB\x03\xe0\x41\x02\x12\r\n\x05\x61udio\x18\x02 \x01(\x0c\"\x1b\n\nEventInput\x12\r\n\x05\x65vent\x18\x01 \x01(\t\"1\n\tDtmfInput\x12\x0e\n\x06\x64igits\x18\x01 \x01(\t\x12\x14\n\x0c\x66inish_digit\x18\x02 \x01(\t\"\x98\x03\n\x05Match\x12\x35\n\x06intent\x18\x01 \x01(\x0b\x32%.google.cloud.dialogflow.cx.v3.Intent\x12\r\n\x05\x65vent\x18\x06 \x01(\t\x12+\n\nparameters\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x16\n\x0eresolved_input\x18\x03 \x01(\t\x12\x42\n\nmatch_type\x18\x04 \x01(\x0e\x32..google.cloud.dialogflow.cx.v3.Match.MatchType\x12\x12\n\nconfidence\x18\x05 \x01(\x02\"\xab\x01\n\tMatchType\x12\x1a\n\x16MATCH_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06INTENT\x10\x01\x12\x11\n\rDIRECT_INTENT\x10\x02\x12\x15\n\x11PARAMETER_FILLING\x10\x03\x12\x0c\n\x08NO_MATCH\x10\x04\x12\x0c\n\x08NO_INPUT\x10\x05\x12\t\n\x05\x45VENT\x10\x06\x12\x17\n\x13KNOWLEDGE_CONNECTOR\x10\x08\x12\x0c\n\x08PLAYBOOK\x10\t\"\xfe\x01\n\x12MatchIntentRequest\x12:\n\x07session\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Session\x12\x44\n\x0cquery_params\x18\x02 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.QueryParameters\x12\x43\n\x0bquery_input\x18\x03 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.QueryInputB\x03\xe0\x41\x02\x12!\n\x19persist_parameter_changes\x18\x05 \x01(\x08\"\x90\x02\n\x13MatchIntentResponse\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12?\n\x0etrigger_intent\x18\x02 \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/IntentH\x00\x12\x14\n\ntranscript\x18\x03 \x01(\tH\x00\x12\x17\n\rtrigger_event\x18\x06 \x01(\tH\x00\x12\x35\n\x07matches\x18\x04 \x03(\x0b\x32$.google.cloud.dialogflow.cx.v3.Match\x12\x39\n\x0c\x63urrent_page\x18\x05 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.PageB\x07\n\x05query\"\xeb\x01\n\x14\x46ulfillIntentRequest\x12O\n\x14match_intent_request\x18\x01 \x01(\x0b\x32\x31.google.cloud.dialogflow.cx.v3.MatchIntentRequest\x12\x33\n\x05match\x18\x02 \x01(\x0b\x32$.google.cloud.dialogflow.cx.v3.Match\x12M\n\x13output_audio_config\x18\x03 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.OutputAudioConfig\"\xd3\x01\n\x15\x46ulfillIntentResponse\x12\x13\n\x0bresponse_id\x18\x01 \x01(\t\x12@\n\x0cquery_result\x18\x02 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.QueryResult\x12\x14\n\x0coutput_audio\x18\x03 \x01(\x0c\x12M\n\x13output_audio_config\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.OutputAudioConfig\";\n\x17SentimentAnalysisResult\x12\r\n\x05score\x18\x01 \x01(\x02\x12\x11\n\tmagnitude\x18\x02 \x01(\x02*\xbd\x01\n\x18\x44\x65tectIntentResponseView\x12+\n\'DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED\x10\x00\x12$\n DETECT_INTENT_RESPONSE_VIEW_FULL\x10\x01\x12%\n!DETECT_INTENT_RESPONSE_VIEW_BASIC\x10\x02\x12\'\n#DETECT_INTENT_RESPONSE_VIEW_DEFAULT\x10\x03\x32\xfa\r\n\x08Sessions\x12\xa6\x02\n\x0c\x44\x65tectIntent\x12\x32.google.cloud.dialogflow.cx.v3.DetectIntentRequest\x1a\x33.google.cloud.dialogflow.cx.v3.DetectIntentResponse\"\xac\x01\x82\xd3\xe4\x93\x02\xa5\x01\"E/v3/{session=projects/*/locations/*/agents/*/sessions/*}:detectIntent:\x01*ZY\"T/v3/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:detectIntent:\x01*\x12\xd5\x02\n\x1bServerStreamingDetectIntent\x12\x32.google.cloud.dialogflow.cx.v3.DetectIntentRequest\x1a\x33.google.cloud.dialogflow.cx.v3.DetectIntentResponse\"\xca\x01\x82\xd3\xe4\x93\x02\xc3\x01\"T/v3/{session=projects/*/locations/*/agents/*/sessions/*}:serverStreamingDetectIntent:\x01*Zh\"c/v3/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:serverStreamingDetectIntent:\x01*0\x01\x12\x98\x01\n\x15StreamingDetectIntent\x12;.google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest\x1a<.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse\"\x00(\x01\x30\x01\x12\xa1\x02\n\x0bMatchIntent\x12\x31.google.cloud.dialogflow.cx.v3.MatchIntentRequest\x1a\x32.google.cloud.dialogflow.cx.v3.MatchIntentResponse\"\xaa\x01\x82\xd3\xe4\x93\x02\xa3\x01\"D/v3/{session=projects/*/locations/*/agents/*/sessions/*}:matchIntent:\x01*ZX\"S/v3/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:matchIntent:\x01*\x12\xd5\x02\n\rFulfillIntent\x12\x33.google.cloud.dialogflow.cx.v3.FulfillIntentRequest\x1a\x34.google.cloud.dialogflow.cx.v3.FulfillIntentResponse\"\xd8\x01\x82\xd3\xe4\x93\x02\xd1\x01\"[/v3/{match_intent_request.session=projects/*/locations/*/agents/*/sessions/*}:fulfillIntent:\x01*Zo\"j/v3/{match_intent_request.session=projects/*/locations/*/agents/*/environments/*/sessions/*}:fulfillIntent:\x01*\x12\xdb\x01\n\x14SubmitAnswerFeedback\x12:.google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest\x1a-.google.cloud.dialogflow.cx.v3.AnswerFeedback\"X\x82\xd3\xe4\x93\x02R\"M/v3/{session=projects/*/locations/*/agents/*/sessions/*}:submitAnswerFeedback:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xd0\x04\n!com.google.cloud.dialogflow.cx.v3B\x0cSessionProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3\xea\x41\xd4\x01\n!dialogflow.googleapis.com/Session\x12Iprojects/{project}/locations/{location}/agents/{agent}/sessions/{session}\x12\x64projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}\xea\x41\xc5\x01\n(discoveryengine.googleapis.com/DataStore\x12?projects/{project}/locations/{location}/dataStores/{data_store}\x12Xprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.cloud.dialogflow.cx.v3.OutputAudioConfig", "google/cloud/dialogflow/cx/v3/audio_config.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.type.LatLng", "google/type/latlng.proto"], - ["google.cloud.dialogflow.cx.v3.SessionEntityType", "google/cloud/dialogflow/cx/v3/session_entity_type.proto"], - ["google.protobuf.Struct", "google/protobuf/struct.proto"], - ["google.cloud.dialogflow.cx.v3.LlmModelSettings", "google/cloud/dialogflow/cx/v3/generative_settings.proto"], - ["google.cloud.dialogflow.cx.v3.ToolCallResult", "google/cloud/dialogflow/cx/v3/tool_call.proto"], - ["google.cloud.dialogflow.cx.v3.ResponseMessage", "google/cloud/dialogflow/cx/v3/response_message.proto"], - ["google.rpc.Status", "google/rpc/status.proto"], - ["google.cloud.dialogflow.cx.v3.Page", "google/cloud/dialogflow/cx/v3/page.proto"], - ["google.cloud.dialogflow.cx.v3.Flow", "google/cloud/dialogflow/cx/v3/flow.proto"], - ["google.cloud.dialogflow.cx.v3.Intent", "google/cloud/dialogflow/cx/v3/intent.proto"], - ["google.cloud.dialogflow.cx.v3.AdvancedSettings", "google/cloud/dialogflow/cx/v3/advanced_settings.proto"], - ["google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals", "google/cloud/dialogflow/cx/v3/data_store_connection.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - AnswerFeedback = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.AnswerFeedback").msgclass - AnswerFeedback::RatingReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.AnswerFeedback.RatingReason").msgclass - AnswerFeedback::Rating = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.AnswerFeedback.Rating").enummodule - SubmitAnswerFeedbackRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest").msgclass - DetectIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DetectIntentRequest").msgclass - DetectIntentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DetectIntentResponse").msgclass - DetectIntentResponse::ResponseType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType").enummodule - StreamingDetectIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest").msgclass - CloudConversationDebuggingInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CloudConversationDebuggingInfo").msgclass - StreamingDetectIntentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse").msgclass - StreamingRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.StreamingRecognitionResult").msgclass - StreamingRecognitionResult::MessageType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.MessageType").enummodule - QueryParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.QueryParameters").msgclass - SearchConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SearchConfig").msgclass - BoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BoostSpec").msgclass - BoostSpec::ConditionBoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec").msgclass - BoostSpec::ConditionBoostSpec::BoostControlSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec").msgclass - BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint").msgclass - BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType").enummodule - BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType").enummodule - BoostSpecs = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BoostSpecs").msgclass - FilterSpecs = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.FilterSpecs").msgclass - QueryInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.QueryInput").msgclass - QueryResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.QueryResult").msgclass - TextInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TextInput").msgclass - IntentInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.IntentInput").msgclass - AudioInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.AudioInput").msgclass - EventInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.EventInput").msgclass - DtmfInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DtmfInput").msgclass - Match = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Match").msgclass - Match::MatchType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Match.MatchType").enummodule - MatchIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.MatchIntentRequest").msgclass - MatchIntentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.MatchIntentResponse").msgclass - FulfillIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.FulfillIntentRequest").msgclass - FulfillIntentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.FulfillIntentResponse").msgclass - SentimentAnalysisResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SentimentAnalysisResult").msgclass - DetectIntentResponseView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DetectIntentResponseView").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_services_pb.rb deleted file mode 100644 index b2bbaace8542..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_services_pb.rb +++ /dev/null @@ -1,85 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/cx/v3/session.proto for package 'Google.Cloud.Dialogflow.CX.V3' -# 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/cx/v3/session_pb' - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Sessions - # A session represents an interaction with a user. You retrieve user input - # and pass it to the - # [DetectIntent][google.cloud.dialogflow.cx.v3.Sessions.DetectIntent] method to - # determine user intent and respond. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.cx.v3.Sessions' - - # Processes a natural language query and returns structured, actionable data - # as a result. This method is not idempotent, because it may cause session - # entity types to be updated, which in turn might affect results of future - # queries. - # - # Note: Always use agent versions for production traffic. - # See [Versions and - # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). - rpc :DetectIntent, ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest, ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse - # Processes a natural language query and returns structured, actionable data - # as a result through server-side streaming. Server-side streaming allows - # Dialogflow to send [partial - # responses](https://cloud.google.com/dialogflow/cx/docs/concept/fulfillment#partial-response) - # earlier in a single request. - rpc :ServerStreamingDetectIntent, ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest, stream(::Google::Cloud::Dialogflow::CX::V3::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). - # - # Note: Always use agent versions for production traffic. - # See [Versions and - # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). - rpc :StreamingDetectIntent, stream(::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest), stream(::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentResponse) - # Returns preliminary intent match results, doesn't change the session - # status. - rpc :MatchIntent, ::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest, ::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse - # Fulfills a matched intent returned by - # [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent]. Must be - # called after - # [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent], with - # input from - # [MatchIntentResponse][google.cloud.dialogflow.cx.v3.MatchIntentResponse]. - # Otherwise, the behavior is undefined. - rpc :FulfillIntent, ::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest, ::Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse - # Updates the feedback received from the user for a single turn of the bot - # response. - rpc :SubmitAnswerFeedback, ::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest, ::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions.rb deleted file mode 100644 index a4e55165408e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See 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/cx/v3/version" - -require "google/cloud/dialogflow/cx/v3/sessions/credentials" -require "google/cloud/dialogflow/cx/v3/sessions/paths" -require "google/cloud/dialogflow/cx/v3/sessions/client" -require "google/cloud/dialogflow/cx/v3/sessions/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # A session represents an interaction with a user. You retrieve user input - # and pass it to the - # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#detect_intent DetectIntent} method to - # determine user intent and respond. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/cx/v3/sessions" - # client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/cx/v3/sessions/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new - # - module Sessions - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "sessions", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/sessions/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb deleted file mode 100644 index 1c3d967d0d58..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +++ /dev/null @@ -1,1073 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/session_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Sessions - ## - # Client for the Sessions service. - # - # A session represents an interaction with a user. You retrieve user input - # and pass it to the - # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#detect_intent DetectIntent} method to - # determine user intent and respond. - # - 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::CX::V3::Sessions::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Sessions clients - # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] - 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.server_streaming_detect_intent.timeout = 220.0 - - 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::CX::V3::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::CX::V3::Sessions::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::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/cx/v3/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::CX::V3::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 session - # entity types to be updated, which in turn might affect results of future - # queries. - # - # Note: Always use agent versions for production traffic. - # See [Versions and - # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). - # - # @overload detect_intent(request, options = nil) - # Pass arguments to `detect_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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, response_view: 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//locations//agents//sessions/` or - # `projects//locations//agents//environments//sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. - # 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 of the `Session ID` must not exceed 36 characters. - # - # For more information, see the [sessions - # guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). - # - # Note: Always use agent versions for production traffic. - # See [Versions and - # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). - # @param query_params [::Google::Cloud::Dialogflow::CX::V3::QueryParameters, ::Hash] - # The parameters of this query. - # @param query_input [::Google::Cloud::Dialogflow::CX::V3::QueryInput, ::Hash] - # Required. The input specification. - # @param output_audio_config [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig, ::Hash] - # Instructs the speech synthesizer how to generate the output audio. - # @param response_view [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponseView] - # Optional. Specifies which fields in the - # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} to return. If not - # set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new - # - # # Call the detect_intent method. - # result = client.detect_intent request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-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 and returns structured, actionable data - # as a result through server-side streaming. Server-side streaming allows - # Dialogflow to send [partial - # responses](https://cloud.google.com/dialogflow/cx/docs/concept/fulfillment#partial-response) - # earlier in a single request. - # - # @overload server_streaming_detect_intent(request, options = nil) - # Pass arguments to `server_streaming_detect_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 server_streaming_detect_intent(session: nil, query_params: nil, query_input: nil, output_audio_config: nil, response_view: nil) - # Pass arguments to `server_streaming_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//locations//agents//sessions/` or - # `projects//locations//agents//environments//sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. - # 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 of the `Session ID` must not exceed 36 characters. - # - # For more information, see the [sessions - # guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). - # - # Note: Always use agent versions for production traffic. - # See [Versions and - # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). - # @param query_params [::Google::Cloud::Dialogflow::CX::V3::QueryParameters, ::Hash] - # The parameters of this query. - # @param query_input [::Google::Cloud::Dialogflow::CX::V3::QueryInput, ::Hash] - # Required. The input specification. - # @param output_audio_config [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig, ::Hash] - # Instructs the speech synthesizer how to generate the output audio. - # @param response_view [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponseView] - # Optional. Specifies which fields in the - # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} to return. If not - # set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new - # - # # Call the server_streaming_detect_intent method to start streaming. - # output = client.server_streaming_detect_intent request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse - # output.each do |current_response| - # p current_response - # end - # - def server_streaming_detect_intent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::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.server_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::CX::V3::VERSION - metadata[:"x-goog-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.server_streaming_detect_intent.timeout, - metadata: metadata, - retry_policy: @config.rpcs.server_streaming_detect_intent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @sessions_stub.call_rpc :server_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 - - ## - # 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). - # - # Note: Always use agent versions for production traffic. - # See [Versions and - # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). - # - # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest, ::Hash>] - # An enumerable of {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::StreamingDetectIntentResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::StreamingDetectIntentRequest.new - # input << Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new - # input.close - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 - - ## - # Returns preliminary intent match results, doesn't change the session - # status. - # - # @overload match_intent(request, options = nil) - # Pass arguments to `match_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload match_intent(session: nil, query_params: nil, query_input: nil, persist_parameter_changes: nil) - # Pass arguments to `match_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//locations//agents//sessions/` - # or - # `projects//locations//agents//environments//sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. - # 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 of the `Session ID` must not exceed 36 characters. - # - # For more information, see the [sessions - # guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). - # @param query_params [::Google::Cloud::Dialogflow::CX::V3::QueryParameters, ::Hash] - # The parameters of this query. - # @param query_input [::Google::Cloud::Dialogflow::CX::V3::QueryInput, ::Hash] - # Required. The input specification. - # @param persist_parameter_changes [::Boolean] - # Persist session parameter changes from `query_params`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest.new - # - # # Call the match_intent method. - # result = client.match_intent request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse. - # p result - # - def match_intent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.match_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::CX::V3::VERSION - metadata[:"x-goog-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.match_intent.timeout, - metadata: metadata, - retry_policy: @config.rpcs.match_intent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @sessions_stub.call_rpc :match_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 - - ## - # Fulfills a matched intent returned by - # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#match_intent MatchIntent}. Must be - # called after - # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#match_intent MatchIntent}, with - # input from - # {::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse MatchIntentResponse}. - # Otherwise, the behavior is undefined. - # - # @overload fulfill_intent(request, options = nil) - # Pass arguments to `fulfill_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload fulfill_intent(match_intent_request: nil, match: nil, output_audio_config: nil) - # Pass arguments to `fulfill_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 match_intent_request [::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest, ::Hash] - # Must be same as the corresponding MatchIntent request, otherwise the - # behavior is undefined. - # @param match [::Google::Cloud::Dialogflow::CX::V3::Match, ::Hash] - # The matched intent/event to fulfill. - # @param output_audio_config [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig, ::Hash] - # Instructs the speech synthesizer how to generate output audio. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest.new - # - # # Call the fulfill_intent method. - # result = client.fulfill_intent request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse. - # p result - # - def fulfill_intent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.fulfill_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.match_intent_request&.session - header_params["match_intent_request.session"] = request.match_intent_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.fulfill_intent.timeout, - metadata: metadata, - retry_policy: @config.rpcs.fulfill_intent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @sessions_stub.call_rpc :fulfill_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 feedback received from the user for a single turn of the bot - # response. - # - # @overload submit_answer_feedback(request, options = nil) - # Pass arguments to `submit_answer_feedback` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload submit_answer_feedback(session: nil, response_id: nil, answer_feedback: nil, update_mask: nil) - # Pass arguments to `submit_answer_feedback` via keyword arguments. Note that at - # least one keyword argument is 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 the feedback was sent to. - # @param response_id [::String] - # Required. ID of the response to update its feedback. This is the same as - # DetectIntentResponse.response_id. - # @param answer_feedback [::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback, ::Hash] - # Required. Feedback provided for a bot answer. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields to update. 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::CX::V3::AnswerFeedback] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest.new - # - # # Call the submit_answer_feedback method. - # result = client.submit_answer_feedback request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AnswerFeedback. - # p result - # - def submit_answer_feedback request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.submit_answer_feedback.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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.submit_answer_feedback.timeout, - metadata: metadata, - retry_policy: @config.rpcs.submit_answer_feedback.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @sessions_stub.call_rpc :submit_answer_feedback, request, 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::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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. - # * `: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. - # * `: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 `server_streaming_detect_intent` - # @return [::Gapic::Config::Method] - # - attr_reader :server_streaming_detect_intent - ## - # RPC-specific configuration for `streaming_detect_intent` - # @return [::Gapic::Config::Method] - # - attr_reader :streaming_detect_intent - ## - # RPC-specific configuration for `match_intent` - # @return [::Gapic::Config::Method] - # - attr_reader :match_intent - ## - # RPC-specific configuration for `fulfill_intent` - # @return [::Gapic::Config::Method] - # - attr_reader :fulfill_intent - ## - # RPC-specific configuration for `submit_answer_feedback` - # @return [::Gapic::Config::Method] - # - attr_reader :submit_answer_feedback - - # @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 - server_streaming_detect_intent_config = parent_rpcs.server_streaming_detect_intent if parent_rpcs.respond_to? :server_streaming_detect_intent - @server_streaming_detect_intent = ::Gapic::Config::Method.new server_streaming_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 - match_intent_config = parent_rpcs.match_intent if parent_rpcs.respond_to? :match_intent - @match_intent = ::Gapic::Config::Method.new match_intent_config - fulfill_intent_config = parent_rpcs.fulfill_intent if parent_rpcs.respond_to? :fulfill_intent - @fulfill_intent = ::Gapic::Config::Method.new fulfill_intent_config - submit_answer_feedback_config = parent_rpcs.submit_answer_feedback if parent_rpcs.respond_to? :submit_answer_feedback - @submit_answer_feedback = ::Gapic::Config::Method.new submit_answer_feedback_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/credentials.rb deleted file mode 100644 index cafa147c8084..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - 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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb deleted file mode 100644 index 1191647760b7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb +++ /dev/null @@ -1,312 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - module Sessions - # Path helper methods for the Sessions API. - module Paths - ## - # Create a fully-qualified DataStore resource string. - # - # @overload data_store_path(project:, location:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # - # @overload data_store_path(project:, location:, collection:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # - # @return [::String] - def data_store_path **args - resources = { - "data_store:location:project" => (proc do |project:, location:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}" - end), - "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified EntityType resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param entity_type [String] - # - # @return [::String] - def entity_type_path project:, location:, agent:, entity_type: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/entityTypes/#{entity_type}" - end - - ## - # Create a fully-qualified Intent resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/intents/{intent}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param intent [String] - # - # @return [::String] - def intent_path project:, location:, agent:, intent: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/intents/#{intent}" - end - - ## - # Create a fully-qualified Page resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param flow [String] - # @param page [String] - # - # @return [::String] - def page_path project:, location:, agent:, flow:, page: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/pages/#{page}" - end - - ## - # Create a fully-qualified Playbook resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param playbook [String] - # - # @return [::String] - def playbook_path project:, location:, agent:, playbook: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}" - end - - ## - # Create a fully-qualified Session resource string. - # - # @overload session_path(project:, location:, agent:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param session [String] - # - # @overload session_path(project:, location:, agent:, environment:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param environment [String] - # @param session [String] - # - # @return [::String] - def session_path **args - resources = { - "agent:location:project:session" => (proc do |project:, location:, agent:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/sessions/#{session}" - end), - "agent:environment:location:project:session" => (proc do |project:, location:, agent:, environment:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}/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:, location:, agent:, session:, entity_type:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param session [String] - # @param entity_type [String] - # - # @overload session_entity_type_path(project:, location:, agent:, environment:, session:, entity_type:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param environment [String] - # @param session [String] - # @param entity_type [String] - # - # @return [::String] - def session_entity_type_path **args - resources = { - "agent:entity_type:location:project:session" => (proc do |project:, location:, agent:, 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, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/sessions/#{session}/entityTypes/#{entity_type}" - end), - "agent:entity_type:environment:location:project:session" => (proc do |project:, location:, agent:, environment:, 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, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}/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 - - ## - # Create a fully-qualified Tool resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/tools/{tool}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param tool [String] - # - # @return [::String] - def tool_path project:, location:, agent:, tool: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/tools/#{tool}" - end - - ## - # Create a fully-qualified Version resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param flow [String] - # @param version [String] - # - # @return [::String] - def version_path project:, location:, agent:, flow:, version: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/versions/#{version}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest.rb deleted file mode 100644 index fb814c9ad673..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest.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/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/dialogflow/cx/v3/version" -require "google/cloud/dialogflow/cx/v3/bindings_override" - -require "google/cloud/dialogflow/cx/v3/sessions/credentials" -require "google/cloud/dialogflow/cx/v3/sessions/paths" -require "google/cloud/dialogflow/cx/v3/sessions/rest/client" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # A session represents an interaction with a user. You retrieve user input - # and pass it to the - # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#detect_intent DetectIntent} method to - # determine user intent and respond. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/cx/v3/sessions/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new - # - module Sessions - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/sessions/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb deleted file mode 100644 index d8591c59231e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb +++ /dev/null @@ -1,912 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/session_pb" -require "google/cloud/dialogflow/cx/v3/sessions/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Sessions - module Rest - ## - # REST client for the Sessions service. - # - # A session represents an interaction with a user. You retrieve user input - # and pass it to the - # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client#detect_intent DetectIntent} method to - # determine user intent and respond. - # - 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::CX::V3::Sessions::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Sessions clients - # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] - 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.server_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::CX::V3::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::CX::V3::Sessions::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 session - # entity types to be updated, which in turn might affect results of future - # queries. - # - # Note: Always use agent versions for production traffic. - # See [Versions and - # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). - # - # @overload detect_intent(request, options = nil) - # Pass arguments to `detect_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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, response_view: 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//locations//agents//sessions/` or - # `projects//locations//agents//environments//sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. - # 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 of the `Session ID` must not exceed 36 characters. - # - # For more information, see the [sessions - # guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). - # - # Note: Always use agent versions for production traffic. - # See [Versions and - # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). - # @param query_params [::Google::Cloud::Dialogflow::CX::V3::QueryParameters, ::Hash] - # The parameters of this query. - # @param query_input [::Google::Cloud::Dialogflow::CX::V3::QueryInput, ::Hash] - # Required. The input specification. - # @param output_audio_config [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig, ::Hash] - # Instructs the speech synthesizer how to generate the output audio. - # @param response_view [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponseView] - # Optional. Specifies which fields in the - # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} to return. If not - # set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new - # - # # Call the detect_intent method. - # result = client.detect_intent request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - ## - # Processes a natural language query and returns structured, actionable data - # as a result through server-side streaming. Server-side streaming allows - # Dialogflow to send [partial - # responses](https://cloud.google.com/dialogflow/cx/docs/concept/fulfillment#partial-response) - # earlier in a single request. - # - # @overload server_streaming_detect_intent(request, options = nil) - # Pass arguments to `server_streaming_detect_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 server_streaming_detect_intent(session: nil, query_params: nil, query_input: nil, output_audio_config: nil, response_view: nil) - # Pass arguments to `server_streaming_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//locations//agents//sessions/` or - # `projects//locations//agents//environments//sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. - # 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 of the `Session ID` must not exceed 36 characters. - # - # For more information, see the [sessions - # guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). - # - # Note: Always use agent versions for production traffic. - # See [Versions and - # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). - # @param query_params [::Google::Cloud::Dialogflow::CX::V3::QueryParameters, ::Hash] - # The parameters of this query. - # @param query_input [::Google::Cloud::Dialogflow::CX::V3::QueryInput, ::Hash] - # Required. The input specification. - # @param output_audio_config [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig, ::Hash] - # Instructs the speech synthesizer how to generate the output audio. - # @param response_view [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponseView] - # Optional. Specifies which fields in the - # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} to return. If not - # set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. - # @return [::Enumerable<::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new - # - # # Call the server_streaming_detect_intent method to start streaming. - # output = client.server_streaming_detect_intent request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse - # output.each do |current_response| - # p current_response - # end - # - def server_streaming_detect_intent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::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.server_streaming_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.server_streaming_detect_intent.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.server_streaming_detect_intent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - ::Gapic::Rest::ServerStream.new( - ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse, - ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| - @sessions_stub.server_streaming_detect_intent request, options do |chunk| - in_q.deq - out_q.enq chunk - end - end - ) - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns preliminary intent match results, doesn't change the session - # status. - # - # @overload match_intent(request, options = nil) - # Pass arguments to `match_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload match_intent(session: nil, query_params: nil, query_input: nil, persist_parameter_changes: nil) - # Pass arguments to `match_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//locations//agents//sessions/` - # or - # `projects//locations//agents//environments//sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. - # 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 of the `Session ID` must not exceed 36 characters. - # - # For more information, see the [sessions - # guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). - # @param query_params [::Google::Cloud::Dialogflow::CX::V3::QueryParameters, ::Hash] - # The parameters of this query. - # @param query_input [::Google::Cloud::Dialogflow::CX::V3::QueryInput, ::Hash] - # Required. The input specification. - # @param persist_parameter_changes [::Boolean] - # Persist session parameter changes from `query_params`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest.new - # - # # Call the match_intent method. - # result = client.match_intent request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse. - # p result - # - def match_intent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.match_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.match_intent.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.match_intent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @sessions_stub.match_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 - - ## - # Fulfills a matched intent returned by - # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client#match_intent MatchIntent}. Must be - # called after - # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client#match_intent MatchIntent}, with - # input from - # {::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse MatchIntentResponse}. - # Otherwise, the behavior is undefined. - # - # @overload fulfill_intent(request, options = nil) - # Pass arguments to `fulfill_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload fulfill_intent(match_intent_request: nil, match: nil, output_audio_config: nil) - # Pass arguments to `fulfill_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 match_intent_request [::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest, ::Hash] - # Must be same as the corresponding MatchIntent request, otherwise the - # behavior is undefined. - # @param match [::Google::Cloud::Dialogflow::CX::V3::Match, ::Hash] - # The matched intent/event to fulfill. - # @param output_audio_config [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig, ::Hash] - # Instructs the speech synthesizer how to generate output audio. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest.new - # - # # Call the fulfill_intent method. - # result = client.fulfill_intent request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse. - # p result - # - def fulfill_intent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.fulfill_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.fulfill_intent.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.fulfill_intent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @sessions_stub.fulfill_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 feedback received from the user for a single turn of the bot - # response. - # - # @overload submit_answer_feedback(request, options = nil) - # Pass arguments to `submit_answer_feedback` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload submit_answer_feedback(session: nil, response_id: nil, answer_feedback: nil, update_mask: nil) - # Pass arguments to `submit_answer_feedback` via keyword arguments. Note that at - # least one keyword argument is 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 the feedback was sent to. - # @param response_id [::String] - # Required. ID of the response to update its feedback. This is the same as - # DetectIntentResponse.response_id. - # @param answer_feedback [::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback, ::Hash] - # Required. Feedback provided for a bot answer. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields to update. 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::CX::V3::AnswerFeedback] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest.new - # - # # Call the submit_answer_feedback method. - # result = client.submit_answer_feedback request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AnswerFeedback. - # p result - # - def submit_answer_feedback request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.submit_answer_feedback.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.submit_answer_feedback.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.submit_answer_feedback.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @sessions_stub.submit_answer_feedback request, 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::CX::V3::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::CX::V3::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::CX::V3::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. - # * `: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. - # * `: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 `server_streaming_detect_intent` - # @return [::Gapic::Config::Method] - # - attr_reader :server_streaming_detect_intent - ## - # RPC-specific configuration for `match_intent` - # @return [::Gapic::Config::Method] - # - attr_reader :match_intent - ## - # RPC-specific configuration for `fulfill_intent` - # @return [::Gapic::Config::Method] - # - attr_reader :fulfill_intent - ## - # RPC-specific configuration for `submit_answer_feedback` - # @return [::Gapic::Config::Method] - # - attr_reader :submit_answer_feedback - - # @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 - server_streaming_detect_intent_config = parent_rpcs.server_streaming_detect_intent if parent_rpcs.respond_to? :server_streaming_detect_intent - @server_streaming_detect_intent = ::Gapic::Config::Method.new server_streaming_detect_intent_config - match_intent_config = parent_rpcs.match_intent if parent_rpcs.respond_to? :match_intent - @match_intent = ::Gapic::Config::Method.new match_intent_config - fulfill_intent_config = parent_rpcs.fulfill_intent if parent_rpcs.respond_to? :fulfill_intent - @fulfill_intent = ::Gapic::Config::Method.new fulfill_intent_config - submit_answer_feedback_config = parent_rpcs.submit_answer_feedback if parent_rpcs.respond_to? :submit_answer_feedback - @submit_answer_feedback = ::Gapic::Config::Method.new submit_answer_feedback_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb deleted file mode 100644 index 354514d347f0..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb +++ /dev/null @@ -1,419 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/session_pb" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - 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::CX::V3::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::CX::V3::DetectIntentResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::DetectIntentResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the server_streaming_detect_intent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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. - # - # @yieldparam chunk [::String] The chunk of data received during server streaming. - # - # @return [::Gapic::Rest::TransportOperation] - def server_streaming_detect_intent(request_pb, options = nil, &) - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_server_streaming_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: "server_streaming_detect_intent", - options: options, - is_server_streaming: true, - & - ) - ::Gapic::Rest::TransportOperation.new response - end - - ## - # Baseline implementation for the match_intent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::MatchIntentResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse] - # A result object deserialized from the server's reply - def match_intent request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_match_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: "match_intent", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the fulfill_intent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::FulfillIntentResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse] - # A result object deserialized from the server's reply - def fulfill_intent request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_fulfill_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: "fulfill_intent", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the submit_answer_feedback REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::AnswerFeedback] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback] - # A result object deserialized from the server's reply - def submit_answer_feedback request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_submit_answer_feedback_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "submit_answer_feedback", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback.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::CX::V3::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: "/v3/{session}:detectIntent", - body: "*", - matches: [ - ["session", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v3/{session}:detectIntent", - body: "*", - matches: [ - ["session", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the server_streaming_detect_intent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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_server_streaming_detect_intent_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{session}:serverStreamingDetectIntent", - body: "*", - matches: [ - ["session", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v3/{session}:serverStreamingDetectIntent", - body: "*", - matches: [ - ["session", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the match_intent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_match_intent_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{session}:matchIntent", - body: "*", - matches: [ - ["session", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v3/{session}:matchIntent", - body: "*", - matches: [ - ["session", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the fulfill_intent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_fulfill_intent_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{match_intent_request.session}:fulfillIntent", - body: "*", - matches: [ - ["match_intent_request.session", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v3/{match_intent_request.session}:fulfillIntent", - body: "*", - matches: [ - ["match_intent_request.session", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the submit_answer_feedback REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_submit_answer_feedback_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{session}:submitAnswerFeedback", - body: "*", - matches: [ - ["session", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_case_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_case_pb.rb deleted file mode 100644 index 3f95787e1a0f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_case_pb.rb +++ /dev/null @@ -1,115 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/test_case.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/cx/v3/flow_pb' -require 'google/cloud/dialogflow/cx/v3/intent_pb' -require 'google/cloud/dialogflow/cx/v3/page_pb' -require 'google/cloud/dialogflow/cx/v3/response_message_pb' -require 'google/cloud/dialogflow/cx/v3/session_pb' -require 'google/cloud/dialogflow/cx/v3/transition_route_group_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_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/cx/v3/test_case.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/flow.proto\x1a*google/cloud/dialogflow/cx/v3/intent.proto\x1a(google/cloud/dialogflow/cx/v3/page.proto\x1a\x34google/cloud/dialogflow/cx/v3/response_message.proto\x1a+google/cloud/dialogflow/cx/v3/session.proto\x1a:google/cloud/dialogflow/cx/v3/transition_route_group.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xdf\x03\n\x08TestCase\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04tags\x18\x02 \x03(\t\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05notes\x18\x04 \x01(\t\x12>\n\x0btest_config\x18\r \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.TestConfig\x12U\n\x1ctest_case_conversation_turns\x18\x05 \x03(\x0b\x32/.google.cloud.dialogflow.cx.v3.ConversationTurn\x12\x36\n\rcreation_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x10last_test_result\x18\x0c \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.TestCaseResult:u\xea\x41r\n\"dialogflow.googleapis.com/TestCase\x12Lprojects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}\"\xab\x03\n\x0eTestCaseResult\x12\x0c\n\x04name\x18\x01 \x01(\t\x12?\n\x0b\x65nvironment\x18\x02 \x01(\tB*\xfa\x41\'\n%dialogflow.googleapis.com/Environment\x12K\n\x12\x63onversation_turns\x18\x03 \x03(\x0b\x32/.google.cloud.dialogflow.cx.v3.ConversationTurn\x12>\n\x0btest_result\x18\x04 \x01(\x0e\x32).google.cloud.dialogflow.cx.v3.TestResult\x12-\n\ttest_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp:\x8d\x01\xea\x41\x89\x01\n(dialogflow.googleapis.com/TestCaseResult\x12]projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}\"\x8f\x01\n\nTestConfig\x12\x1b\n\x13tracking_parameters\x18\x01 \x03(\t\x12\x31\n\x04\x66low\x18\x02 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Flow\x12\x31\n\x04page\x18\x03 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Page\"\xbf\x06\n\x10\x43onversationTurn\x12M\n\nuser_input\x18\x01 \x01(\x0b\x32\x39.google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput\x12`\n\x14virtual_agent_output\x18\x02 \x01(\x0b\x32\x42.google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput\x1a\xba\x01\n\tUserInput\x12\x38\n\x05input\x18\x05 \x01(\x0b\x32).google.cloud.dialogflow.cx.v3.QueryInput\x12\x34\n\x13injected_parameters\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x1a\n\x12is_webhook_enabled\x18\x03 \x01(\x08\x12!\n\x19\x65nable_sentiment_analysis\x18\x07 \x01(\x08\x1a\xbc\x03\n\x12VirtualAgentOutput\x12\x33\n\x12session_parameters\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12J\n\x0b\x64ifferences\x18\x05 \x03(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.TestRunDifferenceB\x03\xe0\x41\x03\x12\x38\n\x0f\x64iagnostic_info\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructB\x06\xe0\x41\x02\xe0\x41\x04\x12?\n\x10triggered_intent\x18\x07 \x01(\x0b\x32%.google.cloud.dialogflow.cx.v3.Intent\x12\x39\n\x0c\x63urrent_page\x18\x08 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.Page\x12K\n\x0etext_responses\x18\t \x03(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.ResponseMessage.Text\x12\"\n\x06status\x18\n \x01(\x0b\x32\x12.google.rpc.Status\"\xd7\x01\n\x11TestRunDifference\x12G\n\x04type\x18\x01 \x01(\x0e\x32\x39.google.cloud.dialogflow.cx.v3.TestRunDifference.DiffType\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\"d\n\x08\x44iffType\x12\x19\n\x15\x44IFF_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06INTENT\x10\x01\x12\x08\n\x04PAGE\x10\x02\x12\x0e\n\nPARAMETERS\x10\x03\x12\r\n\tUTTERANCE\x10\x04\x12\x08\n\x04\x46LOW\x10\x05\"\xf3\x04\n\x12TransitionCoverage\x12Q\n\x0btransitions\x18\x01 \x03(\x0b\x32<.google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition\x12\x16\n\x0e\x63overage_score\x18\x02 \x01(\x02\x1a\x82\x01\n\x0eTransitionNode\x12\x33\n\x04page\x18\x01 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.PageH\x00\x12\x33\n\x04\x66low\x18\x02 \x01(\x0b\x32#.google.cloud.dialogflow.cx.v3.FlowH\x00\x42\x06\n\x04kind\x1a\xec\x02\n\nTransition\x12P\n\x06source\x18\x01 \x01(\x0b\x32@.google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode\x12\r\n\x05index\x18\x04 \x01(\x05\x12P\n\x06target\x18\x02 \x01(\x0b\x32@.google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode\x12\x0f\n\x07\x63overed\x18\x03 \x01(\x08\x12J\n\x10transition_route\x18\x05 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.TransitionRouteH\x00\x12\x44\n\revent_handler\x18\x06 \x01(\x0b\x32+.google.cloud.dialogflow.cx.v3.EventHandlerH\x00\x42\x08\n\x06\x64\x65tail\"\xcd\x03\n\x1cTransitionRouteGroupCoverage\x12W\n\tcoverages\x18\x01 \x03(\x0b\x32\x44.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage\x12\x16\n\x0e\x63overage_score\x18\x02 \x01(\x02\x1a\xbb\x02\n\x08\x43overage\x12H\n\x0broute_group\x18\x01 \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.TransitionRouteGroup\x12\x64\n\x0btransitions\x18\x02 \x03(\x0b\x32O.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition\x12\x16\n\x0e\x63overage_score\x18\x03 \x01(\x02\x1ag\n\nTransition\x12H\n\x10transition_route\x18\x01 \x01(\x0b\x32..google.cloud.dialogflow.cx.v3.TransitionRoute\x12\x0f\n\x07\x63overed\x18\x02 \x01(\x08\"\xc1\x01\n\x0eIntentCoverage\x12\x45\n\x07intents\x18\x01 \x03(\x0b\x32\x34.google.cloud.dialogflow.cx.v3.IntentCoverage.Intent\x12\x16\n\x0e\x63overage_score\x18\x02 \x01(\x02\x1aP\n\x06Intent\x12\x35\n\x06intent\x18\x01 \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/Intent\x12\x0f\n\x07\x63overed\x18\x02 \x01(\x08\"\x97\x02\n\x18\x43\x61lculateCoverageRequest\x12\x36\n\x05\x61gent\x18\x03 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x12W\n\x04type\x18\x02 \x01(\x0e\x32\x44.google.cloud.dialogflow.cx.v3.CalculateCoverageRequest.CoverageTypeB\x03\xe0\x41\x02\"j\n\x0c\x43overageType\x12\x1d\n\x19\x43OVERAGE_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06INTENT\x10\x01\x12\x13\n\x0fPAGE_TRANSITION\x10\x02\x12\x1a\n\x16TRANSITION_ROUTE_GROUP\x10\x03\"\xda\x02\n\x19\x43\x61lculateCoverageResponse\x12\x33\n\x05\x61gent\x18\x05 \x01(\tB$\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x12H\n\x0fintent_coverage\x18\x02 \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.IntentCoverageH\x00\x12P\n\x13transition_coverage\x18\x04 \x01(\x0b\x32\x31.google.cloud.dialogflow.cx.v3.TransitionCoverageH\x00\x12[\n\x14route_group_coverage\x18\x06 \x01(\x0b\x32;.google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverageH\x00\x42\x0f\n\rcoverage_type\"\x8e\x02\n\x14ListTestCasesRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/TestCase\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12N\n\x04view\x18\x04 \x01(\x0e\x32@.google.cloud.dialogflow.cx.v3.ListTestCasesRequest.TestCaseView\"C\n\x0cTestCaseView\x12\x1e\n\x1aTEST_CASE_VIEW_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x08\n\x04\x46ULL\x10\x02\"m\n\x15ListTestCasesResponse\x12;\n\ntest_cases\x18\x01 \x03(\x0b\x32\'.google.cloud.dialogflow.cx.v3.TestCase\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x94\x01\n\x1b\x42\x61tchDeleteTestCasesRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/TestCase\x12\x39\n\x05names\x18\x03 \x03(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/TestCase\"\x94\x01\n\x15\x43reateTestCaseRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/TestCase\x12?\n\ttest_case\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.cx.v3.TestCaseB\x03\xe0\x41\x02\"\x8e\x01\n\x15UpdateTestCaseRequest\x12?\n\ttest_case\x18\x01 \x01(\x0b\x32\'.google.cloud.dialogflow.cx.v3.TestCaseB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"N\n\x12GetTestCaseRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/TestCase\"\x92\x01\n\x12RunTestCaseRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/TestCase\x12\x42\n\x0b\x65nvironment\x18\x02 \x01(\tB-\xe0\x41\x01\xfa\x41\'\n%dialogflow.googleapis.com/Environment\"T\n\x13RunTestCaseResponse\x12=\n\x06result\x18\x02 \x01(\x0b\x32-.google.cloud.dialogflow.cx.v3.TestCaseResult\"\x15\n\x13RunTestCaseMetadata\"\xda\x01\n\x18\x42\x61tchRunTestCasesRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/TestCase\x12\x42\n\x0b\x65nvironment\x18\x02 \x01(\tB-\xe0\x41\x01\xfa\x41\'\n%dialogflow.googleapis.com/Environment\x12>\n\ntest_cases\x18\x03 \x03(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/TestCase\"[\n\x19\x42\x61tchRunTestCasesResponse\x12>\n\x07results\x18\x01 \x03(\x0b\x32-.google.cloud.dialogflow.cx.v3.TestCaseResult\"U\n\x19\x42\x61tchRunTestCasesMetadata\x12\x38\n\x06\x65rrors\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.cx.v3.TestError\"\x9a\x01\n\tTestError\x12:\n\ttest_case\x18\x01 \x01(\tB\'\xfa\x41$\n\"dialogflow.googleapis.com/TestCase\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12-\n\ttest_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x84\x01\n\x16ImportTestCasesRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/TestCase\x12\x11\n\x07gcs_uri\x18\x02 \x01(\tH\x00\x12\x11\n\x07\x63ontent\x18\x03 \x01(\x0cH\x00\x42\x08\n\x06source\"Q\n\x17ImportTestCasesResponse\x12\x36\n\x05names\x18\x01 \x03(\tB\'\xfa\x41$\n\"dialogflow.googleapis.com/TestCase\"W\n\x17ImportTestCasesMetadata\x12<\n\x06\x65rrors\x18\x01 \x03(\x0b\x32,.google.cloud.dialogflow.cx.v3.TestCaseError\"o\n\rTestCaseError\x12:\n\ttest_case\x18\x01 \x01(\x0b\x32\'.google.cloud.dialogflow.cx.v3.TestCase\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"\x9c\x02\n\x16\x45xportTestCasesRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/TestCase\x12\x11\n\x07gcs_uri\x18\x02 \x01(\tH\x00\x12U\n\x0b\x64\x61ta_format\x18\x03 \x01(\x0e\x32@.google.cloud.dialogflow.cx.v3.ExportTestCasesRequest.DataFormat\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\"=\n\nDataFormat\x12\x1b\n\x17\x44\x41TA_FORMAT_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42LOB\x10\x01\x12\x08\n\x04JSON\x10\x02\x42\r\n\x0b\x64\x65stination\"N\n\x17\x45xportTestCasesResponse\x12\x11\n\x07gcs_uri\x18\x01 \x01(\tH\x00\x12\x11\n\x07\x63ontent\x18\x02 \x01(\x0cH\x00\x42\r\n\x0b\x64\x65stination\"\x19\n\x17\x45xportTestCasesMetadata\"\x95\x01\n\x1aListTestCaseResultsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(dialogflow.googleapis.com/TestCaseResult\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\"\x80\x01\n\x1bListTestCaseResultsResponse\x12H\n\x11test_case_results\x18\x01 \x03(\x0b\x32-.google.cloud.dialogflow.cx.v3.TestCaseResult\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"Z\n\x18GetTestCaseResultRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(dialogflow.googleapis.com/TestCaseResult*A\n\nTestResult\x12\x1b\n\x17TEST_RESULT_UNSPECIFIED\x10\x00\x12\n\n\x06PASSED\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x32\x99\x15\n\tTestCases\x12\xc3\x01\n\rListTestCases\x12\x33.google.cloud.dialogflow.cx.v3.ListTestCasesRequest\x1a\x34.google.cloud.dialogflow.cx.v3.ListTestCasesResponse\"G\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x38\x12\x36/v3/{parent=projects/*/locations/*/agents/*}/testCases\x12\xc2\x01\n\x14\x42\x61tchDeleteTestCases\x12:.google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest\x1a\x16.google.protobuf.Empty\"V\xda\x41\x06parent\x82\xd3\xe4\x93\x02G\"B/v3/{parent=projects/*/locations/*/agents/*}/testCases:batchDelete:\x01*\x12\xb0\x01\n\x0bGetTestCase\x12\x31.google.cloud.dialogflow.cx.v3.GetTestCaseRequest\x1a\'.google.cloud.dialogflow.cx.v3.TestCase\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v3/{name=projects/*/locations/*/agents/*/testCases/*}\x12\xcd\x01\n\x0e\x43reateTestCase\x12\x34.google.cloud.dialogflow.cx.v3.CreateTestCaseRequest\x1a\'.google.cloud.dialogflow.cx.v3.TestCase\"\\\xda\x41\x10parent,test_case\x82\xd3\xe4\x93\x02\x43\"6/v3/{parent=projects/*/locations/*/agents/*}/testCases:\ttest_case\x12\xdc\x01\n\x0eUpdateTestCase\x12\x34.google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest\x1a\'.google.cloud.dialogflow.cx.v3.TestCase\"k\xda\x41\x15test_case,update_mask\x82\xd3\xe4\x93\x02M2@/v3/{test_case.name=projects/*/locations/*/agents/*/testCases/*}:\ttest_case\x12\xd3\x01\n\x0bRunTestCase\x12\x31.google.cloud.dialogflow.cx.v3.RunTestCaseRequest\x1a\x1d.google.longrunning.Operation\"r\xca\x41*\n\x13RunTestCaseResponse\x12\x13RunTestCaseMetadata\x82\xd3\xe4\x93\x02?\":/v3/{name=projects/*/locations/*/agents/*/testCases/*}:run:\x01*\x12\xf1\x01\n\x11\x42\x61tchRunTestCases\x12\x37.google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest\x1a\x1d.google.longrunning.Operation\"\x83\x01\xca\x41\x36\n\x19\x42\x61tchRunTestCasesResponse\x12\x19\x42\x61tchRunTestCasesMetadata\x82\xd3\xe4\x93\x02\x44\"?/v3/{parent=projects/*/locations/*/agents/*}/testCases:batchRun:\x01*\x12\xd7\x01\n\x11\x43\x61lculateCoverage\x12\x37.google.cloud.dialogflow.cx.v3.CalculateCoverageRequest\x1a\x38.google.cloud.dialogflow.cx.v3.CalculateCoverageResponse\"O\x82\xd3\xe4\x93\x02I\x12G/v3/{agent=projects/*/locations/*/agents/*}/testCases:calculateCoverage\x12\xe6\x01\n\x0fImportTestCases\x12\x35.google.cloud.dialogflow.cx.v3.ImportTestCasesRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41\x32\n\x17ImportTestCasesResponse\x12\x17ImportTestCasesMetadata\x82\xd3\xe4\x93\x02\x42\"=/v3/{parent=projects/*/locations/*/agents/*}/testCases:import:\x01*\x12\xe6\x01\n\x0f\x45xportTestCases\x12\x35.google.cloud.dialogflow.cx.v3.ExportTestCasesRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41\x32\n\x17\x45xportTestCasesResponse\x12\x17\x45xportTestCasesMetadata\x82\xd3\xe4\x93\x02\x42\"=/v3/{parent=projects/*/locations/*/agents/*}/testCases:export:\x01*\x12\xdf\x01\n\x13ListTestCaseResults\x12\x39.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest\x1a:.google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse\"Q\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x42\x12@/v3/{parent=projects/*/locations/*/agents/*/testCases/*}/results\x12\xcc\x01\n\x11GetTestCaseResult\x12\x37.google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest\x1a-.google.cloud.dialogflow.cx.v3.TestCaseResult\"O\xda\x41\x04name\x82\xd3\xe4\x93\x02\x42\x12@/v3/{name=projects/*/locations/*/agents/*/testCases/*/results/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xb0\x01\n!com.google.cloud.dialogflow.cx.v3B\rTestCaseProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.dialogflow.cx.v3.QueryInput", "google/cloud/dialogflow/cx/v3/session.proto"], - ["google.protobuf.Struct", "google/protobuf/struct.proto"], - ["google.cloud.dialogflow.cx.v3.Intent", "google/cloud/dialogflow/cx/v3/intent.proto"], - ["google.cloud.dialogflow.cx.v3.Page", "google/cloud/dialogflow/cx/v3/page.proto"], - ["google.cloud.dialogflow.cx.v3.ResponseMessage.Text", "google/cloud/dialogflow/cx/v3/response_message.proto"], - ["google.rpc.Status", "google/rpc/status.proto"], - ["google.cloud.dialogflow.cx.v3.Flow", "google/cloud/dialogflow/cx/v3/flow.proto"], - ["google.cloud.dialogflow.cx.v3.TransitionRouteGroup", "google/cloud/dialogflow/cx/v3/transition_route_group.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - TestCase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TestCase").msgclass - TestCaseResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TestCaseResult").msgclass - TestConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TestConfig").msgclass - ConversationTurn = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ConversationTurn").msgclass - ConversationTurn::UserInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ConversationTurn.UserInput").msgclass - ConversationTurn::VirtualAgentOutput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ConversationTurn.VirtualAgentOutput").msgclass - TestRunDifference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TestRunDifference").msgclass - TestRunDifference::DiffType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TestRunDifference.DiffType").enummodule - TransitionCoverage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TransitionCoverage").msgclass - TransitionCoverage::TransitionNode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TransitionCoverage.TransitionNode").msgclass - TransitionCoverage::Transition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TransitionCoverage.Transition").msgclass - TransitionRouteGroupCoverage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage").msgclass - TransitionRouteGroupCoverage::Coverage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage").msgclass - TransitionRouteGroupCoverage::Coverage::Transition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TransitionRouteGroupCoverage.Coverage.Transition").msgclass - IntentCoverage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.IntentCoverage").msgclass - IntentCoverage::Intent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.IntentCoverage.Intent").msgclass - CalculateCoverageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CalculateCoverageRequest").msgclass - CalculateCoverageRequest::CoverageType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CalculateCoverageRequest.CoverageType").enummodule - CalculateCoverageResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CalculateCoverageResponse").msgclass - ListTestCasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListTestCasesRequest").msgclass - ListTestCasesRequest::TestCaseView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListTestCasesRequest.TestCaseView").enummodule - ListTestCasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListTestCasesResponse").msgclass - BatchDeleteTestCasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest").msgclass - CreateTestCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateTestCaseRequest").msgclass - UpdateTestCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest").msgclass - GetTestCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetTestCaseRequest").msgclass - RunTestCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RunTestCaseRequest").msgclass - RunTestCaseResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RunTestCaseResponse").msgclass - RunTestCaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.RunTestCaseMetadata").msgclass - BatchRunTestCasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest").msgclass - BatchRunTestCasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse").msgclass - BatchRunTestCasesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata").msgclass - TestError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TestError").msgclass - ImportTestCasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportTestCasesRequest").msgclass - ImportTestCasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportTestCasesResponse").msgclass - ImportTestCasesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata").msgclass - TestCaseError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TestCaseError").msgclass - ExportTestCasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportTestCasesRequest").msgclass - ExportTestCasesRequest::DataFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportTestCasesRequest.DataFormat").enummodule - ExportTestCasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportTestCasesResponse").msgclass - ExportTestCasesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata").msgclass - ListTestCaseResultsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest").msgclass - ListTestCaseResultsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListTestCaseResultsResponse").msgclass - GetTestCaseResultRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest").msgclass - TestResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TestResult").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_case_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_case_services_pb.rb deleted file mode 100644 index 0a9f5f680348..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_case_services_pb.rb +++ /dev/null @@ -1,110 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/cx/v3/test_case.proto for package 'Google.Cloud.Dialogflow.CX.V3' -# 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/cx/v3/test_case_pb' - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module TestCases - # Service for managing [Test Cases][google.cloud.dialogflow.cx.v3.TestCase] and - # [Test Case Results][google.cloud.dialogflow.cx.v3.TestCaseResult]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.cx.v3.TestCases' - - # Fetches a list of test cases for a given agent. - rpc :ListTestCases, ::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest, ::Google::Cloud::Dialogflow::CX::V3::ListTestCasesResponse - # Batch deletes test cases. - rpc :BatchDeleteTestCases, ::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest, ::Google::Protobuf::Empty - # Gets a test case. - rpc :GetTestCase, ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest, ::Google::Cloud::Dialogflow::CX::V3::TestCase - # Creates a test case for the given agent. - rpc :CreateTestCase, ::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest, ::Google::Cloud::Dialogflow::CX::V3::TestCase - # Updates the specified test case. - rpc :UpdateTestCase, ::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest, ::Google::Cloud::Dialogflow::CX::V3::TestCase - # Kicks off a test case run. - # - # 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`: - # [RunTestCaseMetadata][google.cloud.dialogflow.cx.v3.RunTestCaseMetadata] - # - `response`: - # [RunTestCaseResponse][google.cloud.dialogflow.cx.v3.RunTestCaseResponse] - rpc :RunTestCase, ::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest, ::Google::Longrunning::Operation - # Kicks off a batch run of test cases. - # - # 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`: - # [BatchRunTestCasesMetadata][google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata] - # - `response`: - # [BatchRunTestCasesResponse][google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse] - rpc :BatchRunTestCases, ::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest, ::Google::Longrunning::Operation - # Calculates the test coverage for an agent. - rpc :CalculateCoverage, ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest, ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse - # Imports the test cases from a Cloud Storage bucket or a local file. It - # always creates new test cases and won't overwrite any existing ones. The - # provided ID in the imported test case is neglected. - # - # 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`: - # [ImportTestCasesMetadata][google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata] - # - `response`: - # [ImportTestCasesResponse][google.cloud.dialogflow.cx.v3.ImportTestCasesResponse] - rpc :ImportTestCases, ::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest, ::Google::Longrunning::Operation - # Exports the test cases under the agent to a Cloud Storage bucket or a local - # file. Filter can be applied to export a subset of test cases. - # - # 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`: - # [ExportTestCasesMetadata][google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata] - # - `response`: - # [ExportTestCasesResponse][google.cloud.dialogflow.cx.v3.ExportTestCasesResponse] - rpc :ExportTestCases, ::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest, ::Google::Longrunning::Operation - # Fetches the list of run results for the given test case. A maximum of 100 - # results are kept for each test case. - rpc :ListTestCaseResults, ::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsResponse - # Gets a test case result. - rpc :GetTestCaseResult, ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest, ::Google::Cloud::Dialogflow::CX::V3::TestCaseResult - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases.rb deleted file mode 100644 index 378ea6331d9a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases.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/cx/v3/version" - -require "google/cloud/dialogflow/cx/v3/test_cases/credentials" -require "google/cloud/dialogflow/cx/v3/test_cases/paths" -require "google/cloud/dialogflow/cx/v3/test_cases/operations" -require "google/cloud/dialogflow/cx/v3/test_cases/client" -require "google/cloud/dialogflow/cx/v3/test_cases/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::TestCase Test Cases} and - # {::Google::Cloud::Dialogflow::CX::V3::TestCaseResult Test Case Results}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/cx/v3/test_cases" - # client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/cx/v3/test_cases/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new - # - module TestCases - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "test_cases", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/test_cases/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb deleted file mode 100644 index a43f945cb382..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb +++ /dev/null @@ -1,1729 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/test_case_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module TestCases - ## - # Client for the TestCases service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::TestCase Test Cases} and - # {::Google::Cloud::Dialogflow::CX::V3::TestCaseResult Test Case Results}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :test_cases_stub - - ## - # Configure the TestCases Client class. - # - # See {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TestCases clients - # ::Google::Cloud::Dialogflow::CX::V3::TestCases::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", "CX", "V3"] - 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 TestCases 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::CX::V3::TestCases::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 - @test_cases_stub.universe_domain - end - - ## - # Create a new TestCases client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TestCases 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/cx/v3/test_case_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 - - @test_cases_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::CX::V3::TestCases::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 - ) - - @test_cases_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 = @test_cases_stub.endpoint - config.universe_domain = @test_cases_stub.universe_domain - config.logger = @test_cases_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TestCases::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 - @test_cases_stub.logger - end - - # Service calls - - ## - # Fetches a list of test cases for a given agent. - # - # @overload list_test_cases(request, options = nil) - # Pass arguments to `list_test_cases` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_test_cases(parent: nil, page_size: nil, page_token: nil, view: nil) - # Pass arguments to `list_test_cases` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 pages for. - # Format: `projects//locations//agents/`. - # @param page_size [::Integer] - # The maximum number of items to return in a single page. By default 20. - # Note that when TestCaseView = FULL, the maximum page size allowed is 20. - # When TestCaseView = BASIC, the maximum page size allowed is 500. - # @param page_token [::String] - # The next_page_token value returned from a previous list request. - # @param view [::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest::TestCaseView] - # Specifies whether response should include all fields or just the metadata. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCase>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCase>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest.new - # - # # Call the list_test_cases method. - # result = client.list_test_cases request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::TestCase. - # p item - # end - # - def list_test_cases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest - - # Converts hash and nil to 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_test_cases.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_test_cases.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_test_cases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.call_rpc :list_test_cases, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @test_cases_stub, :list_test_cases, 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 - - ## - # Batch deletes test cases. - # - # @overload batch_delete_test_cases(request, options = nil) - # Pass arguments to `batch_delete_test_cases` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_test_cases(parent: nil, names: nil) - # Pass arguments to `batch_delete_test_cases` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 delete test cases from. - # Format: `projects//locations//agents/`. - # @param names [::Array<::String>] - # Required. Format of test case names: - # `projects//locations//agents//testCases/`. - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest.new - # - # # Call the batch_delete_test_cases method. - # result = client.batch_delete_test_cases request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def batch_delete_test_cases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest - - # Converts hash and nil to 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_test_cases.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_test_cases.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_delete_test_cases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.call_rpc :batch_delete_test_cases, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a test case. - # - # @overload get_test_case(request, options = nil) - # Pass arguments to `get_test_case` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_test_case(name: nil) - # Pass arguments to `get_test_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 testcase. - # Format: - # `projects//locations//agents//testCases/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::TestCase] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest.new - # - # # Call the get_test_case method. - # result = client.get_test_case request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. - # p result - # - def get_test_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest - - # Converts hash and nil to 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_test_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_test_case.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_test_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.call_rpc :get_test_case, request, 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 test case for the given agent. - # - # @overload create_test_case(request, options = nil) - # Pass arguments to `create_test_case` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_test_case(parent: nil, test_case: nil) - # Pass arguments to `create_test_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 the test case for. - # Format: `projects//locations//agents/`. - # @param test_case [::Google::Cloud::Dialogflow::CX::V3::TestCase, ::Hash] - # Required. The test case to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::TestCase] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest.new - # - # # Call the create_test_case method. - # result = client.create_test_case request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. - # p result - # - def create_test_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest - - # Converts hash and nil to 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_test_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_test_case.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_test_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.call_rpc :create_test_case, request, 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 test case. - # - # @overload update_test_case(request, options = nil) - # Pass arguments to `update_test_case` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_test_case(test_case: nil, update_mask: nil) - # Pass arguments to `update_test_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param test_case [::Google::Cloud::Dialogflow::CX::V3::TestCase, ::Hash] - # Required. The test case to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The mask to specify which fields should be updated. The - # {::Google::Cloud::Dialogflow::CX::V3::TestCase#creation_time `creationTime`} and - # {::Google::Cloud::Dialogflow::CX::V3::TestCase#last_test_result `lastTestResult`} - # cannot be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::TestCase] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest.new - # - # # Call the update_test_case method. - # result = client.update_test_case request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. - # p result - # - def update_test_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest - - # Converts hash and nil to 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_test_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.test_case&.name - header_params["test_case.name"] = request.test_case.name - end - - request_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_test_case.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_test_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.call_rpc :update_test_case, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Kicks off a test case run. - # - # 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::CX::V3::RunTestCaseMetadata RunTestCaseMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::RunTestCaseResponse RunTestCaseResponse} - # - # @overload run_test_case(request, options = nil) - # Pass arguments to `run_test_case` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload run_test_case(name: nil, environment: nil) - # Pass arguments to `run_test_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Format of test case name to run: - # `projects//locations//agents//testCases/`. - # @param environment [::String] - # Optional. Environment name. If not set, draft environment is assumed. - # Format: - # `projects//locations//agents//environments/`. - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest.new - # - # # Call the run_test_case method. - # result = client.run_test_case request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def run_test_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.run_test_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.run_test_case.timeout, - metadata: metadata, - retry_policy: @config.rpcs.run_test_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.call_rpc :run_test_case, 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 - - ## - # Kicks off a batch run of test cases. - # - # 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::CX::V3::BatchRunTestCasesMetadata BatchRunTestCasesMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesResponse BatchRunTestCasesResponse} - # - # @overload batch_run_test_cases(request, options = nil) - # Pass arguments to `batch_run_test_cases` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_run_test_cases(parent: nil, environment: nil, test_cases: nil) - # Pass arguments to `batch_run_test_cases` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Agent name. Format: - # `projects//locations//agents/`. - # @param environment [::String] - # Optional. If not set, draft environment is assumed. Format: - # `projects//locations//agents//environments/`. - # @param test_cases [::Array<::String>] - # Required. Format: - # `projects//locations//agents//testCases/`. - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest.new - # - # # Call the batch_run_test_cases method. - # result = client.batch_run_test_cases request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_run_test_cases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest - - # Converts hash and nil to 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_run_test_cases.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_run_test_cases.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_run_test_cases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.call_rpc :batch_run_test_cases, 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 - - ## - # Calculates the test coverage for an agent. - # - # @overload calculate_coverage(request, options = nil) - # Pass arguments to `calculate_coverage` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload calculate_coverage(agent: nil, type: nil) - # Pass arguments to `calculate_coverage` via keyword arguments. Note that at - # least one keyword argument is 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 [::String] - # Required. The agent to calculate coverage for. - # Format: `projects//locations//agents/`. - # @param type [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest::CoverageType] - # Required. The type of coverage requested. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest.new - # - # # Call the calculate_coverage method. - # result = client.calculate_coverage request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse. - # p result - # - def calculate_coverage request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.calculate_coverage.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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 - header_params["agent"] = request.agent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.calculate_coverage.timeout, - metadata: metadata, - retry_policy: @config.rpcs.calculate_coverage.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.call_rpc :calculate_coverage, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Imports the test cases from a Cloud Storage bucket or a local file. It - # always creates new test cases and won't overwrite any existing ones. The - # provided ID in the imported test case is neglected. - # - # 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::CX::V3::ImportTestCasesMetadata ImportTestCasesMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesResponse ImportTestCasesResponse} - # - # @overload import_test_cases(request, options = nil) - # Pass arguments to `import_test_cases` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_test_cases(parent: nil, gcs_uri: nil, content: nil) - # Pass arguments to `import_test_cases` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 import test cases to. - # Format: `projects//locations//agents/`. - # @param gcs_uri [::String] - # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI - # to import test cases from. The format of this URI must be - # `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: `gcs_uri`, `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 content [::String] - # Uncompressed raw byte content for test cases. - # - # Note: The following parameters are mutually exclusive: `content`, `gcs_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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest.new - # - # # Call the import_test_cases method. - # result = client.import_test_cases request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_test_cases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest - - # Converts hash and nil to 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_test_cases.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_test_cases.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_test_cases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.call_rpc :import_test_cases, 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 test cases under the agent to a Cloud Storage bucket or a local - # file. Filter can be applied to export a subset of test cases. - # - # 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::CX::V3::ExportTestCasesMetadata ExportTestCasesMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesResponse ExportTestCasesResponse} - # - # @overload export_test_cases(request, options = nil) - # Pass arguments to `export_test_cases` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_test_cases(parent: nil, gcs_uri: nil, data_format: nil, filter: nil) - # Pass arguments to `export_test_cases` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 where to export test cases from. - # Format: `projects//locations//agents/`. - # @param gcs_uri [::String] - # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to - # export the test cases to. The format of this URI must be - # `gs:///`. If unspecified, the serialized test - # cases 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). - # @param data_format [::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest::DataFormat] - # The data format of the exported test cases. If not specified, `BLOB` is - # assumed. - # @param filter [::String] - # The filter expression used to filter exported test cases, see - # [API Filtering](https://aip.dev/160). The expression is case insensitive - # and supports the following syntax: - # - # name = [OR name = ] ... - # - # For example: - # - # * "name = t1 OR name = t2" matches the test case with the exact resource - # name "t1" or "t2". - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest.new - # - # # Call the export_test_cases method. - # result = client.export_test_cases request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_test_cases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest - - # Converts hash and nil to 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_test_cases.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_test_cases.timeout, - metadata: metadata, - retry_policy: @config.rpcs.export_test_cases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.call_rpc :export_test_cases, 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 - - ## - # Fetches the list of run results for the given test case. A maximum of 100 - # results are kept for each test case. - # - # @overload list_test_case_results(request, options = nil) - # Pass arguments to `list_test_case_results` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_test_case_results(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_test_case_results` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The test case to list results for. - # Format: - # `projects//locations//agents//testCases/`. - # Specify a `-` as a wildcard for TestCase ID to - # list results across multiple test cases. - # @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. - # @param filter [::String] - # The filter expression used to filter test case results. See - # [API Filtering](https://aip.dev/160). - # - # The expression is case insensitive. Only 'AND' is supported for logical - # operators. The supported syntax is listed below in detail: - # - # [AND ] ... - # [AND latest] - # - # The supported fields and operators are: - # field operator - # `environment` `=`, `IN` (Use value `draft` for draft environment) - # `test_time` `>`, `<` - # - # `latest` only returns the latest test result in all results for each test - # case. - # - # Examples: - # * "environment=draft AND latest" matches the latest test result for each - # test case in the draft environment. - # * "environment IN (e1,e2)" matches any test case results with an - # environment resource name of either "e1" or "e2". - # * "test_time > 1602540713" matches any test case results with test time - # later than a unix timestamp in seconds 1602540713. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest.new - # - # # Call the list_test_case_results method. - # result = client.list_test_case_results request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::TestCaseResult. - # p item - # end - # - def list_test_case_results request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest - - # Converts hash and nil to 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_test_case_results.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_test_case_results.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_test_case_results.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.call_rpc :list_test_case_results, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @test_cases_stub, :list_test_case_results, 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 - - ## - # Gets a test case result. - # - # @overload get_test_case_result(request, options = nil) - # Pass arguments to `get_test_case_result` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_test_case_result(name: nil) - # Pass arguments to `get_test_case_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 name [::String] - # Required. The name of the testcase. - # Format: - # `projects//locations//agents//testCases//results/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::TestCaseResult] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TestCaseResult] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest.new - # - # # Call the get_test_case_result method. - # result = client.get_test_case_result request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCaseResult. - # p result - # - def get_test_case_result request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest - - # Converts hash and nil to 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_test_case_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_test_case_result.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_test_case_result.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.call_rpc :get_test_case_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 TestCases API. - # - # This class represents the configuration for TestCases, - # 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::CX::V3::TestCases::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_test_cases to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_test_cases.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_test_cases.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::CX::V3::TestCases::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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 TestCases API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_test_cases` - # @return [::Gapic::Config::Method] - # - attr_reader :list_test_cases - ## - # RPC-specific configuration for `batch_delete_test_cases` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_delete_test_cases - ## - # RPC-specific configuration for `get_test_case` - # @return [::Gapic::Config::Method] - # - attr_reader :get_test_case - ## - # RPC-specific configuration for `create_test_case` - # @return [::Gapic::Config::Method] - # - attr_reader :create_test_case - ## - # RPC-specific configuration for `update_test_case` - # @return [::Gapic::Config::Method] - # - attr_reader :update_test_case - ## - # RPC-specific configuration for `run_test_case` - # @return [::Gapic::Config::Method] - # - attr_reader :run_test_case - ## - # RPC-specific configuration for `batch_run_test_cases` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_run_test_cases - ## - # RPC-specific configuration for `calculate_coverage` - # @return [::Gapic::Config::Method] - # - attr_reader :calculate_coverage - ## - # RPC-specific configuration for `import_test_cases` - # @return [::Gapic::Config::Method] - # - attr_reader :import_test_cases - ## - # RPC-specific configuration for `export_test_cases` - # @return [::Gapic::Config::Method] - # - attr_reader :export_test_cases - ## - # RPC-specific configuration for `list_test_case_results` - # @return [::Gapic::Config::Method] - # - attr_reader :list_test_case_results - ## - # RPC-specific configuration for `get_test_case_result` - # @return [::Gapic::Config::Method] - # - attr_reader :get_test_case_result - - # @private - def initialize parent_rpcs = nil - list_test_cases_config = parent_rpcs.list_test_cases if parent_rpcs.respond_to? :list_test_cases - @list_test_cases = ::Gapic::Config::Method.new list_test_cases_config - batch_delete_test_cases_config = parent_rpcs.batch_delete_test_cases if parent_rpcs.respond_to? :batch_delete_test_cases - @batch_delete_test_cases = ::Gapic::Config::Method.new batch_delete_test_cases_config - get_test_case_config = parent_rpcs.get_test_case if parent_rpcs.respond_to? :get_test_case - @get_test_case = ::Gapic::Config::Method.new get_test_case_config - create_test_case_config = parent_rpcs.create_test_case if parent_rpcs.respond_to? :create_test_case - @create_test_case = ::Gapic::Config::Method.new create_test_case_config - update_test_case_config = parent_rpcs.update_test_case if parent_rpcs.respond_to? :update_test_case - @update_test_case = ::Gapic::Config::Method.new update_test_case_config - run_test_case_config = parent_rpcs.run_test_case if parent_rpcs.respond_to? :run_test_case - @run_test_case = ::Gapic::Config::Method.new run_test_case_config - batch_run_test_cases_config = parent_rpcs.batch_run_test_cases if parent_rpcs.respond_to? :batch_run_test_cases - @batch_run_test_cases = ::Gapic::Config::Method.new batch_run_test_cases_config - calculate_coverage_config = parent_rpcs.calculate_coverage if parent_rpcs.respond_to? :calculate_coverage - @calculate_coverage = ::Gapic::Config::Method.new calculate_coverage_config - import_test_cases_config = parent_rpcs.import_test_cases if parent_rpcs.respond_to? :import_test_cases - @import_test_cases = ::Gapic::Config::Method.new import_test_cases_config - export_test_cases_config = parent_rpcs.export_test_cases if parent_rpcs.respond_to? :export_test_cases - @export_test_cases = ::Gapic::Config::Method.new export_test_cases_config - list_test_case_results_config = parent_rpcs.list_test_case_results if parent_rpcs.respond_to? :list_test_case_results - @list_test_case_results = ::Gapic::Config::Method.new list_test_case_results_config - get_test_case_result_config = parent_rpcs.get_test_case_result if parent_rpcs.respond_to? :get_test_case_result - @get_test_case_result = ::Gapic::Config::Method.new get_test_case_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/credentials.rb deleted file mode 100644 index d8b1d5ef27e1..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module TestCases - # Credentials for the TestCases 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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb deleted file mode 100644 index b94f6a54e81e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/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 CX - module V3 - module TestCases - # 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 TestCases 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 TestCases 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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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. - # * `: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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb deleted file mode 100644 index ed253c1cb083..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/paths.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 CX - module V3 - module TestCases - # Path helper methods for the TestCases API. - module Paths - ## - # Create a fully-qualified Agent resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # - # @return [::String] - def agent_path project:, location:, agent: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}" - end - - ## - # Create a fully-qualified EntityType resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param entity_type [String] - # - # @return [::String] - def entity_type_path project:, location:, agent:, entity_type: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/entityTypes/#{entity_type}" - end - - ## - # Create a fully-qualified Environment resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param environment [String] - # - # @return [::String] - def environment_path project:, location:, agent:, environment: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}" - end - - ## - # Create a fully-qualified Flow resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param flow [String] - # - # @return [::String] - def flow_path project:, location:, agent:, flow: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}" - end - - ## - # Create a fully-qualified Generator resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/generators/{generator}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param generator [String] - # - # @return [::String] - def generator_path project:, location:, agent:, generator: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/generators/#{generator}" - end - - ## - # Create a fully-qualified Intent resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/intents/{intent}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param intent [String] - # - # @return [::String] - def intent_path project:, location:, agent:, intent: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/intents/#{intent}" - end - - ## - # Create a fully-qualified Page resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param flow [String] - # @param page [String] - # - # @return [::String] - def page_path project:, location:, agent:, flow:, page: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/pages/#{page}" - end - - ## - # Create a fully-qualified Playbook resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param playbook [String] - # - # @return [::String] - def playbook_path project:, location:, agent:, playbook: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}" - end - - ## - # Create a fully-qualified TestCase resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param test_case [String] - # - # @return [::String] - def test_case_path project:, location:, agent:, test_case: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/testCases/#{test_case}" - end - - ## - # Create a fully-qualified TestCaseResult resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param test_case [String] - # @param result [String] - # - # @return [::String] - def test_case_result_path project:, location:, agent:, test_case:, result: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "test_case cannot contain /" if test_case.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/testCases/#{test_case}/results/#{result}" - end - - ## - # Create a fully-qualified Tool resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/tools/{tool}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param tool [String] - # - # @return [::String] - def tool_path project:, location:, agent:, tool: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/tools/#{tool}" - end - - ## - # Create a fully-qualified TransitionRouteGroup resource string. - # - # @overload transition_route_group_path(project:, location:, agent:, flow:, transition_route_group:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param flow [String] - # @param transition_route_group [String] - # - # @overload transition_route_group_path(project:, location:, agent:, transition_route_group:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param transition_route_group [String] - # - # @return [::String] - def transition_route_group_path **args - resources = { - "agent:flow:location:project:transition_route_group" => (proc do |project:, location:, agent:, flow:, transition_route_group:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/transitionRouteGroups/#{transition_route_group}" - end), - "agent:location:project:transition_route_group" => (proc do |project:, location:, agent:, transition_route_group:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/transitionRouteGroups/#{transition_route_group}" - 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 Webhook resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param webhook [String] - # - # @return [::String] - def webhook_path project:, location:, agent:, webhook: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/webhooks/#{webhook}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest.rb deleted file mode 100644 index 4af16853c495..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/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/cx/v3/version" -require "google/cloud/dialogflow/cx/v3/bindings_override" - -require "google/cloud/dialogflow/cx/v3/test_cases/credentials" -require "google/cloud/dialogflow/cx/v3/test_cases/paths" -require "google/cloud/dialogflow/cx/v3/test_cases/rest/operations" -require "google/cloud/dialogflow/cx/v3/test_cases/rest/client" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::TestCase Test Cases} and - # {::Google::Cloud::Dialogflow::CX::V3::TestCaseResult Test Case Results}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/cx/v3/test_cases/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new - # - module TestCases - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/test_cases/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb deleted file mode 100644 index 40efd42e2e18..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb +++ /dev/null @@ -1,1610 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/test_case_pb" -require "google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module TestCases - module Rest - ## - # REST client for the TestCases service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::TestCase Test Cases} and - # {::Google::Cloud::Dialogflow::CX::V3::TestCaseResult Test Case Results}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :test_cases_stub - - ## - # Configure the TestCases Client class. - # - # See {::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TestCases clients - # ::Google::Cloud::Dialogflow::CX::V3::TestCases::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", "CX", "V3"] - 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 TestCases 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::CX::V3::TestCases::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 - @test_cases_stub.universe_domain - end - - ## - # Create a new TestCases REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TestCases 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::CX::V3::TestCases::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 - - @test_cases_stub = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @test_cases_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 = @test_cases_stub.endpoint - config.universe_domain = @test_cases_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @test_cases_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TestCases::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 - @test_cases_stub.logger - end - - # Service calls - - ## - # Fetches a list of test cases for a given agent. - # - # @overload list_test_cases(request, options = nil) - # Pass arguments to `list_test_cases` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_test_cases(parent: nil, page_size: nil, page_token: nil, view: nil) - # Pass arguments to `list_test_cases` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 pages for. - # Format: `projects//locations//agents/`. - # @param page_size [::Integer] - # The maximum number of items to return in a single page. By default 20. - # Note that when TestCaseView = FULL, the maximum page size allowed is 20. - # When TestCaseView = BASIC, the maximum page size allowed is 500. - # @param page_token [::String] - # The next_page_token value returned from a previous list request. - # @param view [::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest::TestCaseView] - # Specifies whether response should include all fields or just the metadata. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCase>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCase>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest.new - # - # # Call the list_test_cases method. - # result = client.list_test_cases request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::TestCase. - # p item - # end - # - def list_test_cases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest - - # Converts hash and nil to an 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_test_cases.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_test_cases.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_test_cases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.list_test_cases request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @test_cases_stub, :list_test_cases, "test_cases", 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 - - ## - # Batch deletes test cases. - # - # @overload batch_delete_test_cases(request, options = nil) - # Pass arguments to `batch_delete_test_cases` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_test_cases(parent: nil, names: nil) - # Pass arguments to `batch_delete_test_cases` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 delete test cases from. - # Format: `projects//locations//agents/`. - # @param names [::Array<::String>] - # Required. Format of test case names: - # `projects//locations//agents//testCases/`. - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest.new - # - # # Call the batch_delete_test_cases method. - # result = client.batch_delete_test_cases request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def batch_delete_test_cases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest - - # Converts hash and nil to an 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_test_cases.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_test_cases.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_delete_test_cases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.batch_delete_test_cases request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a test case. - # - # @overload get_test_case(request, options = nil) - # Pass arguments to `get_test_case` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_test_case(name: nil) - # Pass arguments to `get_test_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 testcase. - # Format: - # `projects//locations//agents//testCases/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::TestCase] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest.new - # - # # Call the get_test_case method. - # result = client.get_test_case request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. - # p result - # - def get_test_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest - - # Converts hash and nil to an 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_test_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_test_case.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_test_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.get_test_case request, 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 test case for the given agent. - # - # @overload create_test_case(request, options = nil) - # Pass arguments to `create_test_case` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_test_case(parent: nil, test_case: nil) - # Pass arguments to `create_test_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 the test case for. - # Format: `projects//locations//agents/`. - # @param test_case [::Google::Cloud::Dialogflow::CX::V3::TestCase, ::Hash] - # Required. The test case to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::TestCase] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest.new - # - # # Call the create_test_case method. - # result = client.create_test_case request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. - # p result - # - def create_test_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest - - # Converts hash and nil to an 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_test_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_test_case.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_test_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.create_test_case request, 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 test case. - # - # @overload update_test_case(request, options = nil) - # Pass arguments to `update_test_case` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_test_case(test_case: nil, update_mask: nil) - # Pass arguments to `update_test_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param test_case [::Google::Cloud::Dialogflow::CX::V3::TestCase, ::Hash] - # Required. The test case to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The mask to specify which fields should be updated. The - # {::Google::Cloud::Dialogflow::CX::V3::TestCase#creation_time `creationTime`} and - # {::Google::Cloud::Dialogflow::CX::V3::TestCase#last_test_result `lastTestResult`} - # cannot be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::TestCase] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest.new - # - # # Call the update_test_case method. - # result = client.update_test_case request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. - # p result - # - def update_test_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest - - # Converts hash and nil to an 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_test_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_test_case.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_test_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.update_test_case request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Kicks off a test case run. - # - # 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::CX::V3::RunTestCaseMetadata RunTestCaseMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::RunTestCaseResponse RunTestCaseResponse} - # - # @overload run_test_case(request, options = nil) - # Pass arguments to `run_test_case` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload run_test_case(name: nil, environment: nil) - # Pass arguments to `run_test_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Format of test case name to run: - # `projects//locations//agents//testCases/`. - # @param environment [::String] - # Optional. Environment name. If not set, draft environment is assumed. - # Format: - # `projects//locations//agents//environments/`. - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest.new - # - # # Call the run_test_case method. - # result = client.run_test_case request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def run_test_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.run_test_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.run_test_case.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.run_test_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.run_test_case 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 - - ## - # Kicks off a batch run of test cases. - # - # 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::CX::V3::BatchRunTestCasesMetadata BatchRunTestCasesMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesResponse BatchRunTestCasesResponse} - # - # @overload batch_run_test_cases(request, options = nil) - # Pass arguments to `batch_run_test_cases` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_run_test_cases(parent: nil, environment: nil, test_cases: nil) - # Pass arguments to `batch_run_test_cases` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Agent name. Format: - # `projects//locations//agents/`. - # @param environment [::String] - # Optional. If not set, draft environment is assumed. Format: - # `projects//locations//agents//environments/`. - # @param test_cases [::Array<::String>] - # Required. Format: - # `projects//locations//agents//testCases/`. - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest.new - # - # # Call the batch_run_test_cases method. - # result = client.batch_run_test_cases request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_run_test_cases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest - - # Converts hash and nil to an 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_run_test_cases.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_run_test_cases.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_run_test_cases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.batch_run_test_cases 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 - - ## - # Calculates the test coverage for an agent. - # - # @overload calculate_coverage(request, options = nil) - # Pass arguments to `calculate_coverage` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload calculate_coverage(agent: nil, type: nil) - # Pass arguments to `calculate_coverage` via keyword arguments. Note that at - # least one keyword argument is 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 [::String] - # Required. The agent to calculate coverage for. - # Format: `projects//locations//agents/`. - # @param type [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest::CoverageType] - # Required. The type of coverage requested. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest.new - # - # # Call the calculate_coverage method. - # result = client.calculate_coverage request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse. - # p result - # - def calculate_coverage request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.calculate_coverage.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.calculate_coverage.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.calculate_coverage.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.calculate_coverage request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Imports the test cases from a Cloud Storage bucket or a local file. It - # always creates new test cases and won't overwrite any existing ones. The - # provided ID in the imported test case is neglected. - # - # 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::CX::V3::ImportTestCasesMetadata ImportTestCasesMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesResponse ImportTestCasesResponse} - # - # @overload import_test_cases(request, options = nil) - # Pass arguments to `import_test_cases` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_test_cases(parent: nil, gcs_uri: nil, content: nil) - # Pass arguments to `import_test_cases` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 import test cases to. - # Format: `projects//locations//agents/`. - # @param gcs_uri [::String] - # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI - # to import test cases from. The format of this URI must be - # `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: `gcs_uri`, `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 content [::String] - # Uncompressed raw byte content for test cases. - # - # Note: The following parameters are mutually exclusive: `content`, `gcs_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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest.new - # - # # Call the import_test_cases method. - # result = client.import_test_cases request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_test_cases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest - - # Converts hash and nil to an 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_test_cases.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_test_cases.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_test_cases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.import_test_cases 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 test cases under the agent to a Cloud Storage bucket or a local - # file. Filter can be applied to export a subset of test cases. - # - # 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::CX::V3::ExportTestCasesMetadata ExportTestCasesMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesResponse ExportTestCasesResponse} - # - # @overload export_test_cases(request, options = nil) - # Pass arguments to `export_test_cases` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_test_cases(parent: nil, gcs_uri: nil, data_format: nil, filter: nil) - # Pass arguments to `export_test_cases` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 where to export test cases from. - # Format: `projects//locations//agents/`. - # @param gcs_uri [::String] - # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to - # export the test cases to. The format of this URI must be - # `gs:///`. If unspecified, the serialized test - # cases 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). - # @param data_format [::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest::DataFormat] - # The data format of the exported test cases. If not specified, `BLOB` is - # assumed. - # @param filter [::String] - # The filter expression used to filter exported test cases, see - # [API Filtering](https://aip.dev/160). The expression is case insensitive - # and supports the following syntax: - # - # name = [OR name = ] ... - # - # For example: - # - # * "name = t1 OR name = t2" matches the test case with the exact resource - # name "t1" or "t2". - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest.new - # - # # Call the export_test_cases method. - # result = client.export_test_cases request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_test_cases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest - - # Converts hash and nil to an 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_test_cases.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_test_cases.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.export_test_cases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.export_test_cases 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 - - ## - # Fetches the list of run results for the given test case. A maximum of 100 - # results are kept for each test case. - # - # @overload list_test_case_results(request, options = nil) - # Pass arguments to `list_test_case_results` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_test_case_results(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_test_case_results` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The test case to list results for. - # Format: - # `projects//locations//agents//testCases/`. - # Specify a `-` as a wildcard for TestCase ID to - # list results across multiple test cases. - # @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. - # @param filter [::String] - # The filter expression used to filter test case results. See - # [API Filtering](https://aip.dev/160). - # - # The expression is case insensitive. Only 'AND' is supported for logical - # operators. The supported syntax is listed below in detail: - # - # [AND ] ... - # [AND latest] - # - # The supported fields and operators are: - # field operator - # `environment` `=`, `IN` (Use value `draft` for draft environment) - # `test_time` `>`, `<` - # - # `latest` only returns the latest test result in all results for each test - # case. - # - # Examples: - # * "environment=draft AND latest" matches the latest test result for each - # test case in the draft environment. - # * "environment IN (e1,e2)" matches any test case results with an - # environment resource name of either "e1" or "e2". - # * "test_time > 1602540713" matches any test case results with test time - # later than a unix timestamp in seconds 1602540713. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest.new - # - # # Call the list_test_case_results method. - # result = client.list_test_case_results request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::TestCaseResult. - # p item - # end - # - def list_test_case_results request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest - - # Converts hash and nil to an 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_test_case_results.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_test_case_results.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_test_case_results.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.list_test_case_results request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @test_cases_stub, :list_test_case_results, "test_case_results", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a test case result. - # - # @overload get_test_case_result(request, options = nil) - # Pass arguments to `get_test_case_result` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_test_case_result(name: nil) - # Pass arguments to `get_test_case_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 name [::String] - # Required. The name of the testcase. - # Format: - # `projects//locations//agents//testCases//results/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::TestCaseResult] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TestCaseResult] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest.new - # - # # Call the get_test_case_result method. - # result = client.get_test_case_result request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCaseResult. - # p result - # - def get_test_case_result request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest - - # Converts hash and nil to an 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_test_case_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_test_case_result.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_test_case_result.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @test_cases_stub.get_test_case_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 TestCases REST API. - # - # This class represents the configuration for TestCases 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::CX::V3::TestCases::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_test_cases to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_test_cases.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_test_cases.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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 TestCases API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_test_cases` - # @return [::Gapic::Config::Method] - # - attr_reader :list_test_cases - ## - # RPC-specific configuration for `batch_delete_test_cases` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_delete_test_cases - ## - # RPC-specific configuration for `get_test_case` - # @return [::Gapic::Config::Method] - # - attr_reader :get_test_case - ## - # RPC-specific configuration for `create_test_case` - # @return [::Gapic::Config::Method] - # - attr_reader :create_test_case - ## - # RPC-specific configuration for `update_test_case` - # @return [::Gapic::Config::Method] - # - attr_reader :update_test_case - ## - # RPC-specific configuration for `run_test_case` - # @return [::Gapic::Config::Method] - # - attr_reader :run_test_case - ## - # RPC-specific configuration for `batch_run_test_cases` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_run_test_cases - ## - # RPC-specific configuration for `calculate_coverage` - # @return [::Gapic::Config::Method] - # - attr_reader :calculate_coverage - ## - # RPC-specific configuration for `import_test_cases` - # @return [::Gapic::Config::Method] - # - attr_reader :import_test_cases - ## - # RPC-specific configuration for `export_test_cases` - # @return [::Gapic::Config::Method] - # - attr_reader :export_test_cases - ## - # RPC-specific configuration for `list_test_case_results` - # @return [::Gapic::Config::Method] - # - attr_reader :list_test_case_results - ## - # RPC-specific configuration for `get_test_case_result` - # @return [::Gapic::Config::Method] - # - attr_reader :get_test_case_result - - # @private - def initialize parent_rpcs = nil - list_test_cases_config = parent_rpcs.list_test_cases if parent_rpcs.respond_to? :list_test_cases - @list_test_cases = ::Gapic::Config::Method.new list_test_cases_config - batch_delete_test_cases_config = parent_rpcs.batch_delete_test_cases if parent_rpcs.respond_to? :batch_delete_test_cases - @batch_delete_test_cases = ::Gapic::Config::Method.new batch_delete_test_cases_config - get_test_case_config = parent_rpcs.get_test_case if parent_rpcs.respond_to? :get_test_case - @get_test_case = ::Gapic::Config::Method.new get_test_case_config - create_test_case_config = parent_rpcs.create_test_case if parent_rpcs.respond_to? :create_test_case - @create_test_case = ::Gapic::Config::Method.new create_test_case_config - update_test_case_config = parent_rpcs.update_test_case if parent_rpcs.respond_to? :update_test_case - @update_test_case = ::Gapic::Config::Method.new update_test_case_config - run_test_case_config = parent_rpcs.run_test_case if parent_rpcs.respond_to? :run_test_case - @run_test_case = ::Gapic::Config::Method.new run_test_case_config - batch_run_test_cases_config = parent_rpcs.batch_run_test_cases if parent_rpcs.respond_to? :batch_run_test_cases - @batch_run_test_cases = ::Gapic::Config::Method.new batch_run_test_cases_config - calculate_coverage_config = parent_rpcs.calculate_coverage if parent_rpcs.respond_to? :calculate_coverage - @calculate_coverage = ::Gapic::Config::Method.new calculate_coverage_config - import_test_cases_config = parent_rpcs.import_test_cases if parent_rpcs.respond_to? :import_test_cases - @import_test_cases = ::Gapic::Config::Method.new import_test_cases_config - export_test_cases_config = parent_rpcs.export_test_cases if parent_rpcs.respond_to? :export_test_cases - @export_test_cases = ::Gapic::Config::Method.new export_test_cases_config - list_test_case_results_config = parent_rpcs.list_test_case_results if parent_rpcs.respond_to? :list_test_case_results - @list_test_case_results = ::Gapic::Config::Method.new list_test_case_results_config - get_test_case_result_config = parent_rpcs.get_test_case_result if parent_rpcs.respond_to? :get_test_case_result - @get_test_case_result = ::Gapic::Config::Method.new get_test_case_result_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb deleted file mode 100644 index 35681db2c542..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/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 CX - module V3 - module TestCases - 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 TestCases 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 TestCases 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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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. - # * `: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: "/v3/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3/{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: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3/{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: "/v3/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v3/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb deleted file mode 100644 index 2d54f7d15443..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb +++ /dev/null @@ -1,822 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/test_case_pb" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module TestCases - module Rest - ## - # REST service stub for the TestCases 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_test_cases REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::ListTestCasesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::ListTestCasesResponse] - # A result object deserialized from the server's reply - def list_test_cases request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_test_cases_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_test_cases", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::ListTestCasesResponse.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_test_cases REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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 batch_delete_test_cases request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_delete_test_cases_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_test_cases", - 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_test_case REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::TestCase] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] - # A result object deserialized from the server's reply - def get_test_case request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_test_case_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_test_case", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::TestCase.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_test_case REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::TestCase] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] - # A result object deserialized from the server's reply - def create_test_case request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_test_case_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_test_case", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::TestCase.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_test_case REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::TestCase] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] - # A result object deserialized from the server's reply - def update_test_case request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_test_case_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_test_case", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::TestCase.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the run_test_case REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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 run_test_case request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_run_test_case_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "run_test_case", - 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_run_test_cases REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_run_test_cases request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_run_test_cases_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_run_test_cases", - 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 calculate_coverage REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::CalculateCoverageResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse] - # A result object deserialized from the server's reply - def calculate_coverage request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_calculate_coverage_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "calculate_coverage", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse.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_test_cases REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_test_cases request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_test_cases_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_test_cases", - 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_test_cases REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_test_cases request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_export_test_cases_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_test_cases", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_test_case_results REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::ListTestCaseResultsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsResponse] - # A result object deserialized from the server's reply - def list_test_case_results request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_test_case_results_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_test_case_results", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsResponse.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_test_case_result REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::TestCaseResult] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TestCaseResult] - # A result object deserialized from the server's reply - def get_test_case_result request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_test_case_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_test_case_result", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::TestCaseResult.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_test_cases REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest] - # 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_test_cases_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/testCases", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_delete_test_cases REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest] - # 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_test_cases_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/testCases:batchDelete", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_test_case REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest] - # 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_test_case_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/testCases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_test_case REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest] - # 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_test_case_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/testCases", - body: "test_case", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_test_case REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest] - # 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_test_case_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v3/{test_case.name}", - body: "test_case", - matches: [ - ["test_case.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/testCases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the run_test_case REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_run_test_case_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{name}:run", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/testCases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_run_test_cases REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest] - # 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_run_test_cases_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/testCases:batchRun", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the calculate_coverage REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_calculate_coverage_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{agent}/testCases:calculateCoverage", - matches: [ - ["agent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_test_cases REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest] - # 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_test_cases_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/testCases:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the export_test_cases REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest] - # 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_test_cases_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/testCases:export", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_test_case_results REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest] - # 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_test_case_results_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/results", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/testCases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_test_case_result REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest] - # 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_test_case_result_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/testCases/[^/]+/results/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_group_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_group_pb.rb deleted file mode 100644 index 12885309af51..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_group_pb.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/transition_route_group.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/cx/v3/page_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n:google/cloud/dialogflow/cx/v3/transition_route_group.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/page.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xc9\x03\n\x14TransitionRouteGroup\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12I\n\x11transition_routes\x18\x05 \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.TransitionRoute:\xbc\x02\xea\x41\xb8\x02\n.dialogflow.googleapis.com/TransitionRouteGroup\x12rprojects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}\x12\x65projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}*\x15transitionRouteGroups2\x14transitionRouteGroup\"\xa8\x01\n ListTransitionRouteGroupsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.dialogflow.googleapis.com/TransitionRouteGroup\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x15\n\rlanguage_code\x18\x04 \x01(\t\"\x92\x01\n!ListTransitionRouteGroupsResponse\x12T\n\x17transition_route_groups\x18\x01 \x03(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.TransitionRouteGroup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"}\n\x1eGetTransitionRouteGroupRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.dialogflow.googleapis.com/TransitionRouteGroup\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\xdc\x01\n!CreateTransitionRouteGroupRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.dialogflow.googleapis.com/TransitionRouteGroup\x12X\n\x16transition_route_group\x18\x02 \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.TransitionRouteGroupB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"\xc5\x01\n!UpdateTransitionRouteGroupRequest\x12X\n\x16transition_route_group\x18\x01 \x01(\x0b\x32\x33.google.cloud.dialogflow.cx.v3.TransitionRouteGroupB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"x\n!DeleteTransitionRouteGroupRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.dialogflow.googleapis.com/TransitionRouteGroup\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\x32\xdd\x0e\n\x15TransitionRouteGroups\x12\xc3\x02\n\x19ListTransitionRouteGroups\x12?.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest\x1a@.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse\"\xa2\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x92\x01\x12J/v3/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroupsZD\x12\x42/v3/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups\x12\xb0\x02\n\x17GetTransitionRouteGroup\x12=.google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest\x1a\x33.google.cloud.dialogflow.cx.v3.TransitionRouteGroup\"\xa0\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x92\x01\x12J/v3/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}ZD\x12\x42/v3/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}\x12\xff\x02\n\x1a\x43reateTransitionRouteGroup\x12@.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest\x1a\x33.google.cloud.dialogflow.cx.v3.TransitionRouteGroup\"\xe9\x01\xda\x41\x1dparent,transition_route_group\x82\xd3\xe4\x93\x02\xc2\x01\"J/v3/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups:\x16transition_route_groupZ\\\"B/v3/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups:\x16transition_route_group\x12\xb2\x03\n\x1aUpdateTransitionRouteGroup\x12@.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest\x1a\x33.google.cloud.dialogflow.cx.v3.TransitionRouteGroup\"\x9c\x02\xda\x41\"transition_route_group,update_mask\x82\xd3\xe4\x93\x02\xf0\x01\x32\x61/v3/{transition_route_group.name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}:\x16transition_route_groupZs2Y/v3/{transition_route_group.name=projects/*/locations/*/agents/*/transitionRouteGroups/*}:\x16transition_route_group\x12\x99\x02\n\x1a\x44\x65leteTransitionRouteGroup\x12@.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest\x1a\x16.google.protobuf.Empty\"\xa0\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x92\x01*J/v3/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}ZD*B/v3/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xbc\x01\n!com.google.cloud.dialogflow.cx.v3B\x19TransitionRouteGroupProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.dialogflow.cx.v3.TransitionRoute", "google/cloud/dialogflow/cx/v3/page.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - TransitionRouteGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TransitionRouteGroup").msgclass - ListTransitionRouteGroupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest").msgclass - ListTransitionRouteGroupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse").msgclass - GetTransitionRouteGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest").msgclass - CreateTransitionRouteGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest").msgclass - UpdateTransitionRouteGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest").msgclass - DeleteTransitionRouteGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_group_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_group_services_pb.rb deleted file mode 100644 index c7b84cef5ab5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_group_services_pb.rb +++ /dev/null @@ -1,73 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/cx/v3/transition_route_group.proto for package 'Google.Cloud.Dialogflow.CX.V3' -# 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/cx/v3/transition_route_group_pb' - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module TransitionRouteGroups - # Service for managing - # [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.cx.v3.TransitionRouteGroups' - - # Returns the list of all transition route groups in the specified flow. - rpc :ListTransitionRouteGroups, ::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsResponse - # Retrieves the specified - # [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. - rpc :GetTransitionRouteGroup, ::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest, ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup - # Creates an - # [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] - # in the specified flow. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - rpc :CreateTransitionRouteGroup, ::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest, ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup - # Updates the specified - # [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - rpc :UpdateTransitionRouteGroup, ::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest, ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup - # Deletes the specified - # [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - rpc :DeleteTransitionRouteGroup, ::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest, ::Google::Protobuf::Empty - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups.rb deleted file mode 100644 index d5fc7a737a09..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups.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/cx/v3/version" - -require "google/cloud/dialogflow/cx/v3/transition_route_groups/credentials" -require "google/cloud/dialogflow/cx/v3/transition_route_groups/paths" -require "google/cloud/dialogflow/cx/v3/transition_route_groups/client" -require "google/cloud/dialogflow/cx/v3/transition_route_groups/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroups}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/cx/v3/transition_route_groups" - # client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/cx/v3/transition_route_groups/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new - # - module TransitionRouteGroups - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "transition_route_groups", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/transition_route_groups/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb deleted file mode 100644 index 0bf45be3a3f3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb +++ /dev/null @@ -1,974 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/transition_route_group_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module TransitionRouteGroups - ## - # Client for the TransitionRouteGroups service. - # - # Service for managing - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroups}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :transition_route_groups_stub - - ## - # Configure the TransitionRouteGroups Client class. - # - # See {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TransitionRouteGroups clients - # ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::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", "CX", "V3"] - 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 TransitionRouteGroups 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::CX::V3::TransitionRouteGroups::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 - @transition_route_groups_stub.universe_domain - end - - ## - # Create a new TransitionRouteGroups client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TransitionRouteGroups 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/cx/v3/transition_route_group_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 - - @transition_route_groups_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::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 - ) - - @transition_route_groups_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 = @transition_route_groups_stub.endpoint - config.universe_domain = @transition_route_groups_stub.universe_domain - config.logger = @transition_route_groups_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 - @transition_route_groups_stub.logger - end - - # Service calls - - ## - # Returns the list of all transition route groups in the specified flow. - # - # @overload list_transition_route_groups(request, options = nil) - # Pass arguments to `list_transition_route_groups` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_transition_route_groups(parent: nil, page_size: nil, page_token: nil, language_code: nil) - # Pass arguments to `list_transition_route_groups` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The flow to list all transition route groups for. - # Format: - # `projects//locations//agents//flows/` - # or `projects//locations//agents/. - # @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. - # @param language_code [::String] - # The language to list transition route groups for. The following fields are - # language dependent: - # - # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` - # * - # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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 [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest.new - # - # # Call the list_transition_route_groups method. - # result = client.list_transition_route_groups request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::TransitionRouteGroup. - # p item - # end - # - def list_transition_route_groups request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest - - # Converts hash and nil to 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_transition_route_groups.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_transition_route_groups.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_transition_route_groups.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @transition_route_groups_stub.call_rpc :list_transition_route_groups, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @transition_route_groups_stub, :list_transition_route_groups, 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 - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup}. - # - # @overload get_transition_route_group(request, options = nil) - # Pass arguments to `get_transition_route_group` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_transition_route_group(name: nil, language_code: nil) - # Pass arguments to `get_transition_route_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup}. - # Format: - # `projects//locations//agents//flows//transitionRouteGroups/` - # or - # `projects//locations//agents//transitionRouteGroups/`. - # @param language_code [::String] - # The language to retrieve the transition route group for. The following - # fields are language dependent: - # - # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` - # * - # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::TransitionRouteGroup] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest.new - # - # # Call the get_transition_route_group method. - # result = client.get_transition_route_group request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. - # p result - # - def get_transition_route_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest - - # Converts hash and nil to 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_transition_route_group.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_transition_route_group.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_transition_route_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @transition_route_groups_stub.call_rpc :get_transition_route_group, request, 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 - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup} - # in the specified flow. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload create_transition_route_group(request, options = nil) - # Pass arguments to `create_transition_route_group` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_transition_route_group(parent: nil, transition_route_group: nil, language_code: nil) - # Pass arguments to `create_transition_route_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The flow to create an - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup} - # for. Format: - # `projects//locations//agents//flows/` - # or `projects//locations//agents/` - # for agent-level groups. - # @param transition_route_group [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup, ::Hash] - # Required. The transition route group to create. - # @param language_code [::String] - # The language of the following fields in `TransitionRouteGroup`: - # - # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` - # * - # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::TransitionRouteGroup] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest.new - # - # # Call the create_transition_route_group method. - # result = client.create_transition_route_group request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. - # p result - # - def create_transition_route_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest - - # Converts hash and nil to 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_transition_route_group.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_transition_route_group.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_transition_route_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @transition_route_groups_stub.call_rpc :create_transition_route_group, request, 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 - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup}. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload update_transition_route_group(request, options = nil) - # Pass arguments to `update_transition_route_group` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_transition_route_group(transition_route_group: nil, update_mask: nil, language_code: nil) - # Pass arguments to `update_transition_route_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param transition_route_group [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup, ::Hash] - # Required. The transition route group to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The mask to control which fields get updated. - # @param language_code [::String] - # The language of the following fields in `TransitionRouteGroup`: - # - # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` - # * - # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::TransitionRouteGroup] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest.new - # - # # Call the update_transition_route_group method. - # result = client.update_transition_route_group request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. - # p result - # - def update_transition_route_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest - - # Converts hash and nil to 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_transition_route_group.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.transition_route_group&.name - header_params["transition_route_group.name"] = request.transition_route_group.name - end - - request_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_transition_route_group.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_transition_route_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @transition_route_groups_stub.call_rpc :update_transition_route_group, request, 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 - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup}. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload delete_transition_route_group(request, options = nil) - # Pass arguments to `delete_transition_route_group` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_transition_route_group(name: nil, force: nil) - # Pass arguments to `delete_transition_route_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup} - # to delete. Format: - # `projects//locations//agents//flows//transitionRouteGroups/` - # or - # `projects//locations//agents//transitionRouteGroups/`. - # @param force [::Boolean] - # This field has no effect for transition route group that no page is using. - # If the transition route group is referenced by any page: - # - # * If `force` is set to false, an error will be returned with message - # indicating pages that reference the transition route group. - # * If `force` is set to true, Dialogflow will remove the transition route - # group, as well as any reference to it. - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest.new - # - # # Call the delete_transition_route_group method. - # result = client.delete_transition_route_group request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_transition_route_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest - - # Converts hash and nil to 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_transition_route_group.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_transition_route_group.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_transition_route_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @transition_route_groups_stub.call_rpc :delete_transition_route_group, request, 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 TransitionRouteGroups API. - # - # This class represents the configuration for TransitionRouteGroups, - # 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::CX::V3::TransitionRouteGroups::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_transition_route_groups to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_transition_route_groups.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_transition_route_groups.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::CX::V3::TransitionRouteGroups::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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 TransitionRouteGroups API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_transition_route_groups` - # @return [::Gapic::Config::Method] - # - attr_reader :list_transition_route_groups - ## - # RPC-specific configuration for `get_transition_route_group` - # @return [::Gapic::Config::Method] - # - attr_reader :get_transition_route_group - ## - # RPC-specific configuration for `create_transition_route_group` - # @return [::Gapic::Config::Method] - # - attr_reader :create_transition_route_group - ## - # RPC-specific configuration for `update_transition_route_group` - # @return [::Gapic::Config::Method] - # - attr_reader :update_transition_route_group - ## - # RPC-specific configuration for `delete_transition_route_group` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_transition_route_group - - # @private - def initialize parent_rpcs = nil - list_transition_route_groups_config = parent_rpcs.list_transition_route_groups if parent_rpcs.respond_to? :list_transition_route_groups - @list_transition_route_groups = ::Gapic::Config::Method.new list_transition_route_groups_config - get_transition_route_group_config = parent_rpcs.get_transition_route_group if parent_rpcs.respond_to? :get_transition_route_group - @get_transition_route_group = ::Gapic::Config::Method.new get_transition_route_group_config - create_transition_route_group_config = parent_rpcs.create_transition_route_group if parent_rpcs.respond_to? :create_transition_route_group - @create_transition_route_group = ::Gapic::Config::Method.new create_transition_route_group_config - update_transition_route_group_config = parent_rpcs.update_transition_route_group if parent_rpcs.respond_to? :update_transition_route_group - @update_transition_route_group = ::Gapic::Config::Method.new update_transition_route_group_config - delete_transition_route_group_config = parent_rpcs.delete_transition_route_group if parent_rpcs.respond_to? :delete_transition_route_group - @delete_transition_route_group = ::Gapic::Config::Method.new delete_transition_route_group_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/credentials.rb deleted file mode 100644 index ccf23a5e9cdc..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module TransitionRouteGroups - # Credentials for the TransitionRouteGroups 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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/paths.rb deleted file mode 100644 index 22dc12c3da95..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/paths.rb +++ /dev/null @@ -1,231 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - module TransitionRouteGroups - # Path helper methods for the TransitionRouteGroups API. - module Paths - ## - # Create a fully-qualified Agent resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # - # @return [::String] - def agent_path project:, location:, agent: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}" - end - - ## - # Create a fully-qualified Flow resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param flow [String] - # - # @return [::String] - def flow_path project:, location:, agent:, flow: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}" - end - - ## - # Create a fully-qualified Generator resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/generators/{generator}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param generator [String] - # - # @return [::String] - def generator_path project:, location:, agent:, generator: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/generators/#{generator}" - end - - ## - # Create a fully-qualified Intent resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/intents/{intent}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param intent [String] - # - # @return [::String] - def intent_path project:, location:, agent:, intent: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/intents/#{intent}" - end - - ## - # Create a fully-qualified Page resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param flow [String] - # @param page [String] - # - # @return [::String] - def page_path project:, location:, agent:, flow:, page: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/pages/#{page}" - end - - ## - # Create a fully-qualified Tool resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/tools/{tool}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param tool [String] - # - # @return [::String] - def tool_path project:, location:, agent:, tool: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/tools/#{tool}" - end - - ## - # Create a fully-qualified TransitionRouteGroup resource string. - # - # @overload transition_route_group_path(project:, location:, agent:, flow:, transition_route_group:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param flow [String] - # @param transition_route_group [String] - # - # @overload transition_route_group_path(project:, location:, agent:, transition_route_group:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param transition_route_group [String] - # - # @return [::String] - def transition_route_group_path **args - resources = { - "agent:flow:location:project:transition_route_group" => (proc do |project:, location:, agent:, flow:, transition_route_group:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/transitionRouteGroups/#{transition_route_group}" - end), - "agent:location:project:transition_route_group" => (proc do |project:, location:, agent:, transition_route_group:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/transitionRouteGroups/#{transition_route_group}" - 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 Webhook resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param webhook [String] - # - # @return [::String] - def webhook_path project:, location:, agent:, webhook: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/webhooks/#{webhook}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest.rb deleted file mode 100644 index f1875d7a1ea6..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/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/cx/v3/version" -require "google/cloud/dialogflow/cx/v3/bindings_override" - -require "google/cloud/dialogflow/cx/v3/transition_route_groups/credentials" -require "google/cloud/dialogflow/cx/v3/transition_route_groups/paths" -require "google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroups}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/cx/v3/transition_route_groups/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new - # - module TransitionRouteGroups - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/transition_route_groups/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb deleted file mode 100644 index 3f0ce20c675e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb +++ /dev/null @@ -1,904 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/transition_route_group_pb" -require "google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module TransitionRouteGroups - module Rest - ## - # REST client for the TransitionRouteGroups service. - # - # Service for managing - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroups}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :transition_route_groups_stub - - ## - # Configure the TransitionRouteGroups Client class. - # - # See {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TransitionRouteGroups clients - # ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::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", "CX", "V3"] - 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 TransitionRouteGroups 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::CX::V3::TransitionRouteGroups::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 - @transition_route_groups_stub.universe_domain - end - - ## - # Create a new TransitionRouteGroups REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TransitionRouteGroups 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 - - @transition_route_groups_stub = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @transition_route_groups_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 = @transition_route_groups_stub.endpoint - config.universe_domain = @transition_route_groups_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @transition_route_groups_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 - @transition_route_groups_stub.logger - end - - # Service calls - - ## - # Returns the list of all transition route groups in the specified flow. - # - # @overload list_transition_route_groups(request, options = nil) - # Pass arguments to `list_transition_route_groups` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_transition_route_groups(parent: nil, page_size: nil, page_token: nil, language_code: nil) - # Pass arguments to `list_transition_route_groups` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The flow to list all transition route groups for. - # Format: - # `projects//locations//agents//flows/` - # or `projects//locations//agents/. - # @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. - # @param language_code [::String] - # The language to list transition route groups for. The following fields are - # language dependent: - # - # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` - # * - # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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 [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest.new - # - # # Call the list_transition_route_groups method. - # result = client.list_transition_route_groups request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::TransitionRouteGroup. - # p item - # end - # - def list_transition_route_groups request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest - - # Converts hash and nil to an 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_transition_route_groups.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_transition_route_groups.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_transition_route_groups.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @transition_route_groups_stub.list_transition_route_groups request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @transition_route_groups_stub, :list_transition_route_groups, "transition_route_groups", 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 - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup}. - # - # @overload get_transition_route_group(request, options = nil) - # Pass arguments to `get_transition_route_group` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_transition_route_group(name: nil, language_code: nil) - # Pass arguments to `get_transition_route_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup}. - # Format: - # `projects//locations//agents//flows//transitionRouteGroups/` - # or - # `projects//locations//agents//transitionRouteGroups/`. - # @param language_code [::String] - # The language to retrieve the transition route group for. The following - # fields are language dependent: - # - # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` - # * - # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::TransitionRouteGroup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest.new - # - # # Call the get_transition_route_group method. - # result = client.get_transition_route_group request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. - # p result - # - def get_transition_route_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest - - # Converts hash and nil to an 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_transition_route_group.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_transition_route_group.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_transition_route_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @transition_route_groups_stub.get_transition_route_group request, 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 - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup} - # in the specified flow. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload create_transition_route_group(request, options = nil) - # Pass arguments to `create_transition_route_group` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_transition_route_group(parent: nil, transition_route_group: nil, language_code: nil) - # Pass arguments to `create_transition_route_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The flow to create an - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup} - # for. Format: - # `projects//locations//agents//flows/` - # or `projects//locations//agents/` - # for agent-level groups. - # @param transition_route_group [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup, ::Hash] - # Required. The transition route group to create. - # @param language_code [::String] - # The language of the following fields in `TransitionRouteGroup`: - # - # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` - # * - # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::TransitionRouteGroup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest.new - # - # # Call the create_transition_route_group method. - # result = client.create_transition_route_group request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. - # p result - # - def create_transition_route_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest - - # Converts hash and nil to an 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_transition_route_group.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_transition_route_group.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_transition_route_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @transition_route_groups_stub.create_transition_route_group request, 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 - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup}. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload update_transition_route_group(request, options = nil) - # Pass arguments to `update_transition_route_group` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_transition_route_group(transition_route_group: nil, update_mask: nil, language_code: nil) - # Pass arguments to `update_transition_route_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param transition_route_group [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup, ::Hash] - # Required. The transition route group to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The mask to control which fields get updated. - # @param language_code [::String] - # The language of the following fields in `TransitionRouteGroup`: - # - # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` - # * - # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/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::CX::V3::TransitionRouteGroup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest.new - # - # # Call the update_transition_route_group method. - # result = client.update_transition_route_group request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. - # p result - # - def update_transition_route_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest - - # Converts hash and nil to an 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_transition_route_group.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_transition_route_group.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_transition_route_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @transition_route_groups_stub.update_transition_route_group request, 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 - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup}. - # - # Note: You should always train a flow prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). - # - # @overload delete_transition_route_group(request, options = nil) - # Pass arguments to `delete_transition_route_group` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_transition_route_group(name: nil, force: nil) - # Pass arguments to `delete_transition_route_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup} - # to delete. Format: - # `projects//locations//agents//flows//transitionRouteGroups/` - # or - # `projects//locations//agents//transitionRouteGroups/`. - # @param force [::Boolean] - # This field has no effect for transition route group that no page is using. - # If the transition route group is referenced by any page: - # - # * If `force` is set to false, an error will be returned with message - # indicating pages that reference the transition route group. - # * If `force` is set to true, Dialogflow will remove the transition route - # group, as well as any reference to it. - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest.new - # - # # Call the delete_transition_route_group method. - # result = client.delete_transition_route_group request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_transition_route_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest - - # Converts hash and nil to an 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_transition_route_group.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_transition_route_group.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_transition_route_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @transition_route_groups_stub.delete_transition_route_group request, 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 TransitionRouteGroups REST API. - # - # This class represents the configuration for TransitionRouteGroups 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::CX::V3::TransitionRouteGroups::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_transition_route_groups to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_transition_route_groups.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_transition_route_groups.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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 TransitionRouteGroups API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_transition_route_groups` - # @return [::Gapic::Config::Method] - # - attr_reader :list_transition_route_groups - ## - # RPC-specific configuration for `get_transition_route_group` - # @return [::Gapic::Config::Method] - # - attr_reader :get_transition_route_group - ## - # RPC-specific configuration for `create_transition_route_group` - # @return [::Gapic::Config::Method] - # - attr_reader :create_transition_route_group - ## - # RPC-specific configuration for `update_transition_route_group` - # @return [::Gapic::Config::Method] - # - attr_reader :update_transition_route_group - ## - # RPC-specific configuration for `delete_transition_route_group` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_transition_route_group - - # @private - def initialize parent_rpcs = nil - list_transition_route_groups_config = parent_rpcs.list_transition_route_groups if parent_rpcs.respond_to? :list_transition_route_groups - @list_transition_route_groups = ::Gapic::Config::Method.new list_transition_route_groups_config - get_transition_route_group_config = parent_rpcs.get_transition_route_group if parent_rpcs.respond_to? :get_transition_route_group - @get_transition_route_group = ::Gapic::Config::Method.new get_transition_route_group_config - create_transition_route_group_config = parent_rpcs.create_transition_route_group if parent_rpcs.respond_to? :create_transition_route_group - @create_transition_route_group = ::Gapic::Config::Method.new create_transition_route_group_config - update_transition_route_group_config = parent_rpcs.update_transition_route_group if parent_rpcs.respond_to? :update_transition_route_group - @update_transition_route_group = ::Gapic::Config::Method.new update_transition_route_group_config - delete_transition_route_group_config = parent_rpcs.delete_transition_route_group if parent_rpcs.respond_to? :delete_transition_route_group - @delete_transition_route_group = ::Gapic::Config::Method.new delete_transition_route_group_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.rb deleted file mode 100644 index d5c2d03617c6..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.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 "google/cloud/dialogflow/cx/v3/transition_route_group_pb" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module TransitionRouteGroups - module Rest - ## - # REST service stub for the TransitionRouteGroups 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_transition_route_groups REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::ListTransitionRouteGroupsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsResponse] - # A result object deserialized from the server's reply - def list_transition_route_groups request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_transition_route_groups_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_transition_route_groups", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsResponse.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_transition_route_group REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::TransitionRouteGroup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] - # A result object deserialized from the server's reply - def get_transition_route_group request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_transition_route_group_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_transition_route_group", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.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_transition_route_group REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::TransitionRouteGroup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] - # A result object deserialized from the server's reply - def create_transition_route_group request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_transition_route_group_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_transition_route_group", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.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_transition_route_group REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::TransitionRouteGroup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] - # A result object deserialized from the server's reply - def update_transition_route_group request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_transition_route_group_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_transition_route_group", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.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_transition_route_group REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_transition_route_group request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_transition_route_group_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_transition_route_group", - 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_transition_route_groups REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest] - # 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_transition_route_groups_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/transitionRouteGroups", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/transitionRouteGroups", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_transition_route_group REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest] - # 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_transition_route_group_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/transitionRouteGroups/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/transitionRouteGroups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_transition_route_group REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest] - # 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_transition_route_group_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/transitionRouteGroups", - body: "transition_route_group", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/transitionRouteGroups", - body: "transition_route_group", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_transition_route_group REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest] - # 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_transition_route_group_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v3/{transition_route_group.name}", - body: "transition_route_group", - matches: [ - ["transition_route_group.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/transitionRouteGroups/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v3/{transition_route_group.name}", - body: "transition_route_group", - matches: [ - ["transition_route_group.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/transitionRouteGroups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_transition_route_group REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest] - # 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_transition_route_group_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/transitionRouteGroups/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/transitionRouteGroups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/validation_message_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/validation_message_pb.rb deleted file mode 100644 index dc1481428aa5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/validation_message_pb.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/validation_message.proto - -require 'google/protobuf' - - -descriptor_data = "\n6google/cloud/dialogflow/cx/v3/validation_message.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\"\x9a\x05\n\x11ValidationMessage\x12T\n\rresource_type\x18\x01 \x01(\x0e\x32=.google.cloud.dialogflow.cx.v3.ValidationMessage.ResourceType\x12\x15\n\tresources\x18\x02 \x03(\tB\x02\x18\x01\x12\x43\n\x0eresource_names\x18\x06 \x03(\x0b\x32+.google.cloud.dialogflow.cx.v3.ResourceName\x12K\n\x08severity\x18\x03 \x01(\x0e\x32\x39.google.cloud.dialogflow.cx.v3.ValidationMessage.Severity\x12\x0e\n\x06\x64\x65tail\x18\x04 \x01(\t\"\xad\x02\n\x0cResourceType\x12\x1d\n\x19RESOURCE_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x41GENT\x10\x01\x12\n\n\x06INTENT\x10\x02\x12\x1a\n\x16INTENT_TRAINING_PHRASE\x10\x08\x12\x14\n\x10INTENT_PARAMETER\x10\t\x12\x0b\n\x07INTENTS\x10\n\x12\x1b\n\x17INTENT_TRAINING_PHRASES\x10\x0b\x12\x0f\n\x0b\x45NTITY_TYPE\x10\x03\x12\x10\n\x0c\x45NTITY_TYPES\x10\x0c\x12\x0b\n\x07WEBHOOK\x10\x04\x12\x08\n\x04\x46LOW\x10\x05\x12\x08\n\x04PAGE\x10\x06\x12\t\n\x05PAGES\x10\r\x12\x1a\n\x16TRANSITION_ROUTE_GROUP\x10\x07\x12 \n\x1c\x41GENT_TRANSITION_ROUTE_GROUP\x10\x0e\"F\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\"2\n\x0cResourceName\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\tB\xb9\x01\n!com.google.cloud.dialogflow.cx.v3B\x16ValidationMessageProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ValidationMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ValidationMessage").msgclass - ValidationMessage::ResourceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ValidationMessage.ResourceType").enummodule - ValidationMessage::Severity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ValidationMessage.Severity").enummodule - ResourceName = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ResourceName").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version.rb deleted file mode 100644 index 951b3510a05f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - VERSION = "0.0.1" - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version_pb.rb deleted file mode 100644 index fd8ea7ef8718..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version_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/cx/v3/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/cloud/dialogflow/cx/v3/flow_pb' -require 'google/longrunning/operations_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/cx/v3/version.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\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/cx/v3/flow.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"Y\n\x1e\x43reateVersionOperationMetadata\x12\x37\n\x07version\x18\x01 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Version\"\xce\x03\n\x07Version\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x45\n\x0cnlu_settings\x18\x04 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.NluSettingsB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12@\n\x05state\x18\x06 \x01(\x0e\x32,.google.cloud.dialogflow.cx.v3.Version.StateB\x03\xe0\x41\x03\"F\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03:~\xea\x41{\n!dialogflow.googleapis.com/Version\x12Vprojects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}\"w\n\x13ListVersionsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Version\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"i\n\x14ListVersionsResponse\x12\x38\n\x08versions\x18\x01 \x03(\x0b\x32&.google.cloud.dialogflow.cx.v3.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\"\x8f\x01\n\x14\x43reateVersionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Version\x12<\n\x07version\x18\x02 \x01(\x0b\x32&.google.cloud.dialogflow.cx.v3.VersionB\x03\xe0\x41\x02\"\x8a\x01\n\x14UpdateVersionRequest\x12<\n\x07version\x18\x01 \x01(\x0b\x32&.google.cloud.dialogflow.cx.v3.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/Version\"u\n\x12LoadVersionRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Version\x12&\n\x1e\x61llow_override_agent_resources\x18\x02 \x01(\x08\"\xb3\x01\n\x16\x43ompareVersionsRequest\x12?\n\x0c\x62\x61se_version\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Version\x12\x41\n\x0etarget_version\x18\x02 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Version\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"\x93\x01\n\x17\x43ompareVersionsResponse\x12!\n\x19\x62\x61se_version_content_json\x18\x01 \x01(\t\x12#\n\x1btarget_version_content_json\x18\x02 \x01(\t\x12\x30\n\x0c\x63ompare_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xe2\x0c\n\x08Versions\x12\xc7\x01\n\x0cListVersions\x12\x32.google.cloud.dialogflow.cx.v3.ListVersionsRequest\x1a\x33.google.cloud.dialogflow.cx.v3.ListVersionsResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v3/{parent=projects/*/locations/*/agents/*/flows/*}/versions\x12\xb4\x01\n\nGetVersion\x12\x30.google.cloud.dialogflow.cx.v3.GetVersionRequest\x1a&.google.cloud.dialogflow.cx.v3.Version\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v3/{name=projects/*/locations/*/agents/*/flows/*/versions/*}\x12\xf1\x01\n\rCreateVersion\x12\x33.google.cloud.dialogflow.cx.v3.CreateVersionRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41)\n\x07Version\x12\x1e\x43reateVersionOperationMetadata\xda\x41\x0eparent,version\x82\xd3\xe4\x93\x02H\"=/v3/{parent=projects/*/locations/*/agents/*/flows/*}/versions:\x07version\x12\xda\x01\n\rUpdateVersion\x12\x33.google.cloud.dialogflow.cx.v3.UpdateVersionRequest\x1a&.google.cloud.dialogflow.cx.v3.Version\"l\xda\x41\x13version,update_mask\x82\xd3\xe4\x93\x02P2E/v3/{version.name=projects/*/locations/*/agents/*/flows/*/versions/*}:\x07version\x12\xaa\x01\n\rDeleteVersion\x12\x33.google.cloud.dialogflow.cx.v3.DeleteVersionRequest\x1a\x16.google.protobuf.Empty\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?*=/v3/{name=projects/*/locations/*/agents/*/flows/*/versions/*}\x12\xe8\x01\n\x0bLoadVersion\x12\x31.google.cloud.dialogflow.cx.v3.LoadVersionRequest\x1a\x1d.google.longrunning.Operation\"\x86\x01\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xda\x41\x04name\x82\xd3\xe4\x93\x02G\"B/v3/{name=projects/*/locations/*/agents/*/flows/*/versions/*}:load:\x01*\x12\xf1\x01\n\x0f\x43ompareVersions\x12\x35.google.cloud.dialogflow.cx.v3.CompareVersionsRequest\x1a\x36.google.cloud.dialogflow.cx.v3.CompareVersionsResponse\"o\xda\x41\x0c\x62\x61se_version\x82\xd3\xe4\x93\x02Z\"U/v3/{base_version=projects/*/locations/*/agents/*/flows/*/versions/*}:compareVersions:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xaf\x01\n!com.google.cloud.dialogflow.cx.v3B\x0cVersionProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.dialogflow.cx.v3.NluSettings", "google/cloud/dialogflow/cx/v3/flow.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - CreateVersionOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata").msgclass - Version = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Version").msgclass - Version::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Version.State").enummodule - ListVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListVersionsRequest").msgclass - ListVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListVersionsResponse").msgclass - GetVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetVersionRequest").msgclass - CreateVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateVersionRequest").msgclass - UpdateVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateVersionRequest").msgclass - DeleteVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteVersionRequest").msgclass - LoadVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.LoadVersionRequest").msgclass - CompareVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CompareVersionsRequest").msgclass - CompareVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CompareVersionsResponse").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version_services_pb.rb deleted file mode 100644 index 74730cd65921..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/version_services_pb.rb +++ /dev/null @@ -1,78 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/cx/v3/version.proto for package 'Google.Cloud.Dialogflow.CX.V3' -# 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/cx/v3/version_pb' - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Versions - # Service for managing [Versions][google.cloud.dialogflow.cx.v3.Version]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.cx.v3.Versions' - - # Returns the list of all versions in the specified - # [Flow][google.cloud.dialogflow.cx.v3.Flow]. - rpc :ListVersions, ::Google::Cloud::Dialogflow::CX::V3::ListVersionsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListVersionsResponse - # Retrieves the specified [Version][google.cloud.dialogflow.cx.v3.Version]. - rpc :GetVersion, ::Google::Cloud::Dialogflow::CX::V3::GetVersionRequest, ::Google::Cloud::Dialogflow::CX::V3::Version - # Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in the specified - # [Flow][google.cloud.dialogflow.cx.v3.Flow]. - # - # 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`: - # [CreateVersionOperationMetadata][google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata] - # - `response`: [Version][google.cloud.dialogflow.cx.v3.Version] - rpc :CreateVersion, ::Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest, ::Google::Longrunning::Operation - # Updates the specified [Version][google.cloud.dialogflow.cx.v3.Version]. - rpc :UpdateVersion, ::Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest, ::Google::Cloud::Dialogflow::CX::V3::Version - # Deletes the specified [Version][google.cloud.dialogflow.cx.v3.Version]. - rpc :DeleteVersion, ::Google::Cloud::Dialogflow::CX::V3::DeleteVersionRequest, ::Google::Protobuf::Empty - # Loads resources in the specified version to the draft flow. - # - # 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`: 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) - rpc :LoadVersion, ::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest, ::Google::Longrunning::Operation - # Compares the specified base version with target version. - rpc :CompareVersions, ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest, ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions.rb deleted file mode 100644 index 7b2e9d01961d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions.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/cx/v3/version" - -require "google/cloud/dialogflow/cx/v3/versions/credentials" -require "google/cloud/dialogflow/cx/v3/versions/paths" -require "google/cloud/dialogflow/cx/v3/versions/operations" -require "google/cloud/dialogflow/cx/v3/versions/client" -require "google/cloud/dialogflow/cx/v3/versions/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Version Versions}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/cx/v3/versions" - # client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/cx/v3/versions/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new - # - module Versions - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "versions", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/versions/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/client.rb deleted file mode 100644 index debccf1b4b1b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/client.rb +++ /dev/null @@ -1,1148 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/version_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Versions - ## - # Client for the Versions service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Versions::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Versions clients - # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] - 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::CX::V3::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::CX::V3::Versions::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::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/cx/v3/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 - - @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 - - @versions_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::CX::V3::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 long-running operations. - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Versions::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 - @versions_stub.logger - end - - # Service calls - - ## - # Returns the list of all versions in the specified - # {::Google::Cloud::Dialogflow::CX::V3::Flow Flow}. - # - # @overload list_versions(request, options = nil) - # Pass arguments to `list_versions` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Flow Flow} to list all - # versions for. Format: - # `projects//locations//agents//flows/`. - # @param page_size [::Integer] - # The maximum number of items to return in a single page. By default 20 and - # at most 100. - # @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::CX::V3::Version>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Version>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-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 {::Google::Cloud::Dialogflow::CX::V3::Version Version}. - # - # @overload get_version(request, options = nil) - # Pass arguments to `get_version` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Version Version}. - # Format: - # `projects//locations//agents//flows//versions/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Version] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Version] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetVersionRequest.new - # - # # Call the get_version method. - # result = client.get_version request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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 a {::Google::Cloud::Dialogflow::CX::V3::Version Version} in the specified - # {::Google::Cloud::Dialogflow::CX::V3::Flow Flow}. - # - # 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::CX::V3::CreateVersionOperationMetadata CreateVersionOperationMetadata} - # - `response`: {::Google::Cloud::Dialogflow::CX::V3::Version Version} - # - # @overload create_version(request, options = nil) - # Pass arguments to `create_version` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Flow Flow} to create an - # {::Google::Cloud::Dialogflow::CX::V3::Version Version} for. Format: - # `projects//locations//agents//flows/`. - # @param version [::Google::Cloud::Dialogflow::CX::V3::Version, ::Hash] - # Required. The version 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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest.new - # - # # Call the create_version method. - # result = client.create_version request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-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| - 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 {::Google::Cloud::Dialogflow::CX::V3::Version Version}. - # - # @overload update_version(request, options = nil) - # Pass arguments to `update_version` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Version, ::Hash] - # Required. The version to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The mask to control which fields get updated. Currently only - # `description` and `display_name` can be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Version] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Version] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest.new - # - # # Call the update_version method. - # result = client.update_version request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-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 - - ## - # Deletes the specified {::Google::Cloud::Dialogflow::CX::V3::Version Version}. - # - # @overload delete_version(request, options = nil) - # Pass arguments to `delete_version` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeleteVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Version Version} - # to delete. Format: - # `projects//locations//agents//flows//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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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 - - ## - # Loads resources in the specified version to the draft flow. - # - # 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`: 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) - # - # @overload load_version(request, options = nil) - # Pass arguments to `load_version` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload load_version(name: nil, allow_override_agent_resources: nil) - # Pass arguments to `load_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 {::Google::Cloud::Dialogflow::CX::V3::Version Version} to be loaded - # to draft flow. Format: - # `projects//locations//agents//flows//versions/`. - # @param allow_override_agent_resources [::Boolean] - # This field is used to prevent accidental overwrite of other agent - # resources, which can potentially impact other flow's behavior. If - # `allow_override_agent_resources` is false, conflicted agent-level resources - # will not be overridden (i.e. intents, entities, webhooks). - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest.new - # - # # Call the load_version method. - # result = client.load_version request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def load_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.load_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.load_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.load_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @versions_stub.call_rpc :load_version, 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 - - ## - # Compares the specified base version with target version. - # - # @overload compare_versions(request, options = nil) - # Pass arguments to `compare_versions` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload compare_versions(base_version: nil, target_version: nil, language_code: nil) - # Pass arguments to `compare_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 base_version [::String] - # Required. Name of the base flow version to compare with the target version. - # Use version ID `0` to indicate the draft version of the specified flow. - # - # Format: - # `projects//locations//agents//flows//versions/`. - # @param target_version [::String] - # Required. Name of the target flow version to compare with the - # base version. Use version ID `0` to indicate the draft version of the - # specified flow. Format: - # `projects//locations//agents//flows//versions/`. - # @param language_code [::String] - # The language to compare the flow versions for. - # - # 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::CX::V3::CompareVersionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest.new - # - # # Call the compare_versions method. - # result = client.compare_versions request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse. - # p result - # - def compare_versions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.compare_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.base_version - header_params["base_version"] = request.base_version - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.compare_versions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.compare_versions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @versions_stub.call_rpc :compare_versions, request, 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::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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. - # * `: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. - # * `: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 - ## - # RPC-specific configuration for `load_version` - # @return [::Gapic::Config::Method] - # - attr_reader :load_version - ## - # RPC-specific configuration for `compare_versions` - # @return [::Gapic::Config::Method] - # - attr_reader :compare_versions - - # @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 - load_version_config = parent_rpcs.load_version if parent_rpcs.respond_to? :load_version - @load_version = ::Gapic::Config::Method.new load_version_config - compare_versions_config = parent_rpcs.compare_versions if parent_rpcs.respond_to? :compare_versions - @compare_versions = ::Gapic::Config::Method.new compare_versions_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/credentials.rb deleted file mode 100644 index fe12b2e33cb5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - 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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb deleted file mode 100644 index 0033943804db..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/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 CX - module V3 - module Versions - # 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 Versions 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 Versions 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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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. - # * `: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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/paths.rb deleted file mode 100644 index 6174fd9b5148..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/paths.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - module Versions - # Path helper methods for the Versions API. - module Paths - ## - # Create a fully-qualified Flow resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param flow [String] - # - # @return [::String] - def flow_path project:, location:, agent:, flow: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}" - end - - ## - # Create a fully-qualified Version resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param flow [String] - # @param version [String] - # - # @return [::String] - def version_path project:, location:, agent:, flow:, version: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/versions/#{version}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest.rb deleted file mode 100644 index d49861d3404b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/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/cx/v3/version" -require "google/cloud/dialogflow/cx/v3/bindings_override" - -require "google/cloud/dialogflow/cx/v3/versions/credentials" -require "google/cloud/dialogflow/cx/v3/versions/paths" -require "google/cloud/dialogflow/cx/v3/versions/rest/operations" -require "google/cloud/dialogflow/cx/v3/versions/rest/client" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Version Versions}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/cx/v3/versions/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new - # - module Versions - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/versions/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb deleted file mode 100644 index 6a92c67db107..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb +++ /dev/null @@ -1,1064 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/version_pb" -require "google/cloud/dialogflow/cx/v3/versions/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Versions - module Rest - ## - # REST client for the Versions service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Versions::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Versions clients - # ::Google::Cloud::Dialogflow::CX::V3::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", "CX", "V3"] - 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::CX::V3::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::CX::V3::Versions::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::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 - - @operations_client = ::Google::Cloud::Dialogflow::CX::V3::Versions::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 - - @versions_stub = ::Google::Cloud::Dialogflow::CX::V3::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 long-running operations. - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Versions::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 - @versions_stub.logger - end - - # Service calls - - ## - # Returns the list of all versions in the specified - # {::Google::Cloud::Dialogflow::CX::V3::Flow Flow}. - # - # @overload list_versions(request, options = nil) - # Pass arguments to `list_versions` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Flow Flow} to list all - # versions for. Format: - # `projects//locations//agents//flows/`. - # @param page_size [::Integer] - # The maximum number of items to return in a single page. By default 20 and - # at most 100. - # @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::CX::V3::Version>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Version>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 {::Google::Cloud::Dialogflow::CX::V3::Version Version}. - # - # @overload get_version(request, options = nil) - # Pass arguments to `get_version` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Version Version}. - # Format: - # `projects//locations//agents//flows//versions/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Version] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Version] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetVersionRequest.new - # - # # Call the get_version method. - # result = client.get_version request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 a {::Google::Cloud::Dialogflow::CX::V3::Version Version} in the specified - # {::Google::Cloud::Dialogflow::CX::V3::Flow Flow}. - # - # 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::CX::V3::CreateVersionOperationMetadata CreateVersionOperationMetadata} - # - `response`: {::Google::Cloud::Dialogflow::CX::V3::Version Version} - # - # @overload create_version(request, options = nil) - # Pass arguments to `create_version` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Flow Flow} to create an - # {::Google::Cloud::Dialogflow::CX::V3::Version Version} for. Format: - # `projects//locations//agents//flows/`. - # @param version [::Google::Cloud::Dialogflow::CX::V3::Version, ::Hash] - # Required. The version 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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest.new - # - # # Call the create_version method. - # result = client.create_version request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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| - 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 {::Google::Cloud::Dialogflow::CX::V3::Version Version}. - # - # @overload update_version(request, options = nil) - # Pass arguments to `update_version` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Version, ::Hash] - # Required. The version to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The mask to control which fields get updated. Currently only - # `description` and `display_name` can be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Version] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Version] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest.new - # - # # Call the update_version method. - # result = client.update_version request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - ## - # Deletes the specified {::Google::Cloud::Dialogflow::CX::V3::Version Version}. - # - # @overload delete_version(request, options = nil) - # Pass arguments to `delete_version` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeleteVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::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 {::Google::Cloud::Dialogflow::CX::V3::Version Version} - # to delete. Format: - # `projects//locations//agents//flows//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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - ## - # Loads resources in the specified version to the draft flow. - # - # 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`: 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) - # - # @overload load_version(request, options = nil) - # Pass arguments to `load_version` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload load_version(name: nil, allow_override_agent_resources: nil) - # Pass arguments to `load_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 {::Google::Cloud::Dialogflow::CX::V3::Version Version} to be loaded - # to draft flow. Format: - # `projects//locations//agents//flows//versions/`. - # @param allow_override_agent_resources [::Boolean] - # This field is used to prevent accidental overwrite of other agent - # resources, which can potentially impact other flow's behavior. If - # `allow_override_agent_resources` is false, conflicted agent-level resources - # will not be overridden (i.e. intents, entities, webhooks). - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest.new - # - # # Call the load_version method. - # result = client.load_version request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def load_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.load_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.load_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.load_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @versions_stub.load_version 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 - - ## - # Compares the specified base version with target version. - # - # @overload compare_versions(request, options = nil) - # Pass arguments to `compare_versions` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload compare_versions(base_version: nil, target_version: nil, language_code: nil) - # Pass arguments to `compare_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 base_version [::String] - # Required. Name of the base flow version to compare with the target version. - # Use version ID `0` to indicate the draft version of the specified flow. - # - # Format: - # `projects//locations//agents//flows//versions/`. - # @param target_version [::String] - # Required. Name of the target flow version to compare with the - # base version. Use version ID `0` to indicate the draft version of the - # specified flow. Format: - # `projects//locations//agents//flows//versions/`. - # @param language_code [::String] - # The language to compare the flow versions for. - # - # 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::CX::V3::CompareVersionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest.new - # - # # Call the compare_versions method. - # result = client.compare_versions request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse. - # p result - # - def compare_versions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.compare_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.compare_versions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.compare_versions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @versions_stub.compare_versions request, 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::CX::V3::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::CX::V3::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::CX::V3::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. - # * `: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. - # * `: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 - ## - # RPC-specific configuration for `load_version` - # @return [::Gapic::Config::Method] - # - attr_reader :load_version - ## - # RPC-specific configuration for `compare_versions` - # @return [::Gapic::Config::Method] - # - attr_reader :compare_versions - - # @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 - load_version_config = parent_rpcs.load_version if parent_rpcs.respond_to? :load_version - @load_version = ::Gapic::Config::Method.new load_version_config - compare_versions_config = parent_rpcs.compare_versions if parent_rpcs.respond_to? :compare_versions - @compare_versions = ::Gapic::Config::Method.new compare_versions_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb deleted file mode 100644 index 797d8af15f52..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/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 CX - module V3 - module Versions - 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 Versions 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 Versions 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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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. - # * `: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: "/v3/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3/{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: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3/{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: "/v3/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v3/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb deleted file mode 100644 index 6ac457736b72..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb +++ /dev/null @@ -1,514 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/version_pb" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - 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::CX::V3::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::CX::V3::ListVersionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::Version] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # 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::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_version REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Version] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 - - ## - # Baseline implementation for the load_version REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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 load_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_load_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: "load_version", - 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 compare_versions REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::CompareVersionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse] - # A result object deserialized from the server's reply - def compare_versions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_compare_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: "compare_versions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse.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::CX::V3::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: "/v3/{parent}/versions", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_version REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_version REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{parent}/versions", - body: "version", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_version REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{version.name}", - body: "version", - matches: [ - ["version.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_version REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::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: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the load_version REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_load_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{name}:load", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the compare_versions REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_compare_versions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{base_version}:compareVersions", - body: "*", - matches: [ - ["base_version", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/flows/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb deleted file mode 100644 index 35fae2f01958..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb +++ /dev/null @@ -1,86 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/cx/v3/webhook.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/cx/v3/response_message_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/struct_pb' - - -descriptor_data = "\n+google/cloud/dialogflow/cx/v3/webhook.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x34google/cloud/dialogflow/cx/v3/response_message.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xdc\x14\n\x07Webhook\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12W\n\x13generic_web_service\x18\x04 \x01(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.Webhook.GenericWebServiceH\x00\x12Z\n\x11service_directory\x18\x07 \x01(\x0b\x32=.google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfigH\x00\x12*\n\x07timeout\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x10\n\x08\x64isabled\x18\x05 \x01(\x08\x1a\x82\x10\n\x11GenericWebService\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x08username\x18\x02 \x01(\tB\x02\x18\x01\x12\x14\n\x08password\x18\x03 \x01(\tB\x02\x18\x01\x12`\n$secret_version_for_username_password\x18\x13 \x01(\tB2\xe0\x41\x01\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x65\n\x0frequest_headers\x18\x04 \x03(\x0b\x32L.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.RequestHeadersEntry\x12\x8f\x01\n#secret_versions_for_request_headers\x18\x14 \x03(\x0b\x32].google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionsForRequestHeadersEntryB\x03\xe0\x41\x01\x12\x1d\n\x10\x61llowed_ca_certs\x18\x05 \x03(\x0c\x42\x03\xe0\x41\x01\x12_\n\x0coauth_config\x18\x0b \x01(\x0b\x32\x44.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfigB\x03\xe0\x41\x01\x12j\n\x12service_agent_auth\x18\x0c \x01(\x0e\x32I.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAgentAuthB\x03\xe0\x41\x01\x12{\n\x1bservice_account_auth_config\x18\x12 \x01(\x0b\x32Q.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfigB\x03\xe0\x41\x01\x12_\n\x0cwebhook_type\x18\x06 \x01(\x0e\x32\x44.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookTypeB\x03\xe0\x41\x01\x12]\n\x0bhttp_method\x18\x07 \x01(\x0e\x32\x43.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethodB\x03\xe0\x41\x01\x12\x19\n\x0crequest_body\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12n\n\x11parameter_mapping\x18\t \x03(\x0b\x32N.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ParameterMappingEntryB\x03\xe0\x41\x01\x1a\x66\n\x18SecretVersionHeaderValue\x12J\n\x0esecret_version\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x1a\xd1\x01\n\x0bOAuthConfig\x12\x16\n\tclient_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rclient_secret\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\\\n secret_version_for_client_secret\x18\x05 \x01(\tB2\xe0\x41\x01\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x1b\n\x0etoken_endpoint\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06scopes\x18\x04 \x03(\tB\x03\xe0\x41\x01\x1a\x38\n\x18ServiceAccountAuthConfig\x12\x1c\n\x0fservice_account\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a\x35\n\x13RequestHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x99\x01\n$SecretVersionsForRequestHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12`\n\x05value\x18\x02 \x01(\x0b\x32Q.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue:\x02\x38\x01\x1a\x37\n\x15ParameterMappingEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"`\n\x10ServiceAgentAuth\x12\"\n\x1eSERVICE_AGENT_AUTH_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x0c\n\x08ID_TOKEN\x10\x02\x12\x10\n\x0c\x41\x43\x43\x45SS_TOKEN\x10\x03\"G\n\x0bWebhookType\x12\x1c\n\x18WEBHOOK_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x0c\n\x08\x46LEXIBLE\x10\x02\"s\n\nHttpMethod\x12\x1b\n\x17HTTP_METHOD_UNSPECIFIED\x10\x00\x12\x08\n\x04POST\x10\x01\x12\x07\n\x03GET\x10\x02\x12\x08\n\x04HEAD\x10\x03\x12\x07\n\x03PUT\x10\x04\x12\n\n\x06\x44\x45LETE\x10\x05\x12\t\n\x05PATCH\x10\x06\x12\x0b\n\x07OPTIONS\x10\x07\x1a\xb1\x01\n\x16ServiceDirectoryConfig\x12@\n\x07service\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\x12U\n\x13generic_web_service\x18\x02 \x01(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService:q\xea\x41n\n!dialogflow.googleapis.com/Webhook\x12Iprojects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}B\t\n\x07webhook\"w\n\x13ListWebhooksRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Webhook\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"i\n\x14ListWebhooksResponse\x12\x38\n\x08webhooks\x18\x01 \x03(\x0b\x32&.google.cloud.dialogflow.cx.v3.Webhook\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x11GetWebhookRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Webhook\"\x8f\x01\n\x14\x43reateWebhookRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Webhook\x12<\n\x07webhook\x18\x02 \x01(\x0b\x32&.google.cloud.dialogflow.cx.v3.WebhookB\x03\xe0\x41\x02\"\x85\x01\n\x14UpdateWebhookRequest\x12<\n\x07webhook\x18\x01 \x01(\x0b\x32&.google.cloud.dialogflow.cx.v3.WebhookB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"^\n\x14\x44\x65leteWebhookRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Webhook\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\"\xc5\n\n\x0eWebhookRequest\x12!\n\x19\x64\x65tect_intent_response_id\x18\x01 \x01(\t\x12\x0e\n\x04text\x18\n \x01(\tH\x00\x12?\n\x0etrigger_intent\x18\x0b \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/IntentH\x00\x12\x14\n\ntranscript\x18\x0c \x01(\tH\x00\x12\x17\n\rtrigger_event\x18\x0e \x01(\tH\x00\x12\x15\n\x0b\x64tmf_digits\x18\x11 \x01(\tH\x00\x12\x15\n\rlanguage_code\x18\x0f \x01(\t\x12W\n\x10\x66ulfillment_info\x18\x06 \x01(\x0b\x32=.google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo\x12M\n\x0bintent_info\x18\x03 \x01(\x0b\x32\x38.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo\x12:\n\tpage_info\x18\x04 \x01(\x0b\x32\'.google.cloud.dialogflow.cx.v3.PageInfo\x12@\n\x0csession_info\x18\x05 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.SessionInfo\x12@\n\x08messages\x18\x07 \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.ResponseMessage\x12(\n\x07payload\x18\x08 \x01(\x0b\x32\x17.google.protobuf.Struct\x12h\n\x19sentiment_analysis_result\x18\t \x01(\x0b\x32\x45.google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult\x12\x42\n\rlanguage_info\x18\x12 \x01(\x0b\x32+.google.cloud.dialogflow.cx.v3.LanguageInfo\x1a\x1e\n\x0f\x46ulfillmentInfo\x12\x0b\n\x03tag\x18\x01 \x01(\t\x1a\xbb\x03\n\nIntentInfo\x12\x42\n\x13last_matched_intent\x18\x01 \x01(\tB%\xfa\x41\"\n dialogflow.googleapis.com/Intent\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\\\n\nparameters\x18\x02 \x03(\x0b\x32H.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.ParametersEntry\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x1a^\n\x14IntentParameterValue\x12\x16\n\x0eoriginal_value\x18\x01 \x01(\t\x12.\n\x0eresolved_value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value\x1a\x80\x01\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\\\n\x05value\x18\x02 \x01(\x0b\x32M.google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue:\x02\x38\x01\x1a;\n\x17SentimentAnalysisResult\x12\r\n\x05score\x18\x01 \x01(\x02\x12\x11\n\tmagnitude\x18\x02 \x01(\x02\x42\x07\n\x05query\"\xaf\x05\n\x0fWebhookResponse\x12`\n\x14\x66ulfillment_response\x18\x01 \x01(\x0b\x32\x42.google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse\x12:\n\tpage_info\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.cx.v3.PageInfo\x12@\n\x0csession_info\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.cx.v3.SessionInfo\x12(\n\x07payload\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12:\n\x0btarget_page\x18\x05 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/PageH\x00\x12:\n\x0btarget_flow\x18\x06 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/FlowH\x00\x1a\x8b\x02\n\x13\x46ulfillmentResponse\x12@\n\x08messages\x18\x01 \x03(\x0b\x32..google.cloud.dialogflow.cx.v3.ResponseMessage\x12h\n\x0emerge_behavior\x18\x02 \x01(\x0e\x32P.google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.MergeBehavior\"H\n\rMergeBehavior\x12\x1e\n\x1aMERGE_BEHAVIOR_UNSPECIFIED\x10\x00\x12\n\n\x06\x41PPEND\x10\x01\x12\x0b\n\x07REPLACE\x10\x02\x42\x0c\n\ntransition\"\xb3\x04\n\x08PageInfo\x12\x39\n\x0c\x63urrent_page\x18\x01 \x01(\tB#\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Page\x12\x14\n\x0c\x64isplay_name\x18\x04 \x01(\t\x12\x43\n\tform_info\x18\x03 \x01(\x0b\x32\x30.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo\x1a\x90\x03\n\x08\x46ormInfo\x12V\n\x0eparameter_info\x18\x02 \x03(\x0b\x32>.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo\x1a\xab\x02\n\rParameterInfo\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x10\n\x08required\x18\x02 \x01(\x08\x12\\\n\x05state\x18\x03 \x01(\x0e\x32M.google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.ParameterState\x12%\n\x05value\x18\x04 \x01(\x0b\x32\x16.google.protobuf.Value\x12\x16\n\x0ejust_collected\x18\x05 \x01(\x08\"U\n\x0eParameterState\x12\x1f\n\x1bPARAMETER_STATE_UNSPECIFIED\x10\x00\x12\t\n\x05\x45MPTY\x10\x01\x12\x0b\n\x07INVALID\x10\x02\x12\n\n\x06\x46ILLED\x10\x03\"\xe1\x01\n\x0bSessionInfo\x12\x37\n\x07session\x18\x01 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Session\x12N\n\nparameters\x18\x02 \x03(\x0b\x32:.google.cloud.dialogflow.cx.v3.SessionInfo.ParametersEntry\x1aI\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"e\n\x0cLanguageInfo\x12\x1b\n\x13input_language_code\x18\x01 \x01(\t\x12\x1e\n\x16resolved_language_code\x18\x02 \x01(\t\x12\x18\n\x10\x63onfidence_score\x18\x03 \x01(\x02\x32\xb7\x08\n\x08Webhooks\x12\xbf\x01\n\x0cListWebhooks\x12\x32.google.cloud.dialogflow.cx.v3.ListWebhooksRequest\x1a\x33.google.cloud.dialogflow.cx.v3.ListWebhooksResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v3/{parent=projects/*/locations/*/agents/*}/webhooks\x12\xac\x01\n\nGetWebhook\x12\x30.google.cloud.dialogflow.cx.v3.GetWebhookRequest\x1a&.google.cloud.dialogflow.cx.v3.Webhook\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v3/{name=projects/*/locations/*/agents/*/webhooks/*}\x12\xc5\x01\n\rCreateWebhook\x12\x33.google.cloud.dialogflow.cx.v3.CreateWebhookRequest\x1a&.google.cloud.dialogflow.cx.v3.Webhook\"W\xda\x41\x0eparent,webhook\x82\xd3\xe4\x93\x02@\"5/v3/{parent=projects/*/locations/*/agents/*}/webhooks:\x07webhook\x12\xd2\x01\n\rUpdateWebhook\x12\x33.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest\x1a&.google.cloud.dialogflow.cx.v3.Webhook\"d\xda\x41\x13webhook,update_mask\x82\xd3\xe4\x93\x02H2=/v3/{webhook.name=projects/*/locations/*/agents/*/webhooks/*}:\x07webhook\x12\xa2\x01\n\rDeleteWebhook\x12\x33.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest\x1a\x16.google.protobuf.Empty\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37*5/v3/{name=projects/*/locations/*/agents/*/webhooks/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xae\x02\n!com.google.cloud.dialogflow.cx.v3B\x0cWebhookProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3\xea\x41|\n\'servicedirectory.googleapis.com/Service\x12Qprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.cloud.dialogflow.cx.v3.ResponseMessage", "google/cloud/dialogflow/cx/v3/response_message.proto"], - ["google.protobuf.Struct", "google/protobuf/struct.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dialogflow - module CX - module V3 - Webhook = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook").msgclass - Webhook::GenericWebService = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService").msgclass - Webhook::GenericWebService::SecretVersionHeaderValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.SecretVersionHeaderValue").msgclass - Webhook::GenericWebService::OAuthConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.OAuthConfig").msgclass - Webhook::GenericWebService::ServiceAccountAuthConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAccountAuthConfig").msgclass - Webhook::GenericWebService::ServiceAgentAuth = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.ServiceAgentAuth").enummodule - Webhook::GenericWebService::WebhookType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookType").enummodule - Webhook::GenericWebService::HttpMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethod").enummodule - Webhook::ServiceDirectoryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig").msgclass - ListWebhooksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListWebhooksRequest").msgclass - ListWebhooksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListWebhooksResponse").msgclass - GetWebhookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetWebhookRequest").msgclass - CreateWebhookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateWebhookRequest").msgclass - UpdateWebhookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateWebhookRequest").msgclass - DeleteWebhookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteWebhookRequest").msgclass - WebhookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookRequest").msgclass - WebhookRequest::FulfillmentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo").msgclass - WebhookRequest::IntentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo").msgclass - WebhookRequest::IntentInfo::IntentParameterValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue").msgclass - WebhookRequest::SentimentAnalysisResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult").msgclass - WebhookResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookResponse").msgclass - WebhookResponse::FulfillmentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse").msgclass - WebhookResponse::FulfillmentResponse::MergeBehavior = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.MergeBehavior").enummodule - PageInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.PageInfo").msgclass - PageInfo::FormInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.PageInfo.FormInfo").msgclass - PageInfo::FormInfo::ParameterInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo").msgclass - PageInfo::FormInfo::ParameterInfo::ParameterState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.ParameterState").enummodule - SessionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SessionInfo").msgclass - LanguageInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.LanguageInfo").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhook_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhook_services_pb.rb deleted file mode 100644 index 6a53482d5b5f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhook_services_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/cx/v3/webhook.proto for package 'Google.Cloud.Dialogflow.CX.V3' -# 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/cx/v3/webhook_pb' - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Webhooks - # Service for managing [Webhooks][google.cloud.dialogflow.cx.v3.Webhook]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.cx.v3.Webhooks' - - # Returns the list of all webhooks in the specified agent. - rpc :ListWebhooks, ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest, ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksResponse - # Retrieves the specified webhook. - rpc :GetWebhook, ::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest, ::Google::Cloud::Dialogflow::CX::V3::Webhook - # Creates a webhook in the specified agent. - rpc :CreateWebhook, ::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest, ::Google::Cloud::Dialogflow::CX::V3::Webhook - # Updates the specified webhook. - rpc :UpdateWebhook, ::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest, ::Google::Cloud::Dialogflow::CX::V3::Webhook - # Deletes the specified webhook. - rpc :DeleteWebhook, ::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest, ::Google::Protobuf::Empty - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks.rb deleted file mode 100644 index aca8a2761d2c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks.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/cx/v3/version" - -require "google/cloud/dialogflow/cx/v3/webhooks/credentials" -require "google/cloud/dialogflow/cx/v3/webhooks/paths" -require "google/cloud/dialogflow/cx/v3/webhooks/client" -require "google/cloud/dialogflow/cx/v3/webhooks/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Webhook Webhooks}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/cx/v3/webhooks" - # client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/cx/v3/webhooks/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new - # - module Webhooks - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "webhooks", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/webhooks/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb deleted file mode 100644 index 3e1f707d7311..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb +++ /dev/null @@ -1,898 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/webhook_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Webhooks - ## - # Client for the Webhooks service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Webhook Webhooks}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :webhooks_stub - - ## - # Configure the Webhooks Client class. - # - # See {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Webhooks clients - # ::Google::Cloud::Dialogflow::CX::V3::Webhooks::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", "CX", "V3"] - 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 Webhooks 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::CX::V3::Webhooks::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 - @webhooks_stub.universe_domain - end - - ## - # Create a new Webhooks client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Webhooks 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/cx/v3/webhook_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 - - @webhooks_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::CX::V3::Webhooks::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 - ) - - @webhooks_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 = @webhooks_stub.endpoint - config.universe_domain = @webhooks_stub.universe_domain - config.logger = @webhooks_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 - @webhooks_stub.logger - end - - # Service calls - - ## - # Returns the list of all webhooks in the specified agent. - # - # @overload list_webhooks(request, options = nil) - # Pass arguments to `list_webhooks` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_webhooks(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_webhooks` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 webhooks for. - # Format: `projects//locations//agents/`. - # @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::CX::V3::Webhook>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Webhook>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest.new - # - # # Call the list_webhooks method. - # result = client.list_webhooks request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Webhook. - # p item - # end - # - def list_webhooks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest - - # Converts hash and nil to 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_webhooks.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_webhooks.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_webhooks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @webhooks_stub.call_rpc :list_webhooks, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @webhooks_stub, :list_webhooks, 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 webhook. - # - # @overload get_webhook(request, options = nil) - # Pass arguments to `get_webhook` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_webhook(name: nil) - # Pass arguments to `get_webhook` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 webhook. - # Format: - # `projects//locations//agents//webhooks/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Webhook] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest.new - # - # # Call the get_webhook method. - # result = client.get_webhook request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. - # p result - # - def get_webhook request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest - - # Converts hash and nil to 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_webhook.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_webhook.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_webhook.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @webhooks_stub.call_rpc :get_webhook, request, 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 webhook in the specified agent. - # - # @overload create_webhook(request, options = nil) - # Pass arguments to `create_webhook` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_webhook(parent: nil, webhook: nil) - # Pass arguments to `create_webhook` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 webhook for. - # Format: `projects//locations//agents/`. - # @param webhook [::Google::Cloud::Dialogflow::CX::V3::Webhook, ::Hash] - # Required. The webhook to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Webhook] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest.new - # - # # Call the create_webhook method. - # result = client.create_webhook request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. - # p result - # - def create_webhook request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest - - # Converts hash and nil to 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_webhook.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-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_webhook.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_webhook.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @webhooks_stub.call_rpc :create_webhook, request, 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 webhook. - # - # @overload update_webhook(request, options = nil) - # Pass arguments to `update_webhook` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_webhook(webhook: nil, update_mask: nil) - # Pass arguments to `update_webhook` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param webhook [::Google::Cloud::Dialogflow::CX::V3::Webhook, ::Hash] - # Required. The webhook to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # 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::CX::V3::Webhook] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest.new - # - # # Call the update_webhook method. - # result = client.update_webhook request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. - # p result - # - def update_webhook request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest - - # Converts hash and nil to 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_webhook.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.webhook&.name - header_params["webhook.name"] = request.webhook.name - end - - request_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_webhook.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_webhook.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @webhooks_stub.call_rpc :update_webhook, request, 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 webhook. - # - # @overload delete_webhook(request, options = nil) - # Pass arguments to `delete_webhook` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_webhook(name: nil, force: nil) - # Pass arguments to `delete_webhook` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 webhook to delete. - # Format: - # `projects//locations//agents//webhooks/`. - # @param force [::Boolean] - # This field has no effect for webhook not being used. - # For webhooks that are used by pages/flows/transition route groups: - # - # * If `force` is set to false, an error will be returned with message - # indicating the referenced resources. - # * If `force` is set to true, Dialogflow will remove the webhook, as well - # as any references to the webhook (i.e. - # {::Google::Cloud::Dialogflow::CX::V3::Fulfillment#webhook Webhook} and - # {::Google::Cloud::Dialogflow::CX::V3::Fulfillment#tag tag}in fulfillments that - # point to this webhook will be removed). - # - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest.new - # - # # Call the delete_webhook method. - # result = client.delete_webhook request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_webhook request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest - - # Converts hash and nil to 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_webhook.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_webhook.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_webhook.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @webhooks_stub.call_rpc :delete_webhook, request, 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 Webhooks API. - # - # This class represents the configuration for Webhooks, - # 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::CX::V3::Webhooks::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_webhooks to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_webhooks.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_webhooks.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::CX::V3::Webhooks::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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 Webhooks API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_webhooks` - # @return [::Gapic::Config::Method] - # - attr_reader :list_webhooks - ## - # RPC-specific configuration for `get_webhook` - # @return [::Gapic::Config::Method] - # - attr_reader :get_webhook - ## - # RPC-specific configuration for `create_webhook` - # @return [::Gapic::Config::Method] - # - attr_reader :create_webhook - ## - # RPC-specific configuration for `update_webhook` - # @return [::Gapic::Config::Method] - # - attr_reader :update_webhook - ## - # RPC-specific configuration for `delete_webhook` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_webhook - - # @private - def initialize parent_rpcs = nil - list_webhooks_config = parent_rpcs.list_webhooks if parent_rpcs.respond_to? :list_webhooks - @list_webhooks = ::Gapic::Config::Method.new list_webhooks_config - get_webhook_config = parent_rpcs.get_webhook if parent_rpcs.respond_to? :get_webhook - @get_webhook = ::Gapic::Config::Method.new get_webhook_config - create_webhook_config = parent_rpcs.create_webhook if parent_rpcs.respond_to? :create_webhook - @create_webhook = ::Gapic::Config::Method.new create_webhook_config - update_webhook_config = parent_rpcs.update_webhook if parent_rpcs.respond_to? :update_webhook - @update_webhook = ::Gapic::Config::Method.new update_webhook_config - delete_webhook_config = parent_rpcs.delete_webhook if parent_rpcs.respond_to? :delete_webhook - @delete_webhook = ::Gapic::Config::Method.new delete_webhook_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-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/credentials.rb deleted file mode 100644 index 9ba0648cb130..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Webhooks - # Credentials for the Webhooks 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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/paths.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/paths.rb deleted file mode 100644 index 8e904748dc48..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/paths.rb +++ /dev/null @@ -1,115 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - module Webhooks - # Path helper methods for the Webhooks API. - module Paths - ## - # Create a fully-qualified Agent resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # - # @return [::String] - def agent_path project:, location:, agent: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}" - 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 Webhook resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}` - # - # @param project [String] - # @param location [String] - # @param agent [String] - # @param webhook [String] - # - # @return [::String] - def webhook_path project:, location:, agent:, webhook: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agents/#{agent}/webhooks/#{webhook}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest.rb deleted file mode 100644 index c1ade6e1bbe3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/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/cx/v3/version" -require "google/cloud/dialogflow/cx/v3/bindings_override" - -require "google/cloud/dialogflow/cx/v3/webhooks/credentials" -require "google/cloud/dialogflow/cx/v3/webhooks/paths" -require "google/cloud/dialogflow/cx/v3/webhooks/rest/client" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - ## - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Webhook Webhooks}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/cx/v3/webhooks/rest" - # client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new - # - module Webhooks - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/cx/v3/webhooks/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb deleted file mode 100644 index b4a9046c10db..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb +++ /dev/null @@ -1,828 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/webhook_pb" -require "google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Webhooks - module Rest - ## - # REST client for the Webhooks service. - # - # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Webhook Webhooks}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :webhooks_stub - - ## - # Configure the Webhooks Client class. - # - # See {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Webhooks clients - # ::Google::Cloud::Dialogflow::CX::V3::Webhooks::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", "CX", "V3"] - 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 Webhooks 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::CX::V3::Webhooks::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 - @webhooks_stub.universe_domain - end - - ## - # Create a new Webhooks REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Webhooks 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 - - @webhooks_stub = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @webhooks_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 = @webhooks_stub.endpoint - config.universe_domain = @webhooks_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @webhooks_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 - @webhooks_stub.logger - end - - # Service calls - - ## - # Returns the list of all webhooks in the specified agent. - # - # @overload list_webhooks(request, options = nil) - # Pass arguments to `list_webhooks` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_webhooks(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_webhooks` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 webhooks for. - # Format: `projects//locations//agents/`. - # @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::CX::V3::Webhook>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Webhook>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest.new - # - # # Call the list_webhooks method. - # result = client.list_webhooks request - # - # # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Webhook. - # p item - # end - # - def list_webhooks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest - - # Converts hash and nil to an 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_webhooks.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_webhooks.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_webhooks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @webhooks_stub.list_webhooks request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @webhooks_stub, :list_webhooks, "webhooks", 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 webhook. - # - # @overload get_webhook(request, options = nil) - # Pass arguments to `get_webhook` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_webhook(name: nil) - # Pass arguments to `get_webhook` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 webhook. - # Format: - # `projects//locations//agents//webhooks/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Webhook] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest.new - # - # # Call the get_webhook method. - # result = client.get_webhook request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. - # p result - # - def get_webhook request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest - - # Converts hash and nil to an 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_webhook.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_webhook.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_webhook.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @webhooks_stub.get_webhook request, 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 webhook in the specified agent. - # - # @overload create_webhook(request, options = nil) - # Pass arguments to `create_webhook` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_webhook(parent: nil, webhook: nil) - # Pass arguments to `create_webhook` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 webhook for. - # Format: `projects//locations//agents/`. - # @param webhook [::Google::Cloud::Dialogflow::CX::V3::Webhook, ::Hash] - # Required. The webhook to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Webhook] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest.new - # - # # Call the create_webhook method. - # result = client.create_webhook request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. - # p result - # - def create_webhook request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest - - # Converts hash and nil to an 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_webhook.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_webhook.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_webhook.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @webhooks_stub.create_webhook request, 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 webhook. - # - # @overload update_webhook(request, options = nil) - # Pass arguments to `update_webhook` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_webhook(webhook: nil, update_mask: nil) - # Pass arguments to `update_webhook` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param webhook [::Google::Cloud::Dialogflow::CX::V3::Webhook, ::Hash] - # Required. The webhook to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # 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::CX::V3::Webhook] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest.new - # - # # Call the update_webhook method. - # result = client.update_webhook request - # - # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. - # p result - # - def update_webhook request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest - - # Converts hash and nil to an 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_webhook.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_webhook.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_webhook.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @webhooks_stub.update_webhook request, 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 webhook. - # - # @overload delete_webhook(request, options = nil) - # Pass arguments to `delete_webhook` via a request object, either of type - # {::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_webhook(name: nil, force: nil) - # Pass arguments to `delete_webhook` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 webhook to delete. - # Format: - # `projects//locations//agents//webhooks/`. - # @param force [::Boolean] - # This field has no effect for webhook not being used. - # For webhooks that are used by pages/flows/transition route groups: - # - # * If `force` is set to false, an error will be returned with message - # indicating the referenced resources. - # * If `force` is set to true, Dialogflow will remove the webhook, as well - # as any references to the webhook (i.e. - # {::Google::Cloud::Dialogflow::CX::V3::Fulfillment#webhook Webhook} and - # {::Google::Cloud::Dialogflow::CX::V3::Fulfillment#tag tag}in fulfillments that - # point to this webhook will be removed). - # @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/cx/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest.new - # - # # Call the delete_webhook method. - # result = client.delete_webhook request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_webhook request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest - - # Converts hash and nil to an 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_webhook.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_webhook.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_webhook.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @webhooks_stub.delete_webhook request, 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 Webhooks REST API. - # - # This class represents the configuration for Webhooks 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::CX::V3::Webhooks::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_webhooks to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_webhooks.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_webhooks.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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 Webhooks API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_webhooks` - # @return [::Gapic::Config::Method] - # - attr_reader :list_webhooks - ## - # RPC-specific configuration for `get_webhook` - # @return [::Gapic::Config::Method] - # - attr_reader :get_webhook - ## - # RPC-specific configuration for `create_webhook` - # @return [::Gapic::Config::Method] - # - attr_reader :create_webhook - ## - # RPC-specific configuration for `update_webhook` - # @return [::Gapic::Config::Method] - # - attr_reader :update_webhook - ## - # RPC-specific configuration for `delete_webhook` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_webhook - - # @private - def initialize parent_rpcs = nil - list_webhooks_config = parent_rpcs.list_webhooks if parent_rpcs.respond_to? :list_webhooks - @list_webhooks = ::Gapic::Config::Method.new list_webhooks_config - get_webhook_config = parent_rpcs.get_webhook if parent_rpcs.respond_to? :get_webhook - @get_webhook = ::Gapic::Config::Method.new get_webhook_config - create_webhook_config = parent_rpcs.create_webhook if parent_rpcs.respond_to? :create_webhook - @create_webhook = ::Gapic::Config::Method.new create_webhook_config - update_webhook_config = parent_rpcs.update_webhook if parent_rpcs.respond_to? :update_webhook - @update_webhook = ::Gapic::Config::Method.new update_webhook_config - delete_webhook_config = parent_rpcs.delete_webhook if parent_rpcs.respond_to? :delete_webhook - @delete_webhook = ::Gapic::Config::Method.new delete_webhook_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb deleted file mode 100644 index 7d97096d31e7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb +++ /dev/null @@ -1,390 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/cx/v3/webhook_pb" - -module Google - module Cloud - module Dialogflow - module CX - module V3 - module Webhooks - module Rest - ## - # REST service stub for the Webhooks 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_webhooks REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::ListWebhooksResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::ListWebhooksResponse] - # A result object deserialized from the server's reply - def list_webhooks request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_webhooks_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_webhooks", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksResponse.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_webhook REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::Webhook] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] - # A result object deserialized from the server's reply - def get_webhook request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_webhook_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_webhook", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::Webhook.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_webhook REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::Webhook] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] - # A result object deserialized from the server's reply - def create_webhook request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_webhook_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_webhook", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::Webhook.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_webhook REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::CX::V3::Webhook] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] - # A result object deserialized from the server's reply - def update_webhook request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_webhook_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_webhook", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::CX::V3::Webhook.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_webhook REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_webhook request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_webhook_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_webhook", - 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_webhooks REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest] - # 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_webhooks_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/webhooks", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_webhook REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest] - # 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_webhook_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/webhooks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_webhook REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest] - # 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_webhook_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/webhooks", - body: "webhook", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_webhook REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest] - # 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_webhook_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v3/{webhook.name}", - body: "webhook", - matches: [ - ["webhook.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/webhooks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_webhook REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest] - # 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_webhook_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/webhooks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/README.md b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/README.md deleted file mode 100644 index ac2a0a64738f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Dialogflow CX V3 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-cx-v3/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/advanced_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/advanced_settings.rb deleted file mode 100644 index 96938318f939..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/advanced_settings.rb +++ /dev/null @@ -1,150 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - # Hierarchical advanced settings for agent/flow/page/fulfillment/parameter. - # Settings exposed at lower level overrides the settings exposed at higher - # level. Overriding occurs at the sub-setting level. For example, the - # playback_interruption_settings at fulfillment level only overrides the - # playback_interruption_settings at the agent level, leaving other settings - # at the agent level unchanged. - # - # DTMF settings does not override each other. DTMF settings set at different - # levels define DTMF detections running in parallel. - # - # Hierarchy: Agent->Flow->Page->Fulfillment/Parameter. - # @!attribute [rw] audio_export_gcs_destination - # @return [::Google::Cloud::Dialogflow::CX::V3::GcsDestination] - # If present, incoming audio is exported by Dialogflow to the configured - # Google Cloud Storage destination. - # Exposed at the following levels: - # - Agent level - # - Flow level - # @!attribute [rw] speech_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::AdvancedSettings::SpeechSettings] - # Settings for speech to text detection. - # Exposed at the following levels: - # - Agent level - # - Flow level - # - Page level - # - Parameter level - # @!attribute [rw] dtmf_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::AdvancedSettings::DtmfSettings] - # Settings for DTMF. - # Exposed at the following levels: - # - Agent level - # - Flow level - # - Page level - # - Parameter level. - # @!attribute [rw] logging_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::AdvancedSettings::LoggingSettings] - # Settings for logging. - # Settings for Dialogflow History, Contact Center messages, StackDriver logs, - # and speech logging. - # Exposed at the following levels: - # - Agent level. - class AdvancedSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Define behaviors of speech to text detection. - # @!attribute [rw] endpointer_sensitivity - # @return [::Integer] - # Sensitivity of the speech model that detects the end of speech. - # Scale from 0 to 100. - # @!attribute [rw] no_speech_timeout - # @return [::Google::Protobuf::Duration] - # Timeout before detecting no speech. - # @!attribute [rw] use_timeout_based_endpointing - # @return [::Boolean] - # Use timeout based endpointing, interpreting endpointer sensitivity as - # seconds of timeout value. - # @!attribute [rw] models - # @return [::Google::Protobuf::Map{::String => ::String}] - # Mapping from language to Speech-to-Text model. The mapped Speech-to-Text - # model will be selected for requests from its corresponding language. - # For more information, see - # [Speech - # models](https://cloud.google.com/dialogflow/cx/docs/concept/speech-models). - class SpeechSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ModelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Define behaviors for DTMF (dual tone multi frequency). - # @!attribute [rw] enabled - # @return [::Boolean] - # If true, incoming audio is processed for DTMF (dual tone multi frequency) - # events. For example, if the caller presses a button on their telephone - # keypad and DTMF processing is enabled, Dialogflow will detect the - # event (e.g. a "3" was pressed) in the incoming audio and pass the event - # to the bot to drive business logic (e.g. when 3 is pressed, return the - # account balance). - # @!attribute [rw] max_digits - # @return [::Integer] - # Max length of DTMF digits. - # @!attribute [rw] finish_digit - # @return [::String] - # The digit that terminates a DTMF digit sequence. - # @!attribute [rw] interdigit_timeout_duration - # @return [::Google::Protobuf::Duration] - # Interdigit timeout setting for matching dtmf input to regex. - # @!attribute [rw] endpointing_timeout_duration - # @return [::Google::Protobuf::Duration] - # Endpoint timeout setting for matching dtmf input to regex. - class DtmfSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Define behaviors on logging. - # @!attribute [rw] enable_stackdriver_logging - # @return [::Boolean] - # Enables Google Cloud Logging. - # @!attribute [rw] enable_interaction_logging - # @return [::Boolean] - # Enables DF Interaction logging. - # @!attribute [rw] enable_consent_based_redaction - # @return [::Boolean] - # Enables consent-based end-user input redaction, if true, a pre-defined - # session parameter `$session.params.conversation-redaction` will be - # used to determine if the utterance should be redacted. - class LoggingSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb deleted file mode 100644 index 57abb8222a12..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb +++ /dev/null @@ -1,576 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - # Settings related to speech recognition. - # @!attribute [rw] enable_speech_adaptation - # @return [::Boolean] - # Whether to use speech adaptation for speech recognition. - class SpeechToTextSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Agents are best described as Natural Language Understanding (NLU) modules - # that transform user requests into actionable data. You can include agents - # in your app, product, or service to determine user intent and respond to the - # user in a natural way. - # - # After you create an agent, you can add - # {::Google::Cloud::Dialogflow::CX::V3::Intent Intents}, [Entity - # Types][google.cloud.dialogflow.cx.v3.EntityType], - # {::Google::Cloud::Dialogflow::CX::V3::Flow Flows}, - # {::Google::Cloud::Dialogflow::CX::V3::Fulfillment Fulfillments}, - # {::Google::Cloud::Dialogflow::CX::V3::Webhook Webhooks}, - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroups} - # and so on to manage the conversation flows. - # @!attribute [rw] name - # @return [::String] - # The unique identifier of the agent. - # Required for the - # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#update_agent Agents.UpdateAgent} - # method. - # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#create_agent Agents.CreateAgent} - # populates the name automatically. - # Format: `projects//locations//agents/`. - # @!attribute [rw] display_name - # @return [::String] - # Required. The human-readable name of the agent, unique within the location. - # @!attribute [rw] default_language_code - # @return [::String] - # Required. Immutable. The default language of the agent as a language tag. - # See [Language - # Support](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # for a list of the currently supported language codes. - # This field cannot be set by the - # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#update_agent Agents.UpdateAgent} - # method. - # @!attribute [rw] supported_language_codes - # @return [::Array<::String>] - # The list of all languages supported by the agent (except for the - # `default_language_code`). - # @!attribute [rw] time_zone - # @return [::String] - # Required. The time zone of the agent from the [time zone - # database](https://www.iana.org/time-zones), e.g., America/New_York, - # Europe/Paris. - # @!attribute [rw] description - # @return [::String] - # The description of the agent. The maximum length is 500 characters. If - # exceeded, the request is rejected. - # @!attribute [rw] avatar_uri - # @return [::String] - # 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] speech_to_text_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::SpeechToTextSettings] - # Speech recognition related settings. - # @!attribute [rw] start_flow - # @return [::String] - # Name of the start flow in this agent. A start flow will be automatically - # created when the agent is created, and can only be deleted by deleting - # the agent. - # Format: - # `projects//locations//agents//flows/`. - # Currently only the default start flow with id - # "00000000-0000-0000-0000-000000000000" is allowed. - # - # Note: The following fields are mutually exclusive: `start_flow`, `start_playbook`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] start_playbook - # @return [::String] - # Name of the start playbook in this agent. A start playbook will be - # automatically created when the agent is created, and can only be deleted - # by deleting the agent. - # Format: - # `projects//locations//agents//playbooks/`. - # Currently only the - # default playbook with id - # "00000000-0000-0000-0000-000000000000" is allowed. - # - # Note: The following fields are mutually exclusive: `start_playbook`, `start_flow`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] security_settings - # @return [::String] - # Name of the - # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings} - # reference for the agent. Format: - # `projects//locations//securitySettings/`. - # @!attribute [rw] enable_stackdriver_logging - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # Indicates if stackdriver logging is enabled for the agent. - # Please use - # {::Google::Cloud::Dialogflow::CX::V3::AdvancedSettings::LoggingSettings agent.advanced_settings} - # instead. - # @!attribute [rw] enable_spell_correction - # @return [::Boolean] - # Indicates if automatic spell correction is enabled in detect intent - # requests. - # @!attribute [rw] enable_multi_language_training - # @return [::Boolean] - # Optional. Enable training multi-lingual models for this agent. These models - # will be trained on all the languages supported by the agent. - # @!attribute [rw] locked - # @return [::Boolean] - # Indicates whether the agent is locked for changes. If the agent is locked, - # modifications to the agent will be rejected except for [RestoreAgent][]. - # @!attribute [rw] advanced_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::AdvancedSettings] - # Hierarchical advanced settings for this agent. The settings exposed at the - # lower level overrides the settings exposed at the higher level. - # @!attribute [rw] git_integration_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::Agent::GitIntegrationSettings] - # Git integration settings for this agent. - # @!attribute [rw] text_to_speech_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::TextToSpeechSettings] - # Settings on instructing the speech synthesizer on how to generate the - # output audio content. - # @!attribute [rw] gen_app_builder_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::Agent::GenAppBuilderSettings] - # Gen App Builder-related agent-level settings. - # @!attribute [rw] answer_feedback_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::Agent::AnswerFeedbackSettings] - # Optional. Answer feedback collection settings. - # @!attribute [rw] personalization_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::Agent::PersonalizationSettings] - # Optional. Settings for end user personalization. - # @!attribute [rw] client_certificate_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::Agent::ClientCertificateSettings] - # Optional. Settings for custom client certificates. - # @!attribute [r] satisfies_pzs - # @return [::Boolean] - # Optional. Output only. A read only boolean field reflecting Zone Separation - # status of the agent. - # @!attribute [r] satisfies_pzi - # @return [::Boolean] - # Optional. Output only. A read only boolean field reflecting Zone Isolation - # status of the agent. - class Agent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Settings for connecting to Git repository for an agent. - # @!attribute [rw] github_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::Agent::GitIntegrationSettings::GithubSettings] - # GitHub settings. - class GitIntegrationSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Settings of integration with GitHub. - # @!attribute [rw] display_name - # @return [::String] - # The unique repository display name for the GitHub repository. - # @!attribute [rw] repository_uri - # @return [::String] - # The GitHub repository URI related to the agent. - # @!attribute [rw] tracking_branch - # @return [::String] - # The branch of the GitHub repository tracked for this agent. - # @!attribute [rw] access_token - # @return [::String] - # The access token used to authenticate the access to the GitHub - # repository. - # @!attribute [rw] branches - # @return [::Array<::String>] - # A list of branches configured to be used from Dialogflow. - class GithubSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Gen App Builder. - # @!attribute [rw] engine - # @return [::String] - # Required. The full name of the Gen App Builder engine related to this - # agent if there is one. Format: `projects/{Project ID}/locations/{Location - # ID}/collections/\\{Collection ID}/engines/\\{Engine ID}` - class GenAppBuilderSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for answer feedback collection. - # @!attribute [rw] enable_answer_feedback - # @return [::Boolean] - # Optional. If enabled, end users will be able to provide - # {::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback answer feedback} to - # Dialogflow responses. Feature works only if interaction logging is - # enabled in the Dialogflow agent. - class AnswerFeedbackSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for end user personalization. - # @!attribute [rw] default_end_user_metadata - # @return [::Google::Protobuf::Struct] - # Optional. Default end user metadata, used when processing DetectIntent - # requests. Recommended to be filled as a template instead of hard-coded - # value, for example { "age": "$session.params.age" }. The data will be - # merged with the - # {::Google::Cloud::Dialogflow::CX::V3::QueryParameters#end_user_metadata QueryParameters.end_user_metadata} - # in - # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest#query_params DetectIntentRequest.query_params} - # during query processing. - class PersonalizationSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for custom client certificates. - # @!attribute [rw] ssl_certificate - # @return [::String] - # Required. The ssl certificate encoded in PEM format. This string must - # include the begin header and end footer lines. - # @!attribute [rw] private_key - # @return [::String] - # Required. The name of the SecretManager secret version resource storing - # the private key encoded in PEM format. Format: - # `projects/{project}/secrets/{secret}/versions/{version}` - # @!attribute [rw] passphrase - # @return [::String] - # Optional. The name of the SecretManager secret version resource storing - # the passphrase. 'passphrase' should be left unset if the private key is - # not encrypted. - # Format: `projects/{project}/secrets/{secret}/versions/{version}` - class ClientCertificateSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#list_agents Agents.ListAgents}. - # @!attribute [rw] parent - # @return [::String] - # Required. The location to list all agents for. - # 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 ListAgentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#list_agents Agents.ListAgents}. - # @!attribute [rw] agents - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::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 ListAgentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#get_agent Agents.GetAgent}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the agent. - # Format: `projects//locations//agents/`. - class GetAgentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#create_agent Agents.CreateAgent}. - # @!attribute [rw] parent - # @return [::String] - # Required. The location to create a agent for. - # Format: `projects//locations/`. - # @!attribute [rw] agent - # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] - # Required. The agent to create. - class CreateAgentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#update_agent Agents.UpdateAgent}. - # @!attribute [rw] agent - # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] - # Required. The agent to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The mask to control which fields get updated. If the mask is not present, - # all fields will be updated. - class UpdateAgentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#delete_agent Agents.DeleteAgent}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the agent to delete. - # Format: `projects//locations//agents/`. - class DeleteAgentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#export_agent Agents.ExportAgent}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the agent to export. - # Format: `projects//locations//agents/`. - # @!attribute [rw] agent_uri - # @return [::String] - # Optional. 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). - # @!attribute [rw] data_format - # @return [::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest::DataFormat] - # Optional. The data format of the exported agent. If not specified, `BLOB` - # is assumed. - # @!attribute [rw] environment - # @return [::String] - # Optional. Environment name. If not set, draft environment is assumed. - # Format: - # `projects//locations//agents//environments/`. - # @!attribute [rw] git_destination - # @return [::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest::GitDestination] - # Optional. The Git branch to export the agent to. - # @!attribute [rw] include_bigquery_export_settings - # @return [::Boolean] - # Optional. Whether to include BigQuery Export setting. - class ExportAgentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Settings for exporting to a git branch. - # @!attribute [rw] tracking_branch - # @return [::String] - # Tracking branch for the git push. - # @!attribute [rw] commit_message - # @return [::String] - # Commit message for the git push. - class GitDestination - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Data format of the exported agent. - module DataFormat - # Unspecified format. - DATA_FORMAT_UNSPECIFIED = 0 - - # Agent content will be exported as raw bytes. - BLOB = 1 - - # Agent content will be exported in JSON Package format. - JSON_PACKAGE = 4 - end - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::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 - # if `agent_uri` is specified in - # {::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest ExportAgentRequest}. - # - # Note: The following fields are mutually exclusive: `agent_uri`, `agent_content`, `commit_sha`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] agent_content - # @return [::String] - # Uncompressed raw byte content for agent. This field is populated - # if none of `agent_uri` and `git_destination` are specified in - # {::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest ExportAgentRequest}. - # - # Note: The following fields are mutually exclusive: `agent_content`, `agent_uri`, `commit_sha`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] commit_sha - # @return [::String] - # Commit SHA of the git push. This field is populated if - # `git_destination` is specified in - # {::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest ExportAgentRequest}. - # - # Note: The following fields are mutually exclusive: `commit_sha`, `agent_uri`, `agent_content`. 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::CX::V3::Agents::Client#restore_agent Agents.RestoreAgent}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the agent to restore into. - # Format: `projects//locations//agents/`. - # @!attribute [rw] agent_uri - # @return [::String] - # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI - # to restore agent from. The format of this URI must be - # `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`, `git_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] agent_content - # @return [::String] - # Uncompressed raw byte content for agent. - # - # Note: The following fields are mutually exclusive: `agent_content`, `agent_uri`, `git_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] git_source - # @return [::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest::GitSource] - # Setting for restoring from a git branch - # - # Note: The following fields are mutually exclusive: `git_source`, `agent_uri`, `agent_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] restore_option - # @return [::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest::RestoreOption] - # Agent restore mode. If not specified, `KEEP` is assumed. - class RestoreAgentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Settings for restoring from a git branch - # @!attribute [rw] tracking_branch - # @return [::String] - # tracking branch for the git pull - class GitSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Restore option. - module RestoreOption - # Unspecified. Treated as KEEP. - RESTORE_OPTION_UNSPECIFIED = 0 - - # Always respect the settings from the exported agent file. It may cause - # a restoration failure if some settings (e.g. model type) are not - # supported in the target agent. - KEEP = 1 - - # Fallback to default settings if some settings are not supported in the - # target agent. - FALLBACK = 2 - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#validate_agent Agents.ValidateAgent}. - # @!attribute [rw] name - # @return [::String] - # Required. The agent to validate. - # Format: `projects//locations//agents/`. - # @!attribute [rw] language_code - # @return [::String] - # If not specified, the agent's default language is used. - class ValidateAgentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#get_agent_validation_result Agents.GetAgentValidationResult}. - # @!attribute [rw] name - # @return [::String] - # Required. The agent name. - # Format: - # `projects//locations//agents//validationResult`. - # @!attribute [rw] language_code - # @return [::String] - # If not specified, the agent's default language is used. - class GetAgentValidationResultRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#get_agent_validation_result Agents.GetAgentValidationResult}. - # @!attribute [rw] name - # @return [::String] - # The unique identifier of the agent validation result. - # Format: - # `projects//locations//agents//validationResult`. - # @!attribute [rw] flow_validation_results - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult>] - # Contains all flow validation results. - class AgentValidationResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for - # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#get_generative_settings GetGenerativeSettings} - # RPC. - # @!attribute [rw] name - # @return [::String] - # Required. Format: - # `projects//locations//agents//generativeSettings`. - # @!attribute [rw] language_code - # @return [::String] - # Required. Language code of the generative settings. - class GetGenerativeSettingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for - # {::Google::Cloud::Dialogflow::CX::V3::Agents::Client#update_generative_settings UpdateGenerativeSettings} - # RPC. - # @!attribute [rw] generative_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings] - # Required. Generative settings 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 UpdateGenerativeSettingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb deleted file mode 100644 index f158cc7cc676..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb +++ /dev/null @@ -1,401 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - # 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 - - # Configuration of the barge-in behavior. Barge-in instructs the API to return - # a detected utterance at a proper time while the client is playing back the - # response audio from a previous request. When the client sees the - # utterance, it should stop the playback and immediately get ready for - # receiving the responses for the current request. - # - # The barge-in handling requires the client to start streaming audio input - # as soon as it starts playing back the audio from the previous response. The - # playback is modeled into two phases: - # - # * No barge-in phase: which goes first and during which speech detection - # should not be carried out. - # - # * Barge-in phase: which follows the no barge-in phase and during which - # the API starts speech detection and may inform the client that an utterance - # has been detected. Note that no-speech event is not expected in this - # phase. - # - # The client provides this configuration in terms of the durations of those - # two phases. The durations are measured in terms of the audio length from the - # start of the input audio. - # - # No-speech event is a response with END_OF_UTTERANCE without any transcript - # following up. - # @!attribute [rw] no_barge_in_duration - # @return [::Google::Protobuf::Duration] - # Duration that is not eligible for barge-in at the beginning of the input - # audio. - # @!attribute [rw] total_duration - # @return [::Google::Protobuf::Duration] - # Total duration for the playback at the beginning of the input audio. - class BargeInConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Instructs the speech recognizer on how to process the audio content. - # @!attribute [rw] audio_encoding - # @return [::Google::Cloud::Dialogflow::CX::V3::AudioEncoding] - # Required. 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] enable_word_info - # @return [::Boolean] - # Optional. If `true`, Dialogflow returns - # {::Google::Cloud::Dialogflow::CX::V3::SpeechWordInfo SpeechWordInfo} in - # {::Google::Cloud::Dialogflow::CX::V3::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 - # @return [::Array<::String>] - # Optional. 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. - # @!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/cx/docs/concept/speech-models). - # @!attribute [rw] model_variant - # @return [::Google::Cloud::Dialogflow::CX::V3::SpeechModelVariant] - # Optional. Which variant of the [Speech - # model][google.cloud.dialogflow.cx.v3.InputAudioConfig.model] to use. - # @!attribute [rw] single_utterance - # @return [::Boolean] - # Optional. 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. - # @!attribute [rw] barge_in_config - # @return [::Google::Cloud::Dialogflow::CX::V3::BargeInConfig] - # Configuration of barge-in behavior during the streaming of input audio. - # @!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 CX Speech model - # migration](https://cloud.google.com/dialogflow/cx/docs/concept/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::CX::V3::VoiceSelectionParams#ssml_gender ssml_gender}. - # - # For the list of available voices, please refer to [Supported voices and - # languages](https://cloud.google.com/text-to-speech/docs/voices). - # @!attribute [rw] ssml_gender - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::VoiceSelectionParams#name name}. Note that - # this is only a preference, not requirement. If a voice of the appropriate - # gender is not available, the synthesizer substitutes 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::CX::V3::VoiceSelectionParams] - # Optional. The desired voice of the synthesized audio. - class SynthesizeSpeechConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Instructs the speech synthesizer how to generate the output audio content. - # @!attribute [rw] audio_encoding - # @return [::Google::Cloud::Dialogflow::CX::V3::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_config - # @return [::Google::Cloud::Dialogflow::CX::V3::SynthesizeSpeechConfig] - # Optional. Configuration of how speech should be synthesized. - # If not specified, - # {::Google::Cloud::Dialogflow::CX::V3::Agent#text_to_speech_settings Agent.text_to_speech_settings} - # is applied. - class OutputAudioConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings related to speech synthesizing. - # @!attribute [rw] synthesize_speech_configs - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dialogflow::CX::V3::SynthesizeSpeechConfig}] - # Configuration of how speech should be synthesized, mapping from language - # (https://cloud.google.com/dialogflow/cx/docs/reference/language) to - # SynthesizeSpeechConfig. - # - # These settings affect: - # - # - The [phone - # gateway](https://cloud.google.com/dialogflow/cx/docs/concept/integration/phone-gateway) - # synthesize configuration set via - # {::Google::Cloud::Dialogflow::CX::V3::Agent#text_to_speech_settings Agent.text_to_speech_settings}. - # - # - How speech is synthesized when invoking - # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Client session} APIs. - # {::Google::Cloud::Dialogflow::CX::V3::Agent#text_to_speech_settings Agent.text_to_speech_settings} - # only applies if - # {::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig#synthesize_speech_config OutputAudioConfig.synthesize_speech_config} - # is not specified. - class TextToSpeechSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Dialogflow::CX::V3::SynthesizeSpeechConfig] - class SynthesizeSpeechConfigsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - 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). - # LINT: LEGACY_NAMES - 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.cx.v3.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][InputAudioConfig.model] that the caller is eligible for. - 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::CX::V3::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. - 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. - # LINT: LEGACY_NAMES - OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1 - - # MP3 audio at 32kbps. - OUTPUT_AUDIO_ENCODING_MP3 = 2 - - # MP3 audio at 64kbps. - # LINT: LEGACY_NAMES - 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 -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/changelog.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/changelog.rb deleted file mode 100644 index a8c1d6c19669..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/changelog.rb +++ /dev/null @@ -1,128 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client#list_changelogs Changelogs.ListChangelogs}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent containing the changelogs. - # Format: `projects//locations//agents/`. - # @!attribute [rw] filter - # @return [::String] - # The filter string. Supports filter by user_email, resource, type and - # create_time. Some examples: - # 1. By user email: - # user_email = "someone@google.com" - # 2. By resource name: - # resource = "projects/123/locations/global/agents/456/flows/789" - # 3. By resource display name: - # display_name = "my agent" - # 4. By action: - # action = "Create" - # 5. By type: - # type = "flows" - # 6. By create time. Currently predicates on `create_time` and - # `create_time_epoch_seconds` are supported: - # create_time_epoch_seconds > 1551790877 AND create_time <= - # 2017-01-15T01:30:15.01Z - # 7. Combination of above filters: - # resource = "projects/123/locations/global/agents/456/flows/789" - # AND user_email = "someone@google.com" - # AND create_time <= 2017-01-15T01:30:15.01Z - # @!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 ListChangelogsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client#list_changelogs Changelogs.ListChangelogs}. - # @!attribute [rw] changelogs - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Changelog>] - # The list of changelogs. There will be a maximum number of items returned - # based on the page_size field in the request. The changelogs will be ordered - # by timestamp. - # @!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 ListChangelogsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client#get_changelog Changelogs.GetChangelog}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the changelog to get. - # Format: - # `projects//locations//agents//changelogs/`. - class GetChangelogRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Changelogs represents a change made to a given agent. - # @!attribute [rw] name - # @return [::String] - # The unique identifier of the changelog. - # Format: - # `projects//locations//agents//changelogs/`. - # @!attribute [rw] user_email - # @return [::String] - # Email address of the authenticated user. - # @!attribute [rw] display_name - # @return [::String] - # The affected resource display name of the change. - # @!attribute [rw] action - # @return [::String] - # The action of the change. - # @!attribute [rw] type - # @return [::String] - # The affected resource type. - # @!attribute [rw] resource - # @return [::String] - # The affected resource name of the change. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The timestamp of the change. - # @!attribute [rw] language_code - # @return [::String] - # The affected language code of the change. - class Changelog - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/data_store_connection.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/data_store_connection.rb deleted file mode 100644 index 5fd02bc6a3aa..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/data_store_connection.rb +++ /dev/null @@ -1,282 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - # A data store connection. It represents a data store in Discovery Engine and - # the type of the contents it contains. - # @!attribute [rw] data_store_type - # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreType] - # The type of the connected data store. - # @!attribute [rw] data_store - # @return [::String] - # The full name of the referenced data store. - # Formats: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` - # `projects/{project}/locations/{location}/dataStores/{data_store}` - # @!attribute [rw] document_processing_mode - # @return [::Google::Cloud::Dialogflow::CX::V3::DocumentProcessingMode] - # The document processing mode for the data store connection. Should only be - # set for PUBLIC_WEB and UNSTRUCTURED data stores. If not set it is - # considered as DOCUMENTS, as this is the legacy mode. - class DataStoreConnection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Data store connection feature output signals. - # Might be only partially field if processing stop before the final answer. - # Reasons for this can be, but are not limited to: empty UCS search results, - # positive RAI check outcome, grounding failure, ... - # @!attribute [rw] rewriter_model_call_signals - # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::RewriterModelCallSignals] - # Optional. Diagnostic info related to the rewriter model call. - # @!attribute [rw] rewritten_query - # @return [::String] - # Optional. Rewritten string query used for search. - # @!attribute [rw] search_snippets - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::SearchSnippet>] - # Optional. Search snippets included in the answer generation prompt. - # @!attribute [rw] answer_generation_model_call_signals - # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::AnswerGenerationModelCallSignals] - # Optional. Diagnostic info related to the answer generation model call. - # @!attribute [rw] answer - # @return [::String] - # Optional. The final compiled answer. - # @!attribute [rw] answer_parts - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::AnswerPart>] - # Optional. Answer parts with relevant citations. - # Concatenation of texts should add up the `answer` (not counting - # whitespaces). - # @!attribute [rw] cited_snippets - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::CitedSnippet>] - # Optional. Snippets cited by the answer generation model from the most to - # least relevant. - # @!attribute [rw] grounding_signals - # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::GroundingSignals] - # Optional. Grounding signals. - # @!attribute [rw] safety_signals - # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::SafetySignals] - # Optional. Safety check result. - class DataStoreConnectionSignals - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Diagnostic info related to the rewriter model call. - # @!attribute [rw] rendered_prompt - # @return [::String] - # Prompt as sent to the model. - # @!attribute [rw] model_output - # @return [::String] - # Output of the generative model. - # @!attribute [rw] model - # @return [::String] - # Name of the generative model. For example, "gemini-ultra", "gemini-pro", - # "gemini-1.5-flash" etc. Defaults to "Other" if the model is unknown. - class RewriterModelCallSignals - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Search snippet details. - # @!attribute [rw] document_title - # @return [::String] - # Title of the enclosing document. - # @!attribute [rw] document_uri - # @return [::String] - # Uri for the document. Present if specified for the document. - # @!attribute [rw] text - # @return [::String] - # Text included in the prompt. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Struct] - # Metadata associated with the document. - class SearchSnippet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Diagnostic info related to the answer generation model call. - # @!attribute [rw] rendered_prompt - # @return [::String] - # Prompt as sent to the model. - # @!attribute [rw] model_output - # @return [::String] - # Output of the generative model. - # @!attribute [rw] model - # @return [::String] - # Name of the generative model. For example, "gemini-ultra", "gemini-pro", - # "gemini-1.5-flash" etc. Defaults to "Other" if the model is unknown. - class AnswerGenerationModelCallSignals - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Answer part with citation. - # @!attribute [rw] text - # @return [::String] - # Substring of the answer. - # @!attribute [rw] supporting_indices - # @return [::Array<::Integer>] - # Citations for this answer part. Indices of `search_snippets`. - class AnswerPart - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Snippet cited by the answer generation model. - # @!attribute [rw] search_snippet - # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::SearchSnippet] - # Details of the snippet. - # @!attribute [rw] snippet_index - # @return [::Integer] - # Index of the snippet in `search_snippets` field. - class CitedSnippet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Grounding signals. - # @!attribute [rw] decision - # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::GroundingSignals::GroundingDecision] - # Represents the decision of the grounding check. - # @!attribute [rw] score - # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::GroundingSignals::GroundingScoreBucket] - # Grounding score bucket setting. - class GroundingSignals - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents the decision of the grounding check. - module GroundingDecision - # Decision not specified. - GROUNDING_DECISION_UNSPECIFIED = 0 - - # Grounding have accepted the answer. - ACCEPTED_BY_GROUNDING = 1 - - # Grounding have rejected the answer. - REJECTED_BY_GROUNDING = 2 - end - - # Grounding score buckets. - module GroundingScoreBucket - # Score not specified. - GROUNDING_SCORE_BUCKET_UNSPECIFIED = 0 - - # We have very low confidence that the answer is grounded. - VERY_LOW = 1 - - # We have low confidence that the answer is grounded. - LOW = 3 - - # We have medium confidence that the answer is grounded. - MEDIUM = 4 - - # We have high confidence that the answer is grounded. - HIGH = 5 - - # We have very high confidence that the answer is grounded. - VERY_HIGH = 6 - end - end - - # Safety check results. - # @!attribute [rw] decision - # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::SafetySignals::SafetyDecision] - # Safety decision. - # @!attribute [rw] banned_phrase_match - # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals::SafetySignals::BannedPhraseMatch] - # Specifies banned phrase match subject. - # @!attribute [rw] matched_banned_phrase - # @return [::String] - # The matched banned phrase if there was a match. - class SafetySignals - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Safety decision. - # All kinds of check are incorporated into this final decision, including - # banned phrases check. - module SafetyDecision - # Decision not specified. - SAFETY_DECISION_UNSPECIFIED = 0 - - # No manual or automatic safety check fired. - ACCEPTED_BY_SAFETY_CHECK = 1 - - # One ore more safety checks fired. - REJECTED_BY_SAFETY_CHECK = 2 - end - - # Specifies banned phrase match subject. - module BannedPhraseMatch - # No banned phrase check was executed. - BANNED_PHRASE_MATCH_UNSPECIFIED = 0 - - # All banned phrase checks led to no match. - BANNED_PHRASE_MATCH_NONE = 1 - - # A banned phrase matched the query. - BANNED_PHRASE_MATCH_QUERY = 2 - - # A banned phrase matched the response. - BANNED_PHRASE_MATCH_RESPONSE = 3 - end - end - end - - # Type of a data store. - # Determines how search is performed in the data store. - module DataStoreType - # Not specified. This value indicates that the data store type is not - # specified, so it will not be used during search. - DATA_STORE_TYPE_UNSPECIFIED = 0 - - # A data store that contains public web content. - PUBLIC_WEB = 1 - - # A data store that contains unstructured private data. - UNSTRUCTURED = 2 - - # A data store that contains structured data (for example FAQ). - STRUCTURED = 3 - end - - # The document processing mode of the data store. - module DocumentProcessingMode - # Not specified. This should be set for STRUCTURED type data stores. Due to - # legacy reasons this is considered as DOCUMENTS for STRUCTURED and - # PUBLIC_WEB data stores. - DOCUMENT_PROCESSING_MODE_UNSPECIFIED = 0 - - # Documents are processed as documents. - DOCUMENTS = 1 - - # Documents are converted to chunks. - CHUNKS = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/deployment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/deployment.rb deleted file mode 100644 index 704cb4953d43..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/deployment.rb +++ /dev/null @@ -1,138 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - # Represents a deployment in an environment. A deployment happens when a flow - # version configured to be active in the environment. You can configure running - # pre-deployment steps, e.g. running validation test cases, experiment - # auto-rollout, etc. - # @!attribute [rw] name - # @return [::String] - # The name of the deployment. - # Format: - # projects//locations//agents//environments//deployments/. - # @!attribute [rw] flow_version - # @return [::String] - # The name of the flow version for this deployment. - # Format: - # projects//locations//agents//flows//versions/. - # @!attribute [rw] state - # @return [::Google::Cloud::Dialogflow::CX::V3::Deployment::State] - # The current state of the deployment. - # @!attribute [rw] result - # @return [::Google::Cloud::Dialogflow::CX::V3::Deployment::Result] - # Result of the deployment. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Start time of this deployment. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # End time of this deployment. - class Deployment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Result of the deployment. - # @!attribute [rw] deployment_test_results - # @return [::Array<::String>] - # Results of test cases running before the deployment. - # Format: - # `projects//locations//agents//testCases//results/`. - # @!attribute [rw] experiment - # @return [::String] - # The name of the experiment triggered by this deployment. - # Format: - # projects//locations//agents//environments//experiments/. - class Result - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The state of the deployment. - module State - # State unspecified. - STATE_UNSPECIFIED = 0 - - # The deployment is running. - RUNNING = 1 - - # The deployment succeeded. - SUCCEEDED = 2 - - # The deployment failed. - FAILED = 3 - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Deployments::Client#list_deployments Deployments.ListDeployments}. - # @!attribute [rw] parent - # @return [::String] - # Required. The {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to - # list all environments for. Format: - # `projects//locations//agents//environments/`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return in a single page. By default 20 and - # at most 100. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token value returned from a previous list request. - class ListDeploymentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::Deployments::Client#list_deployments Deployments.ListDeployments}. - # @!attribute [rw] deployments - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Deployment>] - # The list of deployments. There will be a maximum number of items - # returned based on the page_size field in the request. The list may in some - # cases be empty or contain fewer entries than page_size even if this isn't - # the last page. - # @!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 ListDeploymentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Deployments::Client#get_deployment Deployments.GetDeployment}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the - # {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployment}. Format: - # `projects//locations//agents//environments//deployments/`. - class GetDeploymentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/entity_type.rb deleted file mode 100644 index 27c1594fe5eb..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/entity_type.rb +++ /dev/null @@ -1,519 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - # Entities are extracted from user input and represent parameters that are - # meaningful to your application. For example, a date range, a proper name - # such as a geographic location or landmark, and so on. Entities represent - # actionable data for your application. - # - # When you define an entity, you can also include synonyms that all map to - # that entity. For example, "soft drink", "soda", "pop", and so on. - # - # There are three types of entities: - # - # * **System** - entities that are defined by the Dialogflow API for common - # data types such as date, time, currency, and so on. A system entity is - # represented by the `EntityType` type. - # - # * **Custom** - entities that are defined by you that represent - # actionable data that is meaningful to your application. For example, - # you could define a `pizza.sauce` entity for red or white pizza sauce, - # a `pizza.cheese` entity for the different types of cheese on a pizza, - # a `pizza.topping` entity for different toppings, and so on. A custom - # entity is represented by the `EntityType` type. - # - # * **User** - entities that are built for an individual user such as - # favorites, preferences, playlists, and so on. A user entity is - # represented by the - # {::Google::Cloud::Dialogflow::CX::V3::SessionEntityType SessionEntityType} - # type. - # - # For more information about entity types, see the [Dialogflow - # documentation](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::CX::V3::EntityTypes::Client#update_entity_type EntityTypes.UpdateEntityType}. - # Format: - # `projects//locations//agents//entityTypes/`. - # @!attribute [rw] display_name - # @return [::String] - # Required. The human-readable name of the entity type, unique within the - # agent. - # @!attribute [rw] kind - # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType::Kind] - # Required. Indicates the kind of entity type. - # @!attribute [rw] auto_expansion_mode - # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType::AutoExpansionMode] - # Indicates whether the entity type can be automatically expanded. - # @!attribute [rw] entities - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::EntityType::Entity>] - # The collection of entity entries associated with the entity type. - # @!attribute [rw] excluded_phrases - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::EntityType::ExcludedPhrase>] - # Collection of exceptional words and phrases that shouldn't be matched. - # For example, if you have a size entity type with entry `giant`(an - # adjective), you might consider adding `giants`(a noun) as an exclusion. - # If the kind of entity type is `KIND_MAP`, then the phrases specified by - # entities and excluded phrases should be mutually exclusive. - # @!attribute [rw] enable_fuzzy_extraction - # @return [::Boolean] - # Enables fuzzy entity extraction during classification. - # @!attribute [rw] redact - # @return [::Boolean] - # Indicates whether parameters of the entity type should be redacted in log. - # If redaction is enabled, page parameters and intent parameters referring to - # the entity type will be replaced by parameter name when logging. - 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 canonical 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 - - # An excluded entity phrase that should not be matched. - # @!attribute [rw] value - # @return [::String] - # Required. The word or phrase to be excluded. - class ExcludedPhrase - 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 canonical - # value. - KIND_MAP = 1 - - # List entity types contain a set of entries that do not map to canonical - # 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::CX::V3::EntityTypes::Client#export_entity_types EntityTypes.ExportEntityTypes}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent agent to export entity types. - # Format: `projects//locations//agents/`. - # @!attribute [rw] entity_types - # @return [::Array<::String>] - # Required. The name of the entity types to export. - # Format: - # `projects//locations//agents//entityTypes/`. - # @!attribute [rw] entity_types_uri - # @return [::String] - # Optional. The [Google Cloud - # Storage](https://cloud.google.com/storage/docs/) URI to export the entity - # types to. The format of this URI must be - # `gs:///`. - # - # 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). - # - # Note: The following fields are mutually exclusive: `entity_types_uri`, `entity_types_content_inline`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] entity_types_content_inline - # @return [::Boolean] - # Optional. The option to return the serialized entity types inline. - # - # Note: The following fields are mutually exclusive: `entity_types_content_inline`, `entity_types_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] data_format - # @return [::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest::DataFormat] - # Optional. The data format of the exported entity types. If not specified, - # `BLOB` is assumed. - # @!attribute [rw] language_code - # @return [::String] - # Optional. The language to retrieve the entity type for. The following - # fields are language dependent: - # - # * `EntityType.entities.value` - # * `EntityType.entities.synonyms` - # * `EntityType.excluded_phrases.value` - # - # If not specified, all language dependent fields will be retrieved. - # [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 ExportEntityTypesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Data format of the exported entity types. - module DataFormat - # Unspecified format. Treated as `BLOB`. - DATA_FORMAT_UNSPECIFIED = 0 - - # EntityTypes will be exported as raw bytes. - BLOB = 1 - - # EntityTypes will be exported in JSON Package format. - JSON_PACKAGE = 5 - end - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#export_entity_types EntityTypes.ExportEntityTypes}. - # @!attribute [rw] entity_types_uri - # @return [::String] - # The URI to a file containing the exported entity types. This field is - # populated only if `entity_types_uri` is specified in - # {::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest ExportEntityTypesRequest}. - # - # Note: The following fields are mutually exclusive: `entity_types_uri`, `entity_types_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] entity_types_content - # @return [::Google::Cloud::Dialogflow::CX::V3::InlineDestination] - # Uncompressed byte content for entity types. This field is populated only - # if `entity_types_content_inline` is set to true in - # {::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest ExportEntityTypesRequest}. - # - # Note: The following fields are mutually exclusive: `entity_types_content`, `entity_types_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ExportEntityTypesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata returned for the - # {::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#export_entity_types EntityTypes.ExportEntityTypes} - # long running operation. - class ExportEntityTypesMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#import_entity_types EntityTypes.ImportEntityTypes}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to import the entity types into. - # Format: `projects//locations//agents/`. - # @!attribute [rw] entity_types_uri - # @return [::String] - # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI - # to import entity types from. The format of this URI must be - # `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: `entity_types_uri`, `entity_types_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] entity_types_content - # @return [::Google::Cloud::Dialogflow::CX::V3::InlineSource] - # Uncompressed byte content of entity types. - # - # Note: The following fields are mutually exclusive: `entity_types_content`, `entity_types_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] merge_option - # @return [::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest::MergeOption] - # Required. Merge option for importing entity types. - # @!attribute [rw] target_entity_type - # @return [::String] - # Optional. The target entity type to import into. - # Format: - # `projects//locations//agents//entity_types/`. - # If set, there should be only one entity type included in - # [entity_types][google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.entity_types], - # of which the type should match the type of the target entity type. All - # {::Google::Cloud::Dialogflow::CX::V3::EntityType#entities entities} in the - # imported entity type will be added to the target entity type. - class ImportEntityTypesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Merge option when display name conflicts exist during import. - module MergeOption - # Unspecified. If used, system uses REPORT_CONFLICT as default. - MERGE_OPTION_UNSPECIFIED = 0 - - # Replace the original entity type in the agent with the new entity type - # when display name conflicts exist. - REPLACE = 1 - - # Merge the original entity type with the new entity type when display name - # conflicts exist. - MERGE = 2 - - # Create new entity types with new display names to differentiate them from - # the existing entity types when display name conflicts exist. - RENAME = 3 - - # Report conflict information if display names conflict is detected. - # Otherwise, import entity types. - REPORT_CONFLICT = 4 - - # Keep the original entity type and discard the conflicting new entity type - # when display name conflicts exist. - KEEP = 5 - end - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#import_entity_types EntityTypes.ImportEntityTypes}. - # @!attribute [rw] entity_types - # @return [::Array<::String>] - # The unique identifier of the imported entity types. - # Format: - # `projects//locations//agents//entity_types/`. - # @!attribute [rw] conflicting_resources - # @return [::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesResponse::ConflictingResources] - # Info which resources have conflicts when - # [REPORT_CONFLICT][ImportEntityTypesResponse.REPORT_CONFLICT] merge_option - # is set in ImportEntityTypesRequest. - class ImportEntityTypesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Conflicting resources detected during the import process. Only filled when - # [REPORT_CONFLICT][ImportEntityTypesResponse.REPORT_CONFLICT] is set in the - # request and there are conflicts in the display names. - # @!attribute [rw] entity_type_display_names - # @return [::Array<::String>] - # Display names of conflicting entity types. - # @!attribute [rw] entity_display_names - # @return [::Array<::String>] - # Display names of conflicting entities. - class ConflictingResources - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Metadata returned for the - # {::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#import_entity_types EntityTypes.ImportEntityTypes} - # long running operation. - class ImportEntityTypesMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#list_entity_types EntityTypes.ListEntityTypes}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to list all entity types for. - # Format: `projects//locations//agents/`. - # @!attribute [rw] language_code - # @return [::String] - # The language to list entity types for. The following fields are language - # dependent: - # - # * `EntityType.entities.value` - # * `EntityType.entities.synonyms` - # * `EntityType.excluded_phrases.value` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - # @!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 ListEntityTypesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#list_entity_types EntityTypes.ListEntityTypes}. - # @!attribute [rw] entity_types - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::EntityType>] - # The list of 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::CX::V3::EntityTypes::Client#get_entity_type EntityTypes.GetEntityType}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the entity type. - # Format: - # `projects//locations//agents//entityTypes/`. - # @!attribute [rw] language_code - # @return [::String] - # The language to retrieve the entity type for. The following fields are - # language dependent: - # - # * `EntityType.entities.value` - # * `EntityType.entities.synonyms` - # * `EntityType.excluded_phrases.value` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - class GetEntityTypeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#create_entity_type EntityTypes.CreateEntityType}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to create a entity type for. - # Format: `projects//locations//agents/`. - # @!attribute [rw] entity_type - # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType] - # Required. The entity type to create. - # @!attribute [rw] language_code - # @return [::String] - # The language of the following fields in `entity_type`: - # - # * `EntityType.entities.value` - # * `EntityType.entities.synonyms` - # * `EntityType.excluded_phrases.value` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - class CreateEntityTypeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#update_entity_type EntityTypes.UpdateEntityType}. - # @!attribute [rw] entity_type - # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType] - # Required. The entity type to update. - # @!attribute [rw] language_code - # @return [::String] - # The language of the following fields in `entity_type`: - # - # * `EntityType.entities.value` - # * `EntityType.entities.synonyms` - # * `EntityType.excluded_phrases.value` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # 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::CX::V3::EntityTypes::Client#delete_entity_type EntityTypes.DeleteEntityType}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the entity type to delete. - # Format: - # `projects//locations//agents//entityTypes/`. - # @!attribute [rw] force - # @return [::Boolean] - # This field has no effect for entity type not being used. - # For entity types that are used by intents or pages: - # - # * If `force` is set to false, an error will be returned with message - # indicating the referencing resources. - # * If `force` is set to true, Dialogflow will remove the entity type, as - # well as any references to the entity type (i.e. Page - # {::Google::Cloud::Dialogflow::CX::V3::Form::Parameter parameter} of the entity - # type will be changed to - # '@sys.any' and intent - # {::Google::Cloud::Dialogflow::CX::V3::Intent::Parameter parameter} of the - # entity type will be removed). - class DeleteEntityTypeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/environment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/environment.rb deleted file mode 100644 index be12d21f280c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/environment.rb +++ /dev/null @@ -1,380 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - # Represents an environment for an agent. 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. - # @!attribute [rw] name - # @return [::String] - # The name of the environment. - # Format: - # `projects//locations//agents//environments/`. - # @!attribute [rw] display_name - # @return [::String] - # Required. The human-readable name of the environment (unique in an agent). - # Limit of 64 characters. - # @!attribute [rw] description - # @return [::String] - # The human-readable description of the environment. The maximum length is - # 500 characters. If exceeded, the request is rejected. - # @!attribute [rw] version_configs - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Environment::VersionConfig>] - # A list of configurations for flow versions. You should include version - # configs for all flows that are reachable from [`Start - # Flow`][Agent.start_flow] in the agent. Otherwise, an error will be - # returned. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Update time of this environment. - # @!attribute [rw] test_cases_config - # @return [::Google::Cloud::Dialogflow::CX::V3::Environment::TestCasesConfig] - # The test cases config for continuous tests of this environment. - # @!attribute [rw] webhook_config - # @return [::Google::Cloud::Dialogflow::CX::V3::Environment::WebhookConfig] - # The webhook configuration for this environment. - class Environment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration for the version. - # @!attribute [rw] version - # @return [::String] - # Required. Flow, playbook and tool versions are supported. - # Format for flow version: - # projects//locations//agents//flows//versions/. - # Format for playbook version: - # projects//locations//agents//playbooks//versions/. - # Format for tool version: - # projects//locations//agents//tools//versions/. - class VersionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The configuration for continuous tests. - # @!attribute [rw] test_cases - # @return [::Array<::String>] - # A list of test case names to run. They should be under the same agent. - # Format of each test case name: - # `projects//locations//agents//testCases/` - # @!attribute [rw] enable_continuous_run - # @return [::Boolean] - # Whether to run test cases in - # {::Google::Cloud::Dialogflow::CX::V3::Environment::TestCasesConfig#test_cases TestCasesConfig.test_cases} - # periodically. Default false. If set to true, run once a day. - # @!attribute [rw] enable_predeployment_run - # @return [::Boolean] - # Whether to run test cases in - # {::Google::Cloud::Dialogflow::CX::V3::Environment::TestCasesConfig#test_cases TestCasesConfig.test_cases} - # before deploying a flow version to the environment. Default false. - class TestCasesConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for webhooks. - # @!attribute [rw] webhook_overrides - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Webhook>] - # The list of webhooks to override for the agent environment. The webhook - # must exist in the agent. You can override fields in - # {::Google::Cloud::Dialogflow::CX::V3::Webhook#generic_web_service `generic_web_service`} - # and - # {::Google::Cloud::Dialogflow::CX::V3::Webhook#service_directory `service_directory`}. - class WebhookConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#list_environments Environments.ListEnvironments}. - # @!attribute [rw] parent - # @return [::String] - # Required. The {::Google::Cloud::Dialogflow::CX::V3::Agent Agent} to list all - # environments for. Format: - # `projects//locations//agents/`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return in a single page. By default 20 and - # at most 100. - # @!attribute [rw] page_token - # @return [::String] - # 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::CX::V3::Environments::Client#list_environments Environments.ListEnvironments}. - # @!attribute [rw] environments - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Environment>] - # The list of environments. There will be a maximum number of items - # returned based on the page_size field in the request. The list may in some - # cases be empty or contain fewer entries than page_size even if this isn't - # the last page. - # @!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::CX::V3::Environments::Client#get_environment Environments.GetEnvironment}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. Format: - # `projects//locations//agents//environments/`. - class GetEnvironmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#create_environment Environments.CreateEnvironment}. - # @!attribute [rw] parent - # @return [::String] - # Required. The {::Google::Cloud::Dialogflow::CX::V3::Agent Agent} to create an - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} for. Format: - # `projects//locations//agents/`. - # @!attribute [rw] environment - # @return [::Google::Cloud::Dialogflow::CX::V3::Environment] - # Required. The environment to create. - class CreateEnvironmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#update_environment Environments.UpdateEnvironment}. - # @!attribute [rw] environment - # @return [::Google::Cloud::Dialogflow::CX::V3::Environment] - # Required. The environment to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The mask to control which fields get updated. - class UpdateEnvironmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#delete_environment Environments.DeleteEnvironment}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to delete. Format: - # `projects//locations//agents//environments/`. - class DeleteEnvironmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#lookup_environment_history Environments.LookupEnvironmentHistory}. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the environment to look up the history for. - # Format: - # `projects//locations//agents//environments/`. - # @!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 LookupEnvironmentHistoryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#lookup_environment_history Environments.LookupEnvironmentHistory}. - # @!attribute [rw] environments - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Environment>] - # Represents a list of snapshots for an environment. Time of the snapshots is - # stored in - # {::Google::Cloud::Dialogflow::CX::V3::Environment#update_time `update_time`}. - # @!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 LookupEnvironmentHistoryResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a result from running a test case in an agent environment. - # @!attribute [rw] name - # @return [::String] - # The resource name for the continuous test result. Format: - # `projects//locations//agents//environments//continuousTestResults/`. - # @!attribute [rw] result - # @return [::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult::AggregatedTestResult] - # The result of this continuous test run, i.e. whether all the tests in this - # continuous test run pass or not. - # @!attribute [rw] test_case_results - # @return [::Array<::String>] - # A list of individual test case results names in this continuous test run. - # @!attribute [rw] run_time - # @return [::Google::Protobuf::Timestamp] - # Time when the continuous testing run starts. - class ContinuousTestResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The overall result for a continuous test run in an agent environment. - module AggregatedTestResult - # Not specified. Should never be used. - AGGREGATED_TEST_RESULT_UNSPECIFIED = 0 - - # All the tests passed. - PASSED = 1 - - # At least one test did not pass. - FAILED = 2 - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#run_continuous_test Environments.RunContinuousTest}. - # @!attribute [rw] environment - # @return [::String] - # Required. Format: - # `projects//locations//agents//environments/`. - class RunContinuousTestRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#run_continuous_test Environments.RunContinuousTest}. - # @!attribute [rw] continuous_test_result - # @return [::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult] - # The result for a continuous test run. - class RunContinuousTestResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata returned for the - # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#run_continuous_test Environments.RunContinuousTest} - # long running operation. - # @!attribute [rw] errors - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TestError>] - # The test errors. - class RunContinuousTestMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#list_continuous_test_results Environments.ListContinuousTestResults}. - # @!attribute [rw] parent - # @return [::String] - # Required. The environment to list results for. - # Format: - # `projects//locations//agents//environments/`. - # @!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 ListContinuousTestResultsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for [Environments.ListTestCaseResults][]. - # @!attribute [rw] continuous_test_results - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult>] - # The list of continuous test results. - # @!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 ListContinuousTestResultsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#deploy_flow Environments.DeployFlow}. - # @!attribute [rw] environment - # @return [::String] - # Required. The environment to deploy the flow to. - # Format: - # `projects//locations//agents//environments/`. - # @!attribute [rw] flow_version - # @return [::String] - # Required. The flow version to deploy. - # Format: - # `projects//locations//agents//flows//versions/`. - class DeployFlowRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#deploy_flow Environments.DeployFlow}. - # @!attribute [rw] environment - # @return [::Google::Cloud::Dialogflow::CX::V3::Environment] - # The updated environment where the flow is deployed. - # @!attribute [rw] deployment - # @return [::String] - # The name of the flow version - # {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployment}. Format: - # `projects//locations//agents//environments//deployments/`. - class DeployFlowResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata returned for the - # {::Google::Cloud::Dialogflow::CX::V3::Environments::Client#deploy_flow Environments.DeployFlow} - # long running operation. - # @!attribute [rw] test_errors - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TestError>] - # Errors of running deployment tests. - class DeployFlowMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/experiment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/experiment.rb deleted file mode 100644 index 29adc18250ea..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/experiment.rb +++ /dev/null @@ -1,450 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - # Represents an experiment in an environment. - # @!attribute [rw] name - # @return [::String] - # The name of the experiment. - # Format: - # projects//locations//agents//environments//experiments/. - # @!attribute [rw] display_name - # @return [::String] - # Required. The human-readable name of the experiment (unique in an - # environment). Limit of 64 characters. - # @!attribute [rw] description - # @return [::String] - # The human-readable description of the experiment. - # @!attribute [rw] state - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment::State] - # The current state of the experiment. - # Transition triggered by Experiments.StartExperiment: DRAFT->RUNNING. - # Transition triggered by Experiments.CancelExperiment: DRAFT->DONE or - # RUNNING->DONE. - # @!attribute [rw] definition - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment::Definition] - # The definition of the experiment. - # @!attribute [rw] rollout_config - # @return [::Google::Cloud::Dialogflow::CX::V3::RolloutConfig] - # The configuration for auto rollout. If set, there should be exactly two - # variants in the experiment (control variant being the default version of - # the flow), the traffic allocation for the non-control variant will - # gradually increase to 100% when conditions are met, and eventually - # replace the control variant to become the default version of the flow. - # @!attribute [rw] rollout_state - # @return [::Google::Cloud::Dialogflow::CX::V3::RolloutState] - # State of the auto rollout process. - # @!attribute [rw] rollout_failure_reason - # @return [::String] - # The reason why rollout has failed. Should only be set when state is - # ROLLOUT_FAILED. - # @!attribute [rw] result - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment::Result] - # Inference result of the experiment. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Creation time of this experiment. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Start time of this experiment. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # End time of this experiment. - # @!attribute [rw] last_update_time - # @return [::Google::Protobuf::Timestamp] - # Last update time of this experiment. - # @!attribute [rw] experiment_length - # @return [::Google::Protobuf::Duration] - # Maximum number of days to run the experiment/rollout. If auto-rollout is - # not enabled, default value and maximum will be 30 days. If auto-rollout is - # enabled, default value and maximum will be 6 days. - # @!attribute [rw] variants_history - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::VariantsHistory>] - # The history of updates to the experiment variants. - class Experiment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Definition of the experiment. - # @!attribute [rw] condition - # @return [::String] - # The condition defines which subset of sessions are selected for - # this experiment. If not specified, all sessions are eligible. E.g. - # "query_input.language_code=en" See the [conditions - # reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). - # @!attribute [rw] version_variants - # @return [::Google::Cloud::Dialogflow::CX::V3::VersionVariants] - # The flow versions as the variants of this experiment. - class Definition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The inference result which includes an objective metric to optimize and the - # confidence interval. - # @!attribute [rw] version_metrics - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Experiment::Result::VersionMetrics>] - # Version variants and metrics. - # @!attribute [rw] last_update_time - # @return [::Google::Protobuf::Timestamp] - # The last time the experiment's stats data was updated. Will have default - # value if stats have never been computed for this experiment. - class Result - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A confidence interval is a range of possible values for the experiment - # objective you are trying to measure. - # @!attribute [rw] confidence_level - # @return [::Float] - # The confidence level used to construct the interval, i.e. there is X% - # chance that the true value is within this interval. - # @!attribute [rw] ratio - # @return [::Float] - # The percent change between an experiment metric's value and the value - # for its control. - # @!attribute [rw] lower_bound - # @return [::Float] - # Lower bound of the interval. - # @!attribute [rw] upper_bound - # @return [::Float] - # Upper bound of the interval. - class ConfidenceInterval - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metric and corresponding confidence intervals. - # @!attribute [rw] type - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment::Result::MetricType] - # Ratio-based metric type. Only one of type or count_type is specified in - # each Metric. - # @!attribute [rw] count_type - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment::Result::CountType] - # Count-based metric type. Only one of type or count_type is specified in - # each Metric. - # @!attribute [rw] ratio - # @return [::Float] - # Ratio value of a metric. - # - # Note: The following fields are mutually exclusive: `ratio`, `count`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] count - # @return [::Float] - # Count value of a metric. - # - # Note: The following fields are mutually exclusive: `count`, `ratio`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] confidence_interval - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment::Result::ConfidenceInterval] - # The probability that the treatment is better than all other treatments - # in the experiment - class Metric - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Version variant and associated metrics. - # @!attribute [rw] version - # @return [::String] - # The name of the flow {::Google::Cloud::Dialogflow::CX::V3::Version Version}. - # Format: - # `projects//locations//agents//flows//versions/`. - # @!attribute [rw] metrics - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Experiment::Result::Metric>] - # The metrics and corresponding confidence intervals in the inference - # result. - # @!attribute [rw] session_count - # @return [::Integer] - # Number of sessions that were allocated to this version. - class VersionMetrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Types of ratio-based metric for Dialogflow experiment. - module MetricType - # Metric unspecified. - METRIC_UNSPECIFIED = 0 - - # Percentage of contained sessions without user calling back in 24 hours. - CONTAINED_SESSION_NO_CALLBACK_RATE = 1 - - # Percentage of sessions that were handed to a human agent. - LIVE_AGENT_HANDOFF_RATE = 2 - - # Percentage of sessions with the same user calling back. - CALLBACK_SESSION_RATE = 3 - - # Percentage of sessions where user hung up. - ABANDONED_SESSION_RATE = 4 - - # Percentage of sessions reached Dialogflow 'END_PAGE' or - # 'END_SESSION'. - SESSION_END_RATE = 5 - end - - # Types of count-based metric for Dialogflow experiment. - module CountType - # Count type unspecified. - COUNT_TYPE_UNSPECIFIED = 0 - - # Total number of occurrences of a 'NO_MATCH'. - TOTAL_NO_MATCH_COUNT = 1 - - # Total number of turn counts. - TOTAL_TURN_COUNT = 2 - - # Average turn count in a session. - AVERAGE_TURN_COUNT = 3 - end - end - - # The state of the experiment. - module State - # State unspecified. - STATE_UNSPECIFIED = 0 - - # The experiment is created but not started yet. - DRAFT = 1 - - # The experiment is running. - RUNNING = 2 - - # The experiment is done. - DONE = 3 - - # The experiment with auto-rollout enabled has failed. - ROLLOUT_FAILED = 4 - end - end - - # A list of flow version variants. - # @!attribute [rw] variants - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::VersionVariants::Variant>] - # A list of flow version variants. - class VersionVariants - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A single flow version with specified traffic allocation. - # @!attribute [rw] version - # @return [::String] - # The name of the flow version. - # Format: - # `projects//locations//agents//flows//versions/`. - # @!attribute [rw] traffic_allocation - # @return [::Float] - # Percentage of the traffic which should be routed to this - # version of flow. Traffic allocation for a single flow must sum up to 1.0. - # @!attribute [rw] is_control_group - # @return [::Boolean] - # Whether the variant is for the control group. - class Variant - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The history of variants update. - # @!attribute [rw] version_variants - # @return [::Google::Cloud::Dialogflow::CX::V3::VersionVariants] - # The flow versions as the variants. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Update time of the variants. - class VariantsHistory - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The configuration for auto rollout. - # @!attribute [rw] rollout_steps - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::RolloutConfig::RolloutStep>] - # Steps to roll out a flow version. Steps should be sorted by percentage in - # ascending order. - # @!attribute [rw] rollout_condition - # @return [::String] - # The conditions that are used to evaluate the success of a rollout - # step. If not specified, all rollout steps will proceed to the next one - # unless failure conditions are met. E.g. "containment_rate > 60% AND - # callback_rate < 20%". See the [conditions - # reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). - # @!attribute [rw] failure_condition - # @return [::String] - # The conditions that are used to evaluate the failure of a rollout - # step. If not specified, no rollout steps will fail. E.g. "containment_rate - # < 10% OR average_turn_count < 3". See the [conditions - # reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). - class RolloutConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A single rollout step with specified traffic allocation. - # @!attribute [rw] display_name - # @return [::String] - # The name of the rollout step; - # @!attribute [rw] traffic_percent - # @return [::Integer] - # The percentage of traffic allocated to the flow version of this rollout - # step. (0%, 100%]. - # @!attribute [rw] min_duration - # @return [::Google::Protobuf::Duration] - # The minimum time that this step should last. Should be longer than 1 - # hour. If not set, the default minimum duration for each step will be 1 - # hour. - class RolloutStep - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # State of the auto-rollout process. - # @!attribute [rw] step - # @return [::String] - # Display name of the current auto rollout step. - # @!attribute [rw] step_index - # @return [::Integer] - # Index of the current step in the auto rollout steps list. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Start time of the current step. - class RolloutState - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#list_experiments Experiments.ListExperiments}. - # @!attribute [rw] parent - # @return [::String] - # Required. The {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to - # list all environments for. Format: - # `projects//locations//agents//environments/`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return in a single page. By default 20 and - # at most 100. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token value returned from a previous list request. - class ListExperimentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#list_experiments Experiments.ListExperiments}. - # @!attribute [rw] experiments - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Experiment>] - # The list of experiments. There will be a maximum number of items - # returned based on the page_size field in the request. The list may in some - # cases be empty or contain fewer entries than page_size even if this isn't - # the last page. - # @!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 ListExperimentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#get_experiment Experiments.GetExperiment}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. Format: - # `projects//locations//agents//environments//experiments/`. - class GetExperimentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#create_experiment Experiments.CreateExperiment}. - # @!attribute [rw] parent - # @return [::String] - # Required. The {::Google::Cloud::Dialogflow::CX::V3::Agent Agent} to create an - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} for. Format: - # `projects//locations//agents//environments/`. - # @!attribute [rw] experiment - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # Required. The experiment to create. - class CreateExperimentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#update_experiment Experiments.UpdateExperiment}. - # @!attribute [rw] experiment - # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] - # Required. The experiment to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The mask to control which fields get updated. - class UpdateExperimentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#delete_experiment Experiments.DeleteExperiment}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the - # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to delete. Format: - # `projects//locations//agents//environments//experiments/`. - class DeleteExperimentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#start_experiment Experiments.StartExperiment}. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the experiment to start. - # Format: - # `projects//locations//agents//environments//experiments/`. - class StartExperimentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#stop_experiment Experiments.StopExperiment}. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the experiment to stop. - # Format: - # `projects//locations//agents//environments//experiments/`. - class StopExperimentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb deleted file mode 100644 index 369f1aff17be..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb +++ /dev/null @@ -1,536 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dialogflow - module CX - module V3 - # Settings related to NLU. - # @!attribute [rw] model_type - # @return [::Google::Cloud::Dialogflow::CX::V3::NluSettings::ModelType] - # Indicates the type of NLU model. - # @!attribute [rw] classification_threshold - # @return [::Float] - # 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 no-match event 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. You can set a separate classification - # threshold for the flow in each language enabled for the agent. - # @!attribute [rw] model_training_mode - # @return [::Google::Cloud::Dialogflow::CX::V3::NluSettings::ModelTrainingMode] - # Indicates NLU model training mode. - class NluSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # NLU model type. - module ModelType - # Not specified. `MODEL_TYPE_STANDARD` will be used. - MODEL_TYPE_UNSPECIFIED = 0 - - # Use standard NLU model. - MODEL_TYPE_STANDARD = 1 - - # Use advanced NLU model. - MODEL_TYPE_ADVANCED = 3 - end - - # NLU model training mode. - module ModelTrainingMode - # Not specified. `MODEL_TRAINING_MODE_AUTOMATIC` will be used. - MODEL_TRAINING_MODE_UNSPECIFIED = 0 - - # NLU model training is automatically triggered when a flow gets modified. - # User can also manually trigger model training in this mode. - MODEL_TRAINING_MODE_AUTOMATIC = 1 - - # User needs to manually trigger NLU model training. Best for large flows - # whose models take long time to train. - MODEL_TRAINING_MODE_MANUAL = 2 - end - end - - # Flows represents the conversation flows when you build your chatbot agent. - # - # A flow consists of many pages connected by the transition routes. - # Conversations always start with the built-in Start Flow (with an all-0 ID). - # Transition routes can direct the conversation session from the current flow - # (parent flow) to another flow (sub flow). When the sub flow is finished, - # Dialogflow will bring the session back to the parent flow, where the sub flow - # is started. - # - # Usually, when a transition route is followed by a matched intent, the intent - # will be "consumed". This means the intent won't activate more transition - # routes. However, when the followed transition route moves the conversation - # session into a different flow, the matched intent can be carried over and to - # be consumed in the target flow. - # @!attribute [rw] name - # @return [::String] - # The unique identifier of the flow. - # Format: - # `projects//locations//agents//flows/`. - # @!attribute [rw] display_name - # @return [::String] - # Required. The human-readable name of the flow. - # @!attribute [rw] description - # @return [::String] - # The description of the flow. The maximum length is 500 characters. If - # exceeded, the request is rejected. - # @!attribute [rw] transition_routes - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TransitionRoute>] - # A flow's transition routes serve two purposes: - # - # * They are responsible for matching the user's first utterances in the - # flow. - # * They are inherited by every page's [transition - # routes][Page.transition_routes] and can support use cases such as the user - # saying "help" or "can I talk to a human?", which can be handled in a common - # way regardless of the current page. Transition routes defined in the page - # have higher priority than those defined in the flow. - # - # TransitionRoutes are evaluated in the following order: - # - # * TransitionRoutes with intent specified. - # * TransitionRoutes with only condition specified. - # - # TransitionRoutes with intent specified are inherited by pages in the flow. - # @!attribute [rw] event_handlers - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::EventHandler>] - # A flow's event handlers serve two purposes: - # - # * They are responsible for handling events (e.g. no match, - # webhook errors) in the flow. - # * They are inherited by every page's [event - # handlers][Page.event_handlers], which can be used to handle common events - # regardless of the current page. Event handlers defined in the page - # have higher priority than those defined in the flow. - # - # Unlike - # {::Google::Cloud::Dialogflow::CX::V3::Flow#transition_routes transition_routes}, - # these handlers are evaluated on a first-match basis. The first one that - # matches the event get executed, with the rest being ignored. - # @!attribute [rw] transition_route_groups - # @return [::Array<::String>] - # A flow's transition route group serve two purposes: - # - # * They are responsible for matching the user's first utterances in the - # flow. - # * They are inherited by every page's [transition - # route groups][Page.transition_route_groups]. Transition route groups - # defined in the page have higher priority than those defined in the flow. - # - # Format: - # `projects//locations//agents//flows//transitionRouteGroups/` - # or - # `projects//locations//agents//transitionRouteGroups/` - # for agent-level groups. - # @!attribute [rw] nlu_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::NluSettings] - # NLU related settings of the flow. - # @!attribute [rw] advanced_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::AdvancedSettings] - # Hierarchical advanced settings for this flow. The settings exposed at the - # lower level overrides the settings exposed at the higher level. - # @!attribute [rw] knowledge_connector_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::KnowledgeConnectorSettings] - # Optional. Knowledge connector configuration. - # @!attribute [rw] input_parameter_definitions - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ParameterDefinition>] - # Optional. Defined structured input parameters for this flow. - # @!attribute [rw] output_parameter_definitions - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ParameterDefinition>] - # Optional. Defined structured output parameters for this flow. - # @!attribute [rw] multi_language_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::Flow::MultiLanguageSettings] - # Optional. Multi-lingual agent settings for this flow. - # @!attribute [rw] locked - # @return [::Boolean] - # Indicates whether the flow is locked for changes. If the flow is locked, - # modifications to the flow will be rejected. - class Flow - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Settings for multi-lingual agents. - # @!attribute [rw] enable_multi_language_detection - # @return [::Boolean] - # Optional. Enable multi-language detection for this flow. This can be set - # only if [agent level multi language - # setting][Agent.enable_multi_language_training] is enabled. - # @!attribute [rw] supported_response_language_codes - # @return [::Array<::String>] - # Optional. Agent will respond in the detected language if the detected - # language code is in the supported resolved languages for this flow. This - # will be used only if multi-language training is enabled in the - # {::Google::Cloud::Dialogflow::CX::V3::Agent#enable_multi_language_training agent} - # and multi-language detection is enabled in the - # {::Google::Cloud::Dialogflow::CX::V3::Flow::MultiLanguageSettings#enable_multi_language_detection flow}. - # The supported languages must be a subset of the languages supported by - # the agent. - class MultiLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#create_flow Flows.CreateFlow}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to create a flow for. - # Format: `projects//locations//agents/`. - # @!attribute [rw] flow - # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] - # Required. The flow to create. - # @!attribute [rw] language_code - # @return [::String] - # The language of the following fields in `flow`: - # - # * `Flow.event_handlers.trigger_fulfillment.messages` - # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` - # * `Flow.transition_routes.trigger_fulfillment.messages` - # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - class CreateFlowRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#delete_flow Flows.DeleteFlow}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the flow to delete. - # Format: - # `projects//locations//agents//flows/`. - # @!attribute [rw] force - # @return [::Boolean] - # This field has no effect for flows with no incoming transitions. - # For flows with incoming transitions: - # - # * If `force` is set to false, an error will be returned with message - # indicating the incoming transitions. - # * If `force` is set to true, Dialogflow will remove the flow, as well as - # any transitions to the flow (i.e. [Target - # flow][EventHandler.target_flow] in event handlers or [Target - # flow][TransitionRoute.target_flow] in transition routes that point to - # this flow will be cleared). - class DeleteFlowRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#list_flows Flows.ListFlows}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent containing the flows. - # Format: `projects//locations//agents/`. - # @!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. - # @!attribute [rw] language_code - # @return [::String] - # The language to list flows for. The following fields are language - # dependent: - # - # * `Flow.event_handlers.trigger_fulfillment.messages` - # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` - # * `Flow.transition_routes.trigger_fulfillment.messages` - # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - class ListFlowsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#list_flows Flows.ListFlows}. - # @!attribute [rw] flows - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Flow>] - # The list of flows. 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 ListFlowsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#get_flow Flows.GetFlow}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the flow to get. - # Format: - # `projects//locations//agents//flows/`. - # @!attribute [rw] language_code - # @return [::String] - # The language to retrieve the flow for. The following fields are language - # dependent: - # - # * `Flow.event_handlers.trigger_fulfillment.messages` - # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` - # * `Flow.transition_routes.trigger_fulfillment.messages` - # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - class GetFlowRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#update_flow Flows.UpdateFlow}. - # @!attribute [rw] flow - # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] - # Required. The flow to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The mask to control which fields get updated. If the mask is not present, - # all fields will be updated. - # @!attribute [rw] language_code - # @return [::String] - # The language of the following fields in `flow`: - # - # * `Flow.event_handlers.trigger_fulfillment.messages` - # * `Flow.event_handlers.trigger_fulfillment.conditional_cases` - # * `Flow.transition_routes.trigger_fulfillment.messages` - # * `Flow.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - class UpdateFlowRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#train_flow Flows.TrainFlow}. - # @!attribute [rw] name - # @return [::String] - # Required. The flow to train. - # Format: - # `projects//locations//agents//flows/`. - class TrainFlowRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#validate_flow Flows.ValidateFlow}. - # @!attribute [rw] name - # @return [::String] - # Required. The flow to validate. - # Format: - # `projects//locations//agents//flows/`. - # @!attribute [rw] language_code - # @return [::String] - # If not specified, the agent's default language is used. - class ValidateFlowRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#get_flow_validation_result Flows.GetFlowValidationResult}. - # @!attribute [rw] name - # @return [::String] - # Required. The flow name. - # Format: - # `projects//locations//agents//flows//validationResult`. - # @!attribute [rw] language_code - # @return [::String] - # If not specified, the agent's default language is used. - class GetFlowValidationResultRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#get_flow_validation_result Flows.GetFlowValidationResult}. - # @!attribute [rw] name - # @return [::String] - # The unique identifier of the flow validation result. - # Format: - # `projects//locations//agents//flows//validationResult`. - # @!attribute [rw] validation_messages - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ValidationMessage>] - # Contains all validation messages. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Last time the flow was validated. - class FlowValidationResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#import_flow Flows.ImportFlow}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to import the flow into. - # Format: `projects//locations//agents/`. - # @!attribute [rw] flow_uri - # @return [::String] - # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI - # to import flow from. The format of this URI must be - # `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: `flow_uri`, `flow_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] flow_content - # @return [::String] - # Uncompressed raw byte content for flow. - # - # Note: The following fields are mutually exclusive: `flow_content`, `flow_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] import_option - # @return [::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest::ImportOption] - # Flow import mode. If not specified, `KEEP` is assumed. - # @!attribute [rw] flow_import_strategy - # @return [::Google::Cloud::Dialogflow::CX::V3::FlowImportStrategy] - # Optional. Specifies the import strategy used when resolving resource - # conflicts. - class ImportFlowRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Import option. - module ImportOption - # Unspecified. Treated as `KEEP`. - IMPORT_OPTION_UNSPECIFIED = 0 - - # Always respect settings in exported flow content. It may cause a - # import failure if some settings (e.g. custom NLU) are not supported in - # the agent to import into. - KEEP = 1 - - # Fallback to default settings if some settings are not supported in the - # agent to import into. E.g. Standard NLU will be used if custom NLU is - # not available. - FALLBACK = 2 - end - end - - # The flow import strategy used for resource conflict resolution associated - # with an {::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest ImportFlowRequest}. - # @!attribute [rw] global_import_strategy - # @return [::Google::Cloud::Dialogflow::CX::V3::ImportStrategy] - # Optional. Import strategy for resource conflict resolution, applied - # globally throughout the flow. It will be applied for all display name - # conflicts in the imported content. If not specified, 'CREATE_NEW' is - # assumed. - class FlowImportStrategy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#import_flow Flows.ImportFlow}. - # @!attribute [rw] flow - # @return [::String] - # The unique identifier of the new flow. - # Format: - # `projects//locations//agents//flows/`. - class ImportFlowResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#export_flow Flows.ExportFlow}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the flow to export. - # Format: - # `projects//locations//agents//flows/`. - # @!attribute [rw] flow_uri - # @return [::String] - # Optional. The [Google Cloud - # Storage](https://cloud.google.com/storage/docs/) URI to export the flow to. - # The format of this URI must be `gs:///`. If left - # unspecified, the serialized flow 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). - # @!attribute [rw] include_referenced_flows - # @return [::Boolean] - # Optional. Whether to export flows referenced by the specified flow. - class ExportFlowRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client#export_flow Flows.ExportFlow}. - # @!attribute [rw] flow_uri - # @return [::String] - # The URI to a file containing the exported flow. This field is populated - # only if `flow_uri` is specified in - # {::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest ExportFlowRequest}. - # - # Note: The following fields are mutually exclusive: `flow_uri`, `flow_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] flow_content - # @return [::String] - # Uncompressed raw byte content for flow. - # - # Note: The following fields are mutually exclusive: `flow_content`, `flow_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ExportFlowResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/fulfillment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/fulfillment.rb deleted file mode 100644 index 5b7c88814468..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/fulfillment.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 CX - module V3 - # A fulfillment can do one or more of the following actions at the same time: - # - # * Generate rich message responses. - # * Set parameter values. - # * Call the webhook. - # - # Fulfillments can be called at various stages in the - # {::Google::Cloud::Dialogflow::CX::V3::Page Page} or - # {::Google::Cloud::Dialogflow::CX::V3::Form Form} lifecycle. For example, when a - # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest DetectIntentRequest} - # drives a session to enter a new page, the page's entry fulfillment can add a - # static response to the - # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} in the returning - # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse DetectIntentResponse}, - # call the webhook (for example, to load user data from a database), or both. - # @!attribute [rw] messages - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ResponseMessage>] - # The list of rich message responses to present to the user. - # @!attribute [rw] webhook - # @return [::String] - # The webhook to call. - # Format: - # `projects//locations//agents//webhooks/`. - # @!attribute [rw] return_partial_responses - # @return [::Boolean] - # Whether Dialogflow should return currently queued fulfillment response - # messages in streaming APIs. If a webhook is specified, it happens before - # Dialogflow invokes webhook. - # Warning: - # 1) This flag only affects streaming API. Responses are still queued - # and returned once in non-streaming API. - # 2) The flag can be enabled in any fulfillment but only the first 3 partial - # responses will be returned. You may only want to apply it to fulfillments - # that have slow webhooks. - # @!attribute [rw] tag - # @return [::String] - # The value of this field will be populated in the - # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest} - # `fulfillmentInfo.tag` field by Dialogflow when the associated webhook is - # called. - # The tag is typically used by the webhook service to identify which - # fulfillment is being called, but it could be used for other purposes. - # This field is required if `webhook` is specified. - # @!attribute [rw] set_parameter_actions - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Fulfillment::SetParameterAction>] - # Set parameter values before executing the webhook. - # @!attribute [rw] conditional_cases - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Fulfillment::ConditionalCases>] - # Conditional cases for this fulfillment. - # @!attribute [rw] advanced_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::AdvancedSettings] - # Hierarchical advanced settings for this fulfillment. The settings exposed - # at the lower level overrides the settings exposed at the higher level. - # @!attribute [rw] enable_generative_fallback - # @return [::Boolean] - # If the flag is true, the agent will utilize LLM to generate a text - # response. If LLM generation fails, the defined - # {::Google::Cloud::Dialogflow::CX::V3::Fulfillment#messages responses} in the - # fulfillment will be respected. This flag is only useful for fulfillments - # associated with no-match event handlers. - # @!attribute [rw] generators - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Fulfillment::GeneratorSettings>] - # A list of Generators to be called during this fulfillment. - class Fulfillment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Setting a parameter value. - # @!attribute [rw] parameter - # @return [::String] - # Display name of the parameter. - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - # The new value of the parameter. A null value clears the parameter. - class SetParameterAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A list of cascading if-else conditions. Cases are mutually exclusive. - # The first one with a matching condition is selected, all the rest ignored. - # @!attribute [rw] cases - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Fulfillment::ConditionalCases::Case>] - # A list of cascading if-else conditions. - class ConditionalCases - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Each case has a Boolean condition. When it is evaluated to be True, the - # corresponding messages will be selected and evaluated recursively. - # @!attribute [rw] condition - # @return [::String] - # The condition to activate and select this case. Empty means the - # condition is always true. The condition is evaluated against [form - # parameters][Form.parameters] or [session - # parameters][SessionInfo.parameters]. - # - # See the [conditions - # reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). - # @!attribute [rw] case_content - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Fulfillment::ConditionalCases::Case::CaseContent>] - # A list of case content. - class Case - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The list of messages or conditional cases to activate for this case. - # @!attribute [rw] message - # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage] - # Returned message. - # - # Note: The following fields are mutually exclusive: `message`, `additional_cases`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] additional_cases - # @return [::Google::Cloud::Dialogflow::CX::V3::Fulfillment::ConditionalCases] - # Additional cases to be evaluated. - # - # Note: The following fields are mutually exclusive: `additional_cases`, `message`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class CaseContent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Generator settings used by the LLM to generate a text response. - # @!attribute [rw] generator - # @return [::String] - # Required. The generator to call. - # Format: - # `projects//locations//agents//generators/`. - # @!attribute [rw] input_parameters - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from [placeholder parameter][Generator.Parameter.id] in the - # {::Google::Cloud::Dialogflow::CX::V3::Generator Generator} to corresponding - # session parameters. By default, Dialogflow uses the session parameter - # with the same name to fill in the generator template. e.g. If there is a - # placeholder parameter `city` in the Generator, Dialogflow default to fill - # in the `$city` with - # `$session.params.city`. However, you may choose to fill `$city` with - # `$session.params.desination-city`. - # - Map key: [parameter ID][Genrator.Parameter.id] - # - Map value: session parameter name - # @!attribute [rw] output_parameter - # @return [::String] - # Required. Output parameter which should contain the generator response. - class GeneratorSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class InputParametersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/gcs.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/gcs.rb deleted file mode 100644 index 946cd1758d0b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/gcs.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - # Google Cloud Storage location for a Dialogflow operation that writes or - # exports objects (e.g. exported agent or transcripts) outside of Dialogflow. - # @!attribute [rw] uri - # @return [::String] - # Required. The Google Cloud Storage URI for the exported objects. A URI is - # of the form: `gs://bucket/object-name-or-prefix` Whether a full object - # name, or just a prefix, its usage depends on the Dialogflow operation. - class GcsDestination - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generative_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generative_settings.rb deleted file mode 100644 index 5ac9c48f57f6..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generative_settings.rb +++ /dev/null @@ -1,128 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - # Settings for Generative AI. - # @!attribute [rw] name - # @return [::String] - # Format: - # `projects//locations//agents//generativeSettings`. - # @!attribute [rw] fallback_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings::FallbackSettings] - # Settings for Generative Fallback. - # @!attribute [rw] generative_safety_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::SafetySettings] - # Settings for Generative Safety. - # @!attribute [rw] knowledge_connector_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings::KnowledgeConnectorSettings] - # Settings for knowledge connector. - # @!attribute [rw] language_code - # @return [::String] - # Language for this settings. - # @!attribute [rw] llm_model_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::LlmModelSettings] - # LLM model settings. - class GenerativeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Settings for Generative Fallback. - # @!attribute [rw] selected_prompt - # @return [::String] - # Display name of the selected prompt. - # @!attribute [rw] prompt_templates - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings::FallbackSettings::PromptTemplate>] - # Stored prompts that can be selected, for example default templates like - # "conservative" or "chatty", or user defined ones. - class FallbackSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Prompt template. - # @!attribute [rw] display_name - # @return [::String] - # Prompt name. - # @!attribute [rw] prompt_text - # @return [::String] - # Prompt text that is sent to a LLM on no-match default, placeholders are - # filled downstream. For example: "Here is a conversation $conversation, - # a response is: " - # @!attribute [rw] frozen - # @return [::Boolean] - # If the flag is true, the prompt is frozen and cannot be modified by - # users. - class PromptTemplate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for knowledge connector. These parameters are used for LLM prompt - # like "You are . You are a helpful and verbose at - # , . Your task is to help humans on - # ". - # @!attribute [rw] business - # @return [::String] - # Name of the company, organization or other entity that the agent - # represents. Used for knowledge connector LLM prompt and for knowledge - # search. - # @!attribute [rw] agent - # @return [::String] - # Name of the virtual agent. Used for LLM prompt. Can be left empty. - # @!attribute [rw] agent_identity - # @return [::String] - # Identity of the agent, e.g. "virtual agent", "AI assistant". - # @!attribute [rw] business_description - # @return [::String] - # Company description, used for LLM prompt, e.g. "a family company selling - # freshly roasted coffee beans". - # @!attribute [rw] agent_scope - # @return [::String] - # Agent scope, e.g. "Example company website", "internal Example - # company website for employees", "manual of car owner". - # @!attribute [rw] disable_data_store_fallback - # @return [::Boolean] - # Whether to disable fallback to Data Store search results (in case the LLM - # couldn't pick a proper answer). Per default the feature is enabled. - class KnowledgeConnectorSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for LLM models. - # @!attribute [rw] model - # @return [::String] - # The selected LLM model. - # @!attribute [rw] prompt_text - # @return [::String] - # The custom prompt to use. - class LlmModelSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generator.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generator.rb deleted file mode 100644 index 8d42c828c536..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/generator.rb +++ /dev/null @@ -1,223 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - # Generators contain prompt to be sent to the LLM model to generate text. The - # prompt can contain parameters which will be resolved before calling the - # model. It can optionally contain banned phrases to ensure the model responses - # are safe. - # @!attribute [rw] name - # @return [::String] - # The unique identifier of the generator. - # Must be set for the - # {::Google::Cloud::Dialogflow::CX::V3::Generators::Client#update_generator Generators.UpdateGenerator} - # method. [Generators.CreateGenerate][] populates the name automatically. - # Format: - # `projects//locations//agents//generators/`. - # @!attribute [rw] display_name - # @return [::String] - # Required. The human-readable name of the generator, unique within the - # agent. The prompt contains pre-defined parameters such as $conversation, - # $last-user-utterance, etc. populated by Dialogflow. It can also contain - # custom placeholders which will be resolved during fulfillment. - # @!attribute [rw] prompt_text - # @return [::Google::Cloud::Dialogflow::CX::V3::Phrase] - # Required. Prompt for the LLM model. - # @!attribute [rw] placeholders - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Generator::Placeholder>] - # Optional. List of custom placeholders in the prompt text. - # @!attribute [rw] llm_model_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::LlmModelSettings] - # The LLM model settings. - # @!attribute [rw] model_parameter - # @return [::Google::Cloud::Dialogflow::CX::V3::Generator::ModelParameter] - # Parameters passed to the LLM to configure its behavior. - class Generator - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents a custom placeholder in the prompt text. - # @!attribute [rw] id - # @return [::String] - # Unique ID used to map custom placeholder to parameters in fulfillment. - # @!attribute [rw] name - # @return [::String] - # Custom placeholder value in the prompt text. - class Placeholder - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Parameters to be passed to the LLM. If not set, default values will be - # used. - # @!attribute [rw] temperature - # @return [::Float] - # The temperature used for sampling. Temperature sampling occurs after both - # topP and topK have been applied. - # Valid range: [0.0, 1.0] - # Low temperature = less random. High temperature = more random. - # @!attribute [rw] max_decode_steps - # @return [::Integer] - # The maximum number of tokens to generate. - # @!attribute [rw] top_p - # @return [::Float] - # If set, only the tokens comprising the top top_p probability mass are - # considered. If both top_p and top_k are - # set, top_p will be used for further refining candidates selected with - # top_k. - # Valid range: (0.0, 1.0]. - # Small topP = less random. Large topP = more random. - # @!attribute [rw] top_k - # @return [::Integer] - # If set, the sampling process in each step is limited to the top_k tokens - # with highest probabilities. - # Valid range: [1, 40] or 1000+. - # Small topK = less random. Large topK = more random. - class ModelParameter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Text input which can be used for prompt or banned phrases. - # @!attribute [rw] text - # @return [::String] - # Required. Text input which can be used for prompt or banned phrases. - class Phrase - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Generators::Client#list_generators Generators.ListGenerators}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to list all generators for. - # Format: `projects//locations//agents/`. - # @!attribute [rw] language_code - # @return [::String] - # The language to list generators for. - # @!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 ListGeneratorsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::Generators::Client#list_generators Generators.ListGenerators}. - # @!attribute [rw] generators - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Generator>] - # The list of generators. 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 ListGeneratorsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Generators::Client#get_generator Generators.GetGenerator}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the generator. - # Format: - # `projects//locations//agents//generators/`. - # @!attribute [rw] language_code - # @return [::String] - # The language to list generators for. - class GetGeneratorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Generators::Client#create_generator Generators.CreateGenerator}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to create a generator for. - # Format: `projects//locations//agents/`. - # @!attribute [rw] generator - # @return [::Google::Cloud::Dialogflow::CX::V3::Generator] - # Required. The generator to create. - # @!attribute [rw] language_code - # @return [::String] - # The language to create generators for the following fields: - # * `Generator.prompt_text.text` - # If not specified, the agent's default language is used. - class CreateGeneratorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Generators::Client#update_generator Generators.UpdateGenerator}. - # @!attribute [rw] generator - # @return [::Google::Cloud::Dialogflow::CX::V3::Generator] - # Required. The generator to update. - # @!attribute [rw] language_code - # @return [::String] - # The language to list generators for. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The mask to control which fields get updated. If the mask is not present, - # all fields will be updated. - class UpdateGeneratorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Generators::Client#delete_generator Generators.DeleteGenerator}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the generator to delete. - # Format: - # `projects//locations//agents//generators/`. - # @!attribute [rw] force - # @return [::Boolean] - # This field has no effect for generators not being used. - # For generators that are used by pages/flows/transition route groups: - # - # * If `force` is set to false, an error will be returned with message - # indicating the referenced resources. - # * If `force` is set to true, Dialogflow will remove the generator, as well - # as any references to the generator (i.e. - # [Generator][Fulfillment.generator]) in fulfillments. - class DeleteGeneratorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/import_strategy.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/import_strategy.rb deleted file mode 100644 index 27b44f105db2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/import_strategy.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! - - -module Google - module Cloud - module Dialogflow - module CX - module V3 - # Import strategies for the conflict resolution of resources (i.e. intents, - # entities, and webhooks) with identical display names during import - # operations. - module ImportStrategy - # Unspecified. Treated as 'CREATE_NEW'. - IMPORT_STRATEGY_UNSPECIFIED = 0 - - # Create a new resource with a numeric suffix appended to the end of the - # existing display name. - IMPORT_STRATEGY_CREATE_NEW = 1 - - # Replace existing resource with incoming resource in the content to be - # imported. - IMPORT_STRATEGY_REPLACE = 2 - - # Keep existing resource and discard incoming resource in the content to be - # imported. - IMPORT_STRATEGY_KEEP = 3 - - # Combine existing and incoming resources when a conflict is encountered. - IMPORT_STRATEGY_MERGE = 4 - - # Throw error if a conflict is encountered. - IMPORT_STRATEGY_THROW_ERROR = 5 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/inline.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/inline.rb deleted file mode 100644 index 74ecf12b5154..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/inline.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dialogflow - module CX - module V3 - # Inline destination for a Dialogflow operation that writes or exports objects - # (e.g. {::Google::Cloud::Dialogflow::CX::V3::Intent intents}) outside of Dialogflow. - # @!attribute [r] content - # @return [::String] - # Output only. The uncompressed byte content for the objects. - # Only populated in responses. - class InlineDestination - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Inline source for a Dialogflow operation that reads or imports objects - # (e.g. {::Google::Cloud::Dialogflow::CX::V3::Intent intents}) into Dialogflow. - # @!attribute [rw] content - # @return [::String] - # The uncompressed byte content for the objects. - class InlineSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/intent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/intent.rb deleted file mode 100644 index 9fe73300461d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/intent.rb +++ /dev/null @@ -1,517 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - # An intent represents a user's intent to interact with a conversational agent. - # - # You can provide information for the Dialogflow API to use to match user input - # to an intent by adding training phrases (i.e., examples of user input) to - # your intent. - # @!attribute [rw] name - # @return [::String] - # The unique identifier of the intent. - # Required for the - # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#update_intent Intents.UpdateIntent} - # method. - # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#create_intent Intents.CreateIntent} - # populates the name automatically. - # Format: - # `projects//locations//agents//intents/`. - # @!attribute [rw] display_name - # @return [::String] - # Required. The human-readable name of the intent, unique within the agent. - # @!attribute [rw] training_phrases - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Intent::TrainingPhrase>] - # The collection of training phrases the agent is trained on to identify the - # intent. - # @!attribute [rw] parameters - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Intent::Parameter>] - # The collection of parameters associated with the intent. - # @!attribute [rw] priority - # @return [::Integer] - # 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] - # Indicates whether this is a fallback intent. Currently only default - # fallback intent is allowed in the agent, which is added upon agent - # creation. - # Adding training phrases to fallback intent is useful in the case of - # requests that are mistakenly matched, since training phrases assigned to - # fallback intents act as negative examples that triggers no-match event. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # The key/value metadata to label an intent. Labels can contain - # lowercase letters, digits and the symbols '-' and '_'. International - # characters are allowed, including letters from unicase alphabets. Keys must - # start with a letter. Keys and values can be no longer than 63 characters - # and no more than 128 bytes. - # - # Prefix "sys-" is reserved for Dialogflow defined labels. Currently allowed - # Dialogflow defined labels include: - # * sys-head - # * sys-contextual - # The above labels do not require value. "sys-head" means the intent is a - # head intent. "sys.contextual" means the intent is a contextual intent. - # @!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 Intent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents an example that the agent is trained on to identify the intent. - # @!attribute [r] id - # @return [::String] - # Output only. The unique identifier of the training phrase. - # @!attribute [rw] parts - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 `parameter_id` field is set. - # @!attribute [rw] repeat_count - # @return [::Integer] - # Indicates how many times this example was added to the intent. - 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] parameter_id - # @return [::String] - # The {::Google::Cloud::Dialogflow::CX::V3::Intent::Parameter parameter} used to - # annotate this part of the training phrase. This field is required for - # annotated parts of the training phrase. - class Part - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Represents an intent parameter. - # @!attribute [rw] id - # @return [::String] - # Required. The unique identifier of the parameter. This field - # is used by [training - # phrases][google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase] to annotate - # their {::Google::Cloud::Dialogflow::CX::V3::Intent::TrainingPhrase::Part parts}. - # @!attribute [rw] entity_type - # @return [::String] - # Required. The entity type of the parameter. - # Format: - # `projects/-/locations/-/agents/-/entityTypes/` for - # system entity types (for example, - # `projects/-/locations/-/agents/-/entityTypes/sys.date`), or - # `projects//locations//agents//entityTypes/` - # for developer entity types. - # @!attribute [rw] is_list - # @return [::Boolean] - # Indicates whether the parameter represents a list of values. - # @!attribute [rw] redact - # @return [::Boolean] - # Indicates whether the parameter content should be redacted in log. If - # redaction is enabled, the parameter content will be replaced by parameter - # name during logging. - # Note: the parameter content is subject to redaction if either parameter - # level redaction or [entity type level - # redaction][google.cloud.dialogflow.cx.v3.EntityType.redact] is enabled. - class Parameter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#list_intents Intents.ListIntents}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to list all intents for. - # Format: `projects//locations//agents/`. - # @!attribute [rw] language_code - # @return [::String] - # The language to list intents for. The following fields are language - # dependent: - # - # * `Intent.training_phrases.parts.text` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - # @!attribute [rw] intent_view - # @return [::Google::Cloud::Dialogflow::CX::V3::IntentView] - # The resource view to apply to the returned intent. - # @!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 ListIntentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#list_intents Intents.ListIntents}. - # @!attribute [rw] intents - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Intent>] - # The list of 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::CX::V3::Intents::Client#get_intent Intents.GetIntent}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the intent. - # Format: - # `projects//locations//agents//intents/`. - # @!attribute [rw] language_code - # @return [::String] - # The language to retrieve the intent for. The following fields are language - # dependent: - # - # * `Intent.training_phrases.parts.text` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - class GetIntentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#create_intent Intents.CreateIntent}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to create an intent for. - # Format: `projects//locations//agents/`. - # @!attribute [rw] intent - # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] - # Required. The intent to create. - # @!attribute [rw] language_code - # @return [::String] - # The language of the following fields in `intent`: - # - # * `Intent.training_phrases.parts.text` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - class CreateIntentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#update_intent Intents.UpdateIntent}. - # @!attribute [rw] intent - # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] - # Required. The intent to update. - # @!attribute [rw] language_code - # @return [::String] - # The language of the following fields in `intent`: - # - # * `Intent.training_phrases.parts.text` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The mask to control which fields get updated. If the mask is not present, - # all fields will be updated. - class UpdateIntentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#delete_intent Intents.DeleteIntent}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the intent to delete. - # Format: - # `projects//locations//agents//intents/`. - class DeleteIntentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#import_intents Intents.ImportIntents}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to import the intents into. - # Format: `projects//locations//agents/`. - # @!attribute [rw] intents_uri - # @return [::String] - # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI - # to import intents from. The format of this URI must be - # `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: `intents_uri`, `intents_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] intents_content - # @return [::Google::Cloud::Dialogflow::CX::V3::InlineSource] - # Uncompressed byte content of intents. - # - # Note: The following fields are mutually exclusive: `intents_content`, `intents_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] merge_option - # @return [::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest::MergeOption] - # Merge option for importing intents. If not specified, `REJECT` is assumed. - class ImportIntentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Merge option when display name conflicts exist during import. - module MergeOption - # Unspecified. Should not be used. - MERGE_OPTION_UNSPECIFIED = 0 - - # DEPRECATED: Please use - # [REPORT_CONFLICT][ImportIntentsRequest.REPORT_CONFLICT] instead. - # Fail the request if there are intents whose display names conflict with - # the display names of intents in the agent. - REJECT = 1 - - # Replace the original intent in the agent with the new intent when display - # name conflicts exist. - REPLACE = 2 - - # Merge the original intent with the new intent when display name conflicts - # exist. - MERGE = 3 - - # Create new intents with new display names to differentiate them from the - # existing intents when display name conflicts exist. - RENAME = 4 - - # Report conflict information if display names conflict is detected. - # Otherwise, import intents. - REPORT_CONFLICT = 5 - - # Keep the original intent and discard the conflicting new intent when - # display name conflicts exist. - KEEP = 6 - end - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#import_intents Intents.ImportIntents}. - # @!attribute [rw] intents - # @return [::Array<::String>] - # The unique identifier of the imported intents. - # Format: - # `projects//locations//agents//intents/`. - # @!attribute [rw] conflicting_resources - # @return [::Google::Cloud::Dialogflow::CX::V3::ImportIntentsResponse::ConflictingResources] - # Info which resources have conflicts when - # [REPORT_CONFLICT][ImportIntentsResponse.REPORT_CONFLICT] merge_option is - # set in ImportIntentsRequest. - class ImportIntentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Conflicting resources detected during the import process. Only filled when - # [REPORT_CONFLICT][ImportIntentsResponse.REPORT_CONFLICT] is set in the - # request and there are conflicts in the display names. - # @!attribute [rw] intent_display_names - # @return [::Array<::String>] - # Display names of conflicting intents. - # @!attribute [rw] entity_display_names - # @return [::Array<::String>] - # Display names of conflicting entities. - class ConflictingResources - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Metadata returned for the - # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#import_intents Intents.ImportIntents} - # long running operation. - class ImportIntentsMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#export_intents Intents.ExportIntents}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent agent to export intents. - # Format: `projects//locations//agents/`. - # @!attribute [rw] intents - # @return [::Array<::String>] - # Required. The name of the intents to export. - # Format: - # `projects//locations//agents//intents/`. - # @!attribute [rw] intents_uri - # @return [::String] - # Optional. The [Google Cloud - # Storage](https://cloud.google.com/storage/docs/) URI to export the - # intents to. The format of this URI must be - # `gs:///`. - # - # 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). - # - # Note: The following fields are mutually exclusive: `intents_uri`, `intents_content_inline`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] intents_content_inline - # @return [::Boolean] - # Optional. The option to return the serialized intents inline. - # - # Note: The following fields are mutually exclusive: `intents_content_inline`, `intents_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] data_format - # @return [::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest::DataFormat] - # Optional. The data format of the exported intents. If not specified, `BLOB` - # is assumed. - class ExportIntentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Data format of the exported intents. - module DataFormat - # Unspecified format. Treated as `BLOB`. - DATA_FORMAT_UNSPECIFIED = 0 - - # Intents will be exported as raw bytes. - BLOB = 1 - - # Intents will be exported in JSON format. - JSON = 2 - - # Intents will be exported in CSV format. - CSV = 3 - end - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#export_intents Intents.ExportIntents}. - # @!attribute [rw] intents_uri - # @return [::String] - # The URI to a file containing the exported intents. This field is - # populated only if `intents_uri` is specified in - # {::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest ExportIntentsRequest}. - # - # Note: The following fields are mutually exclusive: `intents_uri`, `intents_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] intents_content - # @return [::Google::Cloud::Dialogflow::CX::V3::InlineDestination] - # Uncompressed byte content for intents. This field is populated only if - # `intents_content_inline` is set to true in - # {::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest ExportIntentsRequest}. - # - # Note: The following fields are mutually exclusive: `intents_content`, `intents_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ExportIntentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata returned for the - # {::Google::Cloud::Dialogflow::CX::V3::Intents::Client#export_intents Intents.ExportIntents} - # long running operation. - class ExportIntentsMetadata - 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. - module IntentView - # Not specified. Treated as INTENT_VIEW_FULL. - INTENT_VIEW_UNSPECIFIED = 0 - - # Training phrases field is not populated in the response. - INTENT_VIEW_PARTIAL = 1 - - # All fields are populated. - INTENT_VIEW_FULL = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/page.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/page.rb deleted file mode 100644 index fb399e930d9b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/page.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! - - -module Google - module Cloud - module Dialogflow - module CX - module V3 - # A Dialogflow CX conversation (session) can be described and visualized as a - # state machine. The states of a CX session are represented by pages. - # - # For each flow, you define many pages, where your combined pages can handle a - # complete conversation on the topics the flow is designed for. At any given - # moment, exactly one page is the current page, the current page is considered - # active, and the flow associated with that page is considered active. Every - # flow has a special start page. When a flow initially becomes active, the - # start page page becomes the current page. For each conversational turn, the - # current page will either stay the same or transition to another page. - # - # You configure each page to collect information from the end-user that is - # relevant for the conversational state represented by the page. - # - # For more information, see the - # [Page guide](https://cloud.google.com/dialogflow/cx/docs/concept/page). - # @!attribute [rw] name - # @return [::String] - # The unique identifier of the page. - # Required for the - # {::Google::Cloud::Dialogflow::CX::V3::Pages::Client#update_page Pages.UpdatePage} method. - # {::Google::Cloud::Dialogflow::CX::V3::Pages::Client#create_page Pages.CreatePage} - # populates the name automatically. - # Format: - # `projects//locations//agents//flows//pages/`. - # @!attribute [rw] display_name - # @return [::String] - # Required. The human-readable name of the page, unique within the flow. - # @!attribute [rw] description - # @return [::String] - # The description of the page. The maximum length is 500 characters. - # @!attribute [rw] entry_fulfillment - # @return [::Google::Cloud::Dialogflow::CX::V3::Fulfillment] - # The fulfillment to call when the session is entering the page. - # @!attribute [rw] form - # @return [::Google::Cloud::Dialogflow::CX::V3::Form] - # The form associated with the page, used for collecting parameters - # relevant to the page. - # @!attribute [rw] transition_route_groups - # @return [::Array<::String>] - # Ordered list of - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup `TransitionRouteGroups`} - # added to the page. Transition route groups must be unique within a page. If - # the page links both flow-level transition route groups and agent-level - # transition route groups, the flow-level ones will have higher priority and - # will be put before the agent-level ones. - # - # * If multiple transition routes within a page scope refer to the same - # intent, then the precedence order is: page's transition route -> page's - # transition route group -> flow's transition routes. - # - # * If multiple transition route groups within a page contain the same - # intent, then the first group in the ordered list takes precedence. - # - # Format:`projects//locations//agents//flows//transitionRouteGroups/` - # or - # `projects//locations//agents//transitionRouteGroups/` - # for agent-level groups. - # @!attribute [rw] transition_routes - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TransitionRoute>] - # A list of transitions for the transition rules of this page. - # They route the conversation to another page in the same flow, or another - # flow. - # - # When we are in a certain page, the TransitionRoutes are evaluated in the - # following order: - # - # * TransitionRoutes defined in the page with intent specified. - # * TransitionRoutes defined in the - # [transition route - # groups][google.cloud.dialogflow.cx.v3.Page.transition_route_groups] - # with intent specified. - # * TransitionRoutes defined in flow with intent specified. - # * TransitionRoutes defined in the - # [transition route - # groups][google.cloud.dialogflow.cx.v3.Flow.transition_route_groups] - # with intent specified. - # * TransitionRoutes defined in the page with only condition specified. - # * TransitionRoutes defined in the - # [transition route - # groups][google.cloud.dialogflow.cx.v3.Page.transition_route_groups] - # with only condition specified. - # @!attribute [rw] event_handlers - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::EventHandler>] - # Handlers associated with the page to handle events such as webhook errors, - # no match or no input. - # @!attribute [rw] advanced_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::AdvancedSettings] - # Hierarchical advanced settings for this page. The settings exposed at the - # lower level overrides the settings exposed at the higher level. - # @!attribute [rw] knowledge_connector_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::KnowledgeConnectorSettings] - # Optional. Knowledge connector configuration. - class Page - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A form is a data model that groups related parameters that can be collected - # from the user. The process in which the agent prompts the user and collects - # parameter values from the user is called form filling. A form can be added to - # a {::Google::Cloud::Dialogflow::CX::V3::Page page}. When form filling is done, the - # filled parameters will be written to the - # {::Google::Cloud::Dialogflow::CX::V3::SessionInfo#parameters session}. - # @!attribute [rw] parameters - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Form::Parameter>] - # Parameters to collect from the user. - class Form - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents a form parameter. - # @!attribute [rw] display_name - # @return [::String] - # Required. The human-readable name of the parameter, unique within the - # form. - # @!attribute [rw] required - # @return [::Boolean] - # Indicates whether the parameter is required. Optional parameters will not - # trigger prompts; however, they are filled if the user specifies them. - # Required parameters must be filled before form filling concludes. - # @!attribute [rw] entity_type - # @return [::String] - # Required. The entity type of the parameter. - # Format: - # `projects/-/locations/-/agents/-/entityTypes/` for - # system entity types (for example, - # `projects/-/locations/-/agents/-/entityTypes/sys.date`), or - # `projects//locations//agents//entityTypes/` - # for developer entity types. - # @!attribute [rw] is_list - # @return [::Boolean] - # Indicates whether the parameter represents a list of values. - # @!attribute [rw] fill_behavior - # @return [::Google::Cloud::Dialogflow::CX::V3::Form::Parameter::FillBehavior] - # Required. Defines fill behavior for the parameter. - # @!attribute [rw] default_value - # @return [::Google::Protobuf::Value] - # The default value of an optional parameter. If the parameter is required, - # the default value will be ignored. - # @!attribute [rw] redact - # @return [::Boolean] - # Indicates whether the parameter content should be redacted in log. If - # redaction is enabled, the parameter content will be replaced by parameter - # name during logging. - # Note: the parameter content is subject to redaction if either parameter - # level redaction or [entity type level - # redaction][google.cloud.dialogflow.cx.v3.EntityType.redact] is enabled. - # @!attribute [rw] advanced_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::AdvancedSettings] - # Hierarchical advanced settings for this parameter. The settings exposed - # at the lower level overrides the settings exposed at the higher level. - class Parameter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration for how the filling of a parameter should be handled. - # @!attribute [rw] initial_prompt_fulfillment - # @return [::Google::Cloud::Dialogflow::CX::V3::Fulfillment] - # Required. The fulfillment to provide the initial prompt that the agent - # can present to the user in order to fill the parameter. - # @!attribute [rw] reprompt_event_handlers - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::EventHandler>] - # The handlers for parameter-level events, used to provide reprompt for - # the parameter or transition to a different page/flow. The supported - # events are: - # * `sys.no-match-`, where N can be from 1 to 6 - # * `sys.no-match-default` - # * `sys.no-input-`, where N can be from 1 to 6 - # * `sys.no-input-default` - # * `sys.invalid-parameter` - # - # `initial_prompt_fulfillment` provides the first prompt for the - # parameter. - # - # If the user's response does not fill the parameter, a - # no-match/no-input event will be triggered, and the fulfillment - # associated with the `sys.no-match-1`/`sys.no-input-1` handler (if - # defined) will be called to provide a prompt. The - # `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to - # the next no-match/no-input event, and so on. - # - # A `sys.no-match-default` or `sys.no-input-default` handler will be used - # to handle all following no-match/no-input events after all numbered - # no-match/no-input handlers for the parameter are consumed. - # - # A `sys.invalid-parameter` handler can be defined to handle the case - # where the parameter values have been `invalidated` by webhook. For - # example, if the user's response fill the parameter, however the - # parameter was invalidated by webhook, the fulfillment associated with - # the `sys.invalid-parameter` handler (if defined) will be called to - # provide a prompt. - # - # If the event handler for the corresponding event can't be found on the - # parameter, `initial_prompt_fulfillment` will be re-prompted. - class FillBehavior - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # An event handler specifies an - # {::Google::Cloud::Dialogflow::CX::V3::EventHandler#event event} that can be handled - # during a session. When the specified event happens, the following actions are - # taken in order: - # - # * If there is a - # {::Google::Cloud::Dialogflow::CX::V3::EventHandler#trigger_fulfillment `trigger_fulfillment`} - # associated with the event, it will be called. - # * If there is a - # {::Google::Cloud::Dialogflow::CX::V3::EventHandler#target_page `target_page`} - # associated with the event, the session will transition into the specified - # page. - # * If there is a - # {::Google::Cloud::Dialogflow::CX::V3::EventHandler#target_flow `target_flow`} - # associated with the event, the session will transition into the specified - # flow. - # @!attribute [r] name - # @return [::String] - # Output only. The unique identifier of this event handler. - # @!attribute [rw] event - # @return [::String] - # Required. The name of the event to handle. - # @!attribute [rw] trigger_fulfillment - # @return [::Google::Cloud::Dialogflow::CX::V3::Fulfillment] - # The fulfillment to call when the event occurs. - # Handling webhook errors with a fulfillment enabled with webhook could - # cause infinite loop. It is invalid to specify such fulfillment for a - # handler handling webhooks. - # @!attribute [rw] target_page - # @return [::String] - # The target page to transition to. - # Format: - # `projects//locations//agents//flows//pages/`. - # - # Note: The following fields are mutually exclusive: `target_page`, `target_flow`, `target_playbook`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] target_flow - # @return [::String] - # The target flow to transition to. - # Format: - # `projects//locations//agents//flows/`. - # - # Note: The following fields are mutually exclusive: `target_flow`, `target_page`, `target_playbook`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] target_playbook - # @return [::String] - # The target playbook to transition to. - # Format: - # `projects//locations//agents//playbooks/`. - # - # Note: The following fields are mutually exclusive: `target_playbook`, `target_page`, `target_flow`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class EventHandler - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A transition route specifies a {::Google::Cloud::Dialogflow::CX::V3::Intent intent} - # that can be matched and/or a data condition that can be evaluated during a - # session. When a specified transition is matched, the following actions are - # taken in order: - # - # * If there is a - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRoute#trigger_fulfillment `trigger_fulfillment`} - # associated with the transition, it will be called. - # * If there is a - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRoute#target_page `target_page`} - # associated with the transition, the session will transition into the - # specified page. - # * If there is a - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRoute#target_flow `target_flow`} - # associated with the transition, the session will transition into the - # specified flow. - # @!attribute [r] name - # @return [::String] - # Output only. The unique identifier of this transition route. - # @!attribute [rw] description - # @return [::String] - # Optional. The description of the transition route. The maximum length is - # 500 characters. - # @!attribute [rw] intent - # @return [::String] - # The unique identifier of an {::Google::Cloud::Dialogflow::CX::V3::Intent Intent}. - # Format: - # `projects//locations//agents//intents/`. - # Indicates that the transition can only happen when the given intent is - # matched. - # At least one of `intent` or `condition` must be specified. When both - # `intent` and `condition` are specified, the transition can only happen - # when both are fulfilled. - # @!attribute [rw] condition - # @return [::String] - # The condition to evaluate against [form - # parameters][google.cloud.dialogflow.cx.v3.Form.parameters] or [session - # parameters][google.cloud.dialogflow.cx.v3.SessionInfo.parameters]. - # - # See the [conditions - # reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). - # At least one of `intent` or `condition` must be specified. When both - # `intent` and `condition` are specified, the transition can only happen - # when both are fulfilled. - # @!attribute [rw] trigger_fulfillment - # @return [::Google::Cloud::Dialogflow::CX::V3::Fulfillment] - # The fulfillment to call when the condition is satisfied. At least one of - # `trigger_fulfillment` and `target` must be specified. When both are - # defined, `trigger_fulfillment` is executed first. - # @!attribute [rw] target_page - # @return [::String] - # The target page to transition to. - # Format: - # `projects//locations//agents//flows//pages/`. - # - # Note: The following fields are mutually exclusive: `target_page`, `target_flow`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] target_flow - # @return [::String] - # The target flow to transition to. - # Format: - # `projects//locations//agents//flows/`. - # - # Note: The following fields are mutually exclusive: `target_flow`, `target_page`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class TransitionRoute - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Pages::Client#list_pages Pages.ListPages}. - # @!attribute [rw] parent - # @return [::String] - # Required. The flow to list all pages for. - # Format: - # `projects//locations//agents//flows/`. - # @!attribute [rw] language_code - # @return [::String] - # The language to list pages for. The following fields are language - # dependent: - # - # * `Page.entry_fulfillment.messages` - # * `Page.entry_fulfillment.conditional_cases` - # * `Page.event_handlers.trigger_fulfillment.messages` - # * `Page.event_handlers.trigger_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` - # * - # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` - # * - # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` - # * `Page.transition_routes.trigger_fulfillment.messages` - # * `Page.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - # @!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 ListPagesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::Pages::Client#list_pages Pages.ListPages}. - # @!attribute [rw] pages - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Page>] - # The list of pages. 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 ListPagesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Pages::Client#get_page Pages.GetPage}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the page. - # Format: - # `projects//locations//agents//flows//pages/`. - # @!attribute [rw] language_code - # @return [::String] - # The language to retrieve the page for. The following fields are language - # dependent: - # - # * `Page.entry_fulfillment.messages` - # * `Page.entry_fulfillment.conditional_cases` - # * `Page.event_handlers.trigger_fulfillment.messages` - # * `Page.event_handlers.trigger_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` - # * - # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` - # * - # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` - # * `Page.transition_routes.trigger_fulfillment.messages` - # * `Page.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - class GetPageRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Pages::Client#create_page Pages.CreatePage}. - # @!attribute [rw] parent - # @return [::String] - # Required. The flow to create a page for. - # Format: - # `projects//locations//agents//flows/`. - # @!attribute [rw] page - # @return [::Google::Cloud::Dialogflow::CX::V3::Page] - # Required. The page to create. - # @!attribute [rw] language_code - # @return [::String] - # The language of the following fields in `page`: - # - # * `Page.entry_fulfillment.messages` - # * `Page.entry_fulfillment.conditional_cases` - # * `Page.event_handlers.trigger_fulfillment.messages` - # * `Page.event_handlers.trigger_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` - # * - # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` - # * - # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` - # * `Page.transition_routes.trigger_fulfillment.messages` - # * `Page.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - class CreatePageRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Pages::Client#update_page Pages.UpdatePage}. - # @!attribute [rw] page - # @return [::Google::Cloud::Dialogflow::CX::V3::Page] - # Required. The page to update. - # @!attribute [rw] language_code - # @return [::String] - # The language of the following fields in `page`: - # - # * `Page.entry_fulfillment.messages` - # * `Page.entry_fulfillment.conditional_cases` - # * `Page.event_handlers.trigger_fulfillment.messages` - # * `Page.event_handlers.trigger_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` - # * - # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` - # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` - # * - # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` - # * `Page.transition_routes.trigger_fulfillment.messages` - # * `Page.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The mask to control which fields get updated. If the mask is not present, - # all fields will be updated. - class UpdatePageRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Pages::Client#delete_page Pages.DeletePage}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the page to delete. - # Format: - # `projects//locations//agents//Flows//pages/`. - # @!attribute [rw] force - # @return [::Boolean] - # This field has no effect for pages with no incoming transitions. - # For pages with incoming transitions: - # - # * If `force` is set to false, an error will be returned with message - # indicating the incoming transitions. - # * If `force` is set to true, Dialogflow will remove the page, as well as - # any transitions to the page (i.e. [Target - # page][EventHandler.target_page] in event handlers or [Target - # page][TransitionRoute.target_page] in transition routes that point to - # this page will be cleared). - class DeletePageRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Knowledge Connector settings for this page or flow. - # This includes information such as the attached Knowledge Bases, and the way - # to execute fulfillment. - # @!attribute [rw] enabled - # @return [::Boolean] - # Whether Knowledge Connector is enabled or not. - # @!attribute [rw] trigger_fulfillment - # @return [::Google::Cloud::Dialogflow::CX::V3::Fulfillment] - # The fulfillment to be triggered. - # - # When the answers from the Knowledge Connector are selected by Dialogflow, - # you can utitlize the request scoped parameter `$request.knowledge.answers` - # (contains up to the 5 highest confidence answers) and - # `$request.knowledge.questions` (contains the corresponding questions) to - # construct the fulfillment. - # @!attribute [rw] target_page - # @return [::String] - # The target page to transition to. - # Format: - # `projects//locations//agents//flows//pages/`. - # - # Note: The following fields are mutually exclusive: `target_page`, `target_flow`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] target_flow - # @return [::String] - # The target flow to transition to. - # Format: - # `projects//locations//agents//flows/`. - # - # Note: The following fields are mutually exclusive: `target_flow`, `target_page`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] data_store_connections - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::DataStoreConnection>] - # Optional. List of related data store connections. - class KnowledgeConnectorSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb deleted file mode 100644 index 1f681b5b02f4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb +++ /dev/null @@ -1,319 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - # Represents a response message that can be returned by a conversational agent. - # - # Response messages are also used for output audio synthesis. The approach is - # as follows: - # - # * If at least one OutputAudioText response is present, then all - # OutputAudioText responses are linearly concatenated, and the result is used - # for output audio synthesis. - # * If the OutputAudioText responses are a mixture of text and SSML, then the - # concatenated result is treated as SSML; otherwise, the result is treated as - # either text or SSML as appropriate. The agent designer should ideally use - # either text or SSML consistently throughout the bot design. - # * Otherwise, all Text responses are linearly concatenated, and the result is - # used for output audio synthesis. - # - # This approach allows for more sophisticated user experience scenarios, where - # the text displayed to the user may differ from what is heard. - # @!attribute [rw] text - # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::Text] - # Returns a text response. - # - # Note: The following fields are mutually exclusive: `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. 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] - # Returns a response containing a custom, platform-specific payload. - # - # Note: The following fields are mutually exclusive: `payload`, `text`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] conversation_success - # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::ConversationSuccess] - # Indicates that the conversation succeeded. - # - # Note: The following fields are mutually exclusive: `conversation_success`, `text`, `payload`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] output_audio_text - # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::OutputAudioText] - # A text or ssml response that is preferentially used for TTS output audio - # synthesis, as described in the comment on the ResponseMessage message. - # - # Note: The following fields are mutually exclusive: `output_audio_text`, `text`, `payload`, `conversation_success`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] live_agent_handoff - # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::LiveAgentHandoff] - # Hands off conversation to a human agent. - # - # Note: The following fields are mutually exclusive: `live_agent_handoff`, `text`, `payload`, `conversation_success`, `output_audio_text`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] end_interaction - # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::EndInteraction] - # Output only. A signal that indicates the interaction with the Dialogflow - # agent has ended. This message is generated by Dialogflow only when the - # conversation reaches `END_SESSION` page. It is not supposed to be defined - # by the user. - # - # It's guaranteed that there is at most one such message in each response. - # - # Note: The following fields are mutually exclusive: `end_interaction`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] play_audio - # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::PlayAudio] - # Signal that the client should play an audio clip hosted at a - # client-specific URI. Dialogflow uses this to construct - # {::Google::Cloud::Dialogflow::CX::V3::ResponseMessage#mixed_audio mixed_audio}. - # However, Dialogflow itself does not try to read or process the URI in any - # way. - # - # Note: The following fields are mutually exclusive: `play_audio`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] mixed_audio - # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::MixedAudio] - # Output only. An audio response message composed of both the synthesized - # Dialogflow agent responses and responses defined via - # {::Google::Cloud::Dialogflow::CX::V3::ResponseMessage#play_audio play_audio}. - # This message is generated by Dialogflow only and not supposed to be - # defined by the user. - # - # Note: The following fields are mutually exclusive: `mixed_audio`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `telephony_transfer_call`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] telephony_transfer_call - # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::TelephonyTransferCall] - # A signal that the client should transfer the phone call connected to - # this agent to a third-party endpoint. - # - # Note: The following fields are mutually exclusive: `telephony_transfer_call`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `knowledge_info_card`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] knowledge_info_card - # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::KnowledgeInfoCard] - # Represents info card for knowledge answers, to be better rendered in - # Dialogflow Messenger. - # - # Note: The following fields are mutually exclusive: `knowledge_info_card`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `tool_call`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] tool_call - # @return [::Google::Cloud::Dialogflow::CX::V3::ToolCall] - # Returns the definition of a tool call that should be executed by the - # client. - # - # Note: The following fields are mutually exclusive: `tool_call`, `text`, `payload`, `conversation_success`, `output_audio_text`, `live_agent_handoff`, `end_interaction`, `play_audio`, `mixed_audio`, `telephony_transfer_call`, `knowledge_info_card`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response_type - # @return [::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::ResponseType] - # Response type. - # @!attribute [rw] channel - # @return [::String] - # The channel which the response is associated with. Clients can specify the - # channel via - # {::Google::Cloud::Dialogflow::CX::V3::QueryParameters#channel QueryParameters.channel}, - # and only associated channel response will be returned. - class ResponseMessage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The text response message. - # @!attribute [rw] text - # @return [::Array<::String>] - # Required. A collection of text response variants. If multiple variants - # are defined, only one text response variant is returned at runtime. - # @!attribute [r] allow_playback_interruption - # @return [::Boolean] - # Output only. Whether the playback of this message can be interrupted by - # the end user's speech and the client can then starts the next Dialogflow - # request. - class Text - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Indicates that the conversation should be handed off to a live agent. - # - # Dialogflow only uses this to determine which conversations were handed off - # to a human agent for measurement purposes. What else to do with this signal - # is up to you and your handoff procedures. - # - # You may set this, for example: - # * In the - # {::Google::Cloud::Dialogflow::CX::V3::Page#entry_fulfillment entry_fulfillment} - # of a {::Google::Cloud::Dialogflow::CX::V3::Page Page} if - # entering the page indicates something went extremely wrong in the - # conversation. - # * In a webhook response when you determine that the customer issue can only - # be handled by a human. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Struct] - # Custom metadata for your handoff procedure. Dialogflow doesn't impose - # any structure on this. - class LiveAgentHandoff - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Indicates that the conversation succeeded, i.e., the bot handled the issue - # that the customer talked to it about. - # - # Dialogflow only uses this to determine which conversations should be - # counted as successful and doesn't process the metadata in this message in - # any way. Note that Dialogflow also considers conversations that get to the - # conversation end page as successful even if they don't return - # {::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::ConversationSuccess ConversationSuccess}. - # - # You may set this, for example: - # * In the - # {::Google::Cloud::Dialogflow::CX::V3::Page#entry_fulfillment entry_fulfillment} - # of a {::Google::Cloud::Dialogflow::CX::V3::Page Page} if - # entering the page indicates that the conversation succeeded. - # * In a webhook response when you determine that you handled the customer - # issue. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Struct] - # Custom metadata. Dialogflow doesn't impose any structure on this. - class ConversationSuccess - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A text or ssml response that is preferentially used for TTS output audio - # synthesis, as described in the comment on the ResponseMessage message. - # @!attribute [rw] text - # @return [::String] - # The raw text to be synthesized. - # - # Note: The following fields are mutually exclusive: `text`, `ssml`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ssml - # @return [::String] - # The SSML text to be synthesized. For more information, see - # [SSML](/speech/text-to-speech/docs/ssml). - # - # Note: The following fields are mutually exclusive: `ssml`, `text`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] allow_playback_interruption - # @return [::Boolean] - # Output only. Whether the playback of this message can be interrupted by - # the end user's speech and the client can then starts the next Dialogflow - # request. - class OutputAudioText - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Indicates that interaction with the Dialogflow agent has ended. - # This message is generated by Dialogflow only and not supposed to be - # defined by the user. - class EndInteraction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies an audio clip to be played by the client as part of the response. - # @!attribute [rw] audio_uri - # @return [::String] - # Required. URI of the audio clip. Dialogflow does not impose any - # validation on this value. It is specific to the client that reads it. - # @!attribute [r] allow_playback_interruption - # @return [::Boolean] - # Output only. Whether the playback of this message can be interrupted by - # the end user's speech and the client can then starts the next Dialogflow - # request. - class PlayAudio - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents an audio message that is composed of both segments - # synthesized from the Dialogflow agent prompts and ones hosted externally - # at the specified URIs. - # The external URIs are specified via - # {::Google::Cloud::Dialogflow::CX::V3::ResponseMessage#play_audio play_audio}. - # This message is generated by Dialogflow only and not supposed to be - # defined by the user. - # @!attribute [rw] segments - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::MixedAudio::Segment>] - # Segments this audio response is composed of. - class MixedAudio - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents one segment of audio. - # @!attribute [rw] audio - # @return [::String] - # Raw audio synthesized from the Dialogflow agent's response using - # the output config specified in the request. - # - # Note: The following fields are mutually exclusive: `audio`, `uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] uri - # @return [::String] - # Client-specific URI that points to an audio clip accessible to the - # client. Dialogflow does not impose any validation on it. - # - # Note: The following fields are mutually exclusive: `uri`, `audio`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] allow_playback_interruption - # @return [::Boolean] - # Output only. Whether the playback of this segment can be interrupted by - # the end user's speech and the client should then start the next - # Dialogflow request. - class Segment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Represents the signal that telles the client to transfer the phone call - # connected to the agent to a third-party endpoint. - # @!attribute [rw] phone_number - # @return [::String] - # Transfer the call to a phone number - # in [E.164 format](https://en.wikipedia.org/wiki/E.164). - class TelephonyTransferCall - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents info card response. If the response contains generative - # knowledge prediction, Dialogflow will return a payload with Infobot - # Messenger compatible info card. - # - # Otherwise, the info card response is skipped. - class KnowledgeInfoCard - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents different response types. - module ResponseType - # Not specified. - RESPONSE_TYPE_UNSPECIFIED = 0 - - # The response is from an [entry - # prompt][google.cloud.dialogflow.cx.v3.Page.entry_fulfillment] in the - # page. - ENTRY_PROMPT = 1 - - # The response is from [form-filling - # prompt][google.cloud.dialogflow.cx.v3.Form.Parameter.fill_behavior] in - # the page. - PARAMETER_PROMPT = 2 - - # The response is from a [transition - # route][google.cloud.dialogflow.cx.v3.TransitionRoute] or an [event - # handler][EventHandler] in the page or flow or transition route group. - HANDLER_PROMPT = 3 - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/safety_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/safety_settings.rb deleted file mode 100644 index 2f4160c36863..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/safety_settings.rb +++ /dev/null @@ -1,143 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dialogflow - module CX - module V3 - # Settings for Generative Safety. - # @!attribute [rw] default_banned_phrase_match_strategy - # @return [::Google::Cloud::Dialogflow::CX::V3::SafetySettings::PhraseMatchStrategy] - # Optional. Default phrase match strategy for banned phrases. - # @!attribute [rw] banned_phrases - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::SafetySettings::Phrase>] - # Banned phrases for generated text. - # @!attribute [rw] rai_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::SafetySettings::RaiSettings] - # Optional. Settings for Responsible AI checks. - # @!attribute [rw] default_rai_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::SafetySettings::RaiSettings] - # Optional. Immutable. Default RAI settings to be annotated on the agent, so - # that users will be able to restore their RAI configurations to the default - # settings. Read-only field for the API proto only. - # @!attribute [rw] prompt_security_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::SafetySettings::PromptSecuritySettings] - # Optional. Settings for prompt security checks. - class SafetySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Text input which can be used for prompt or banned phrases. - # @!attribute [rw] text - # @return [::String] - # Required. Text input which can be used for prompt or banned phrases. - # @!attribute [rw] language_code - # @return [::String] - # Required. Language code of the phrase. - class Phrase - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Responsible AI. - # @!attribute [rw] category_filters - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::SafetySettings::RaiSettings::CategoryFilter>] - # Optional. RAI blocking configurations. - class RaiSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration of the sensitivity level for blocking an RAI category. - # @!attribute [rw] category - # @return [::Google::Cloud::Dialogflow::CX::V3::SafetySettings::RaiSettings::SafetyCategory] - # RAI category to configure. - # @!attribute [rw] filter_level - # @return [::Google::Cloud::Dialogflow::CX::V3::SafetySettings::RaiSettings::SafetyFilterLevel] - # Blocking sensitivity level to configure for the RAI category. - class CategoryFilter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Sensitivity level for RAI categories. - module SafetyFilterLevel - # Unspecified -- uses default sensitivity levels. - SAFETY_FILTER_LEVEL_UNSPECIFIED = 0 - - # Block no text -- effectively disables the category. - BLOCK_NONE = 1 - - # Block a few suspicious texts. - BLOCK_FEW = 2 - - # Block some suspicious texts. - BLOCK_SOME = 3 - - # Block most suspicious texts. - BLOCK_MOST = 4 - end - - # RAI categories to configure. - module SafetyCategory - # Unspecified. - SAFETY_CATEGORY_UNSPECIFIED = 0 - - # Dangerous content. - DANGEROUS_CONTENT = 1 - - # Hate speech. - HATE_SPEECH = 2 - - # Harassment. - HARASSMENT = 3 - - # Sexually explicit content. - SEXUALLY_EXPLICIT_CONTENT = 4 - end - end - - # Settings for prompt security checks. - # @!attribute [rw] enable_prompt_security - # @return [::Boolean] - # Optional. Enable prompt security checks. - class PromptSecuritySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Strategy for matching phrases. - module PhraseMatchStrategy - # Unspecified, defaults to PARTIAL_MATCH. - PHRASE_MATCH_STRATEGY_UNSPECIFIED = 0 - - # Text that contains the phrase as a substring will be matched, e.g. "foo" - # will match "afoobar". - PARTIAL_MATCH = 1 - - # Text that contains the tokenized words of the phrase will be matched, - # e.g. "foo" will match "a foo bar" and "foo bar", but not "foobar". - WORD_MATCH = 2 - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb deleted file mode 100644 index ea43ecbb112f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb +++ /dev/null @@ -1,327 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#get_security_settings SecuritySettingsService.GetSecuritySettings}. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the settings. - # Format: - # `projects//locations//securitySettings/`. - class GetSecuritySettingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#update_security_settings SecuritySettingsService.UpdateSecuritySettings}. - # @!attribute [rw] security_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] - # Required. [SecuritySettings] object that contains values for each of the - # fields 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 UpdateSecuritySettingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for [SecuritySettings.ListSecuritySettings][]. - # @!attribute [rw] parent - # @return [::String] - # Required. The location to list all security settings for. - # Format: `projects//locations/`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return in a single page. By default 20 and - # at most 100. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token value returned from a previous list request. - class ListSecuritySettingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for [SecuritySettings.ListSecuritySettings][]. - # @!attribute [rw] security_settings - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::SecuritySettings>] - # The list of security settings. - # @!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 ListSecuritySettingsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for [SecuritySettings.CreateSecuritySettings][]. - # @!attribute [rw] parent - # @return [::String] - # Required. The location to create an - # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings} for. - # Format: `projects//locations/`. - # @!attribute [rw] security_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] - # Required. The security settings to create. - class CreateSecuritySettingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for [SecuritySettings.DeleteSecuritySettings][]. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the - # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings} to - # delete. Format: - # `projects//locations//securitySettings/`. - class DeleteSecuritySettingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the settings related to security issues, such as data redaction - # and data retention. It may take hours for updates on the settings to - # propagate to all the related components and take effect. - # @!attribute [rw] name - # @return [::String] - # Resource name of the settings. - # Required for the - # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#update_security_settings SecuritySettingsService.UpdateSecuritySettings} - # method. - # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#create_security_settings SecuritySettingsService.CreateSecuritySettings} - # populates the name automatically. Format: - # `projects//locations//securitySettings/`. - # @!attribute [rw] display_name - # @return [::String] - # Required. The human-readable name of the security settings, unique within - # the location. - # @!attribute [rw] redaction_strategy - # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings::RedactionStrategy] - # Strategy that defines how we do redaction. - # @!attribute [rw] redaction_scope - # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings::RedactionScope] - # Defines the data for which Dialogflow applies redaction. Dialogflow does - # not redact data that it does not have access to – for example, Cloud - # logging. - # @!attribute [rw] inspect_template - # @return [::String] - # [DLP](https://cloud.google.com/dlp/docs) inspect template name. Use this - # template to define inspect base settings. - # - # The `DLP Inspect Templates Reader` role is needed on the Dialogflow - # service identity service account (has the form - # `service-PROJECT_NUMBER@gcp-sa-dialogflow.iam.gserviceaccount.com`) - # for your agent's project. - # - # If empty, we use the default DLP inspect config. - # - # The template name will have one of the following formats: - # `projects//locations//inspectTemplates/` - # OR - # `organizations//locations//inspectTemplates/` - # - # Note: `inspect_template` must be located in the same region as the - # `SecuritySettings`. - # @!attribute [rw] deidentify_template - # @return [::String] - # [DLP](https://cloud.google.com/dlp/docs) deidentify template name. Use this - # template to define de-identification configuration for the content. - # - # The `DLP De-identify Templates Reader` role is needed on the Dialogflow - # service identity service account (has the form - # `service-PROJECT_NUMBER@gcp-sa-dialogflow.iam.gserviceaccount.com`) - # for your agent's project. - # - # If empty, Dialogflow replaces sensitive info with `[redacted]` text. - # - # The template name will have one of the following formats: - # `projects//locations//deidentifyTemplates/` - # OR - # `organizations//locations//deidentifyTemplates/` - # - # Note: `deidentify_template` must be located in the same region as the - # `SecuritySettings`. - # @!attribute [rw] retention_window_days - # @return [::Integer] - # Retains the data for the specified number of days. - # User must set a value lower than Dialogflow's default 365d TTL (30 days - # for Agent Assist traffic), higher value will be ignored and use default. - # Setting a value higher than that has no effect. A missing value or - # setting to 0 also means we use default TTL. - # When data retention configuration is changed, it only applies to the data - # created after the change; the TTL of existing data created before the - # change stays intact. - # - # Note: The following fields are mutually exclusive: `retention_window_days`, `retention_strategy`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] retention_strategy - # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings::RetentionStrategy] - # Specifies the retention behavior defined by - # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings::RetentionStrategy SecuritySettings.RetentionStrategy}. - # - # Note: The following fields are mutually exclusive: `retention_strategy`, `retention_window_days`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] purge_data_types - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::SecuritySettings::PurgeDataType>] - # List of types of data to remove when retention settings triggers purge. - # @!attribute [rw] audio_export_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings::AudioExportSettings] - # Controls audio export settings for post-conversation analytics when - # ingesting audio to conversations via [Participants.AnalyzeContent][] or - # [Participants.StreamingAnalyzeContent][]. - # - # If - # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings#retention_strategy retention_strategy} - # is set to REMOVE_AFTER_CONVERSATION or [audio_export_settings.gcs_bucket][] - # is empty, audio export is disabled. - # - # If audio export is enabled, audio is recorded and saved to - # [audio_export_settings.gcs_bucket][], subject to retention policy of - # [audio_export_settings.gcs_bucket][]. - # - # This setting won't effect audio input for implicit sessions via - # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#detect_intent Sessions.DetectIntent} - # or - # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#streaming_detect_intent Sessions.StreamingDetectIntent}. - # @!attribute [rw] insights_export_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings::InsightsExportSettings] - # Controls conversation exporting settings to Insights after conversation is - # completed. - # - # If - # {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings#retention_strategy retention_strategy} - # is set to REMOVE_AFTER_CONVERSATION, Insights export is disabled no matter - # what you configure here. - class SecuritySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Settings for exporting audio. - # @!attribute [rw] gcs_bucket - # @return [::String] - # Cloud Storage bucket to export audio record to. - # Setting this field would grant the Storage Object Creator role to - # the Dialogflow Service Agent. - # API caller that tries to modify this field should have the permission of - # storage.buckets.setIamPolicy. - # @!attribute [rw] audio_export_pattern - # @return [::String] - # Filename pattern for exported audio. - # \\{conversation} and \\{timestamp} are placeholders that will be replaced - # with the conversation ID and epoch micros of the conversation. - # For example, "\\{conversation}/recording_\\{timestamp}.mulaw". - # @!attribute [rw] enable_audio_redaction - # @return [::Boolean] - # Enable audio redaction if it is true. - # Note that this only redacts end-user audio data; - # Synthesised audio from the virtual agent is not redacted. - # @!attribute [rw] audio_format - # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings::AudioExportSettings::AudioFormat] - # File format for exported audio file. Currently only in telephony - # recordings. - # @!attribute [rw] store_tts_audio - # @return [::Boolean] - # Whether to store TTS audio. By default, TTS audio from the virtual agent - # is not exported. - class AudioExportSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # File format for exported audio file. Currently only in telephony - # recordings. - module AudioFormat - # Unspecified. Do not use. - AUDIO_FORMAT_UNSPECIFIED = 0 - - # G.711 mu-law PCM with 8kHz sample rate. - MULAW = 1 - - # MP3 file format. - MP3 = 2 - - # OGG Vorbis. - OGG = 3 - end - end - - # Settings for exporting conversations to - # [Insights](https://cloud.google.com/contact-center/insights/docs). - # @!attribute [rw] enable_insights_export - # @return [::Boolean] - # If enabled, we will automatically exports - # conversations to Insights and Insights runs its analyzers. - class InsightsExportSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines how we redact data. - module RedactionStrategy - # Do not redact. - REDACTION_STRATEGY_UNSPECIFIED = 0 - - # Call redaction service to clean up the data to be persisted. - REDACT_WITH_SERVICE = 1 - end - - # Defines what types of data to redact. - module RedactionScope - # Don't redact any kind of data. - REDACTION_SCOPE_UNSPECIFIED = 0 - - # On data to be written to disk or similar devices that are capable of - # holding data even if power is disconnected. This includes data that are - # temporarily saved on disk. - REDACT_DISK_STORAGE = 2 - end - - # Defines how long we retain persisted data that contains sensitive info. - module RetentionStrategy - # Retains the persisted data with Dialogflow's internal default 365d TTLs. - RETENTION_STRATEGY_UNSPECIFIED = 0 - - # Removes data when the conversation ends. If there is no [Conversation][] - # explicitly established, a default conversation ends when the - # corresponding Dialogflow session ends. - REMOVE_AFTER_CONVERSATION = 1 - end - - # Type of data we purge after retention settings triggers purge. - module PurgeDataType - # Unspecified. Do not use. - PURGE_DATA_TYPE_UNSPECIFIED = 0 - - # Dialogflow history. This does not include Cloud logging, which is - # owned by the user - not Dialogflow. - DIALOGFLOW_HISTORY = 1 - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/session.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/session.rb deleted file mode 100644 index e12784721138..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +++ /dev/null @@ -1,1348 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - # Stores information about feedback provided by users about a response. - # @!attribute [rw] rating - # @return [::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback::Rating] - # Optional. Rating from user for the specific Dialogflow response. - # @!attribute [rw] rating_reason - # @return [::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback::RatingReason] - # Optional. In case of thumbs down rating provided, users can optionally - # provide context about the rating. - # @!attribute [rw] custom_rating - # @return [::String] - # Optional. Custom rating from the user about the provided answer, with - # maximum length of 1024 characters. For example, client could use a - # customized JSON object to indicate the rating. - class AnswerFeedback - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Stores extra information about why users provided thumbs down rating. - # @!attribute [rw] reason_labels - # @return [::Array<::String>] - # Optional. Custom reason labels for thumbs down rating provided by the - # user. The maximum number of labels allowed is 10 and the maximum length - # of a single label is 128 characters. - # @!attribute [rw] feedback - # @return [::String] - # Optional. Additional feedback about the rating. - # This field can be populated without choosing a predefined `reason`. - class RatingReason - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents thumbs up/down rating provided by user about a response. - module Rating - # Rating not specified. - RATING_UNSPECIFIED = 0 - - # Thumbs up feedback from user. - THUMBS_UP = 1 - - # Thumbs down feedback from user. - THUMBS_DOWN = 2 - end - end - - # The request to set the feedback for a bot answer. - # @!attribute [rw] session - # @return [::String] - # Required. The name of the session the feedback was sent to. - # @!attribute [rw] response_id - # @return [::String] - # Required. ID of the response to update its feedback. This is the same as - # DetectIntentResponse.response_id. - # @!attribute [rw] answer_feedback - # @return [::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback] - # Required. Feedback provided for a bot answer. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. The mask to control which fields to update. If the mask is not - # present, all fields will be updated. - class SubmitAnswerFeedbackRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # 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//locations//agents//sessions/` or - # `projects//locations//agents//environments//sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. - # 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 of the `Session ID` must not exceed 36 characters. - # - # For more information, see the [sessions - # guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). - # - # Note: Always use agent versions for production traffic. - # See [Versions and - # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). - # @!attribute [rw] query_params - # @return [::Google::Cloud::Dialogflow::CX::V3::QueryParameters] - # The parameters of this query. - # @!attribute [rw] query_input - # @return [::Google::Cloud::Dialogflow::CX::V3::QueryInput] - # Required. The input specification. - # @!attribute [rw] output_audio_config - # @return [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig] - # Instructs the speech synthesizer how to generate the output audio. - # @!attribute [rw] response_view - # @return [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponseView] - # Optional. Specifies which fields in the - # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} to return. If not - # set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. - 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] - # Output only. 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::CX::V3::QueryResult] - # The result of the conversational query. - # @!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 - # {::Google::Cloud::Dialogflow::CX::V3::QueryResult#response_messages `query_result.response_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::CX::V3::OutputAudioConfig] - # The config used by the speech synthesizer to generate the output audio. - # @!attribute [rw] response_type - # @return [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse::ResponseType] - # Response type. - # @!attribute [rw] allow_cancellation - # @return [::Boolean] - # Indicates whether the partial response can be cancelled when a later - # response arrives. e.g. if the agent specified some music as partial - # response, it can be cancelled. - class DetectIntentResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents different DetectIntentResponse types. - module ResponseType - # Not specified. This should never happen. - RESPONSE_TYPE_UNSPECIFIED = 0 - - # Partial response. e.g. Aggregated responses in a Fulfillment that enables - # `return_partial_response` can be returned as partial response. - # WARNING: partial response is not eligible for barge-in. - PARTIAL = 1 - - # Final response. - FINAL = 2 - end - end - - # The top-level message sent by the client to the - # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#streaming_detect_intent Sessions.StreamingDetectIntent} - # method. - # - # Multiple request messages should be sent in order: - # - # 1. The first message must contain - # {::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest#session session}, - # {::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest#query_input query_input} - # plus optionally - # {::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest#query_params query_params}. - # If the client wants to receive an audio response, it should also contain - # {::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest#output_audio_config output_audio_config}. - # - # 2. If - # {::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest#query_input query_input} - # was set to - # {::Google::Cloud::Dialogflow::CX::V3::AudioInput#config query_input.audio.config}, - # all subsequent messages must contain - # {::Google::Cloud::Dialogflow::CX::V3::AudioInput#audio query_input.audio.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::CX::V3::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] - # The name of the session this query is sent to. - # Format: - # `projects//locations//agents//sessions/` - # or - # `projects//locations//agents//environments//sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. - # 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 of the `Session ID` must not exceed 36 characters. - # Note: session must be set in the first request. - # - # For more information, see the [sessions - # guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). - # - # Note: Always use agent versions for production traffic. - # See [Versions and - # environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). - # @!attribute [rw] query_params - # @return [::Google::Cloud::Dialogflow::CX::V3::QueryParameters] - # The parameters of this query. - # @!attribute [rw] query_input - # @return [::Google::Cloud::Dialogflow::CX::V3::QueryInput] - # Required. The input specification. - # @!attribute [rw] output_audio_config - # @return [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig] - # Instructs the speech synthesizer how to generate the output audio. - # @!attribute [rw] enable_partial_response - # @return [::Boolean] - # Enable partial detect intent response. If this flag is not enabled, - # response stream still contains only one final `DetectIntentResponse` even - # if some `Fulfillment`s in the agent have been configured to return partial - # responses. - # @!attribute [rw] enable_debugging_info - # @return [::Boolean] - # If true, `StreamingDetectIntentResponse.debugging_info` will get populated. - # @!attribute [rw] response_view - # @return [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponseView] - # Optional. Specifies which fields in the - # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} to return. If not - # set, the default is DETECT_INTENT_RESPONSE_VIEW_FULL. - 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 - # {::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#streaming_detect_intent StreamingDetectIntent} - # method. - # - # Multiple response messages can be returned in order: - # - # * If the `StreamingDetectIntentRequest.query_input.audio` field was - # set, the first M 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`. - # - # * If the `StreamingDetectIntentRequest.enable_partial_response` field was - # true, the `detect_intent_response` field is populated for each - # of the following N responses, where 0 <= N <= 5. - # These responses set the - # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse#response_type DetectIntentResponse.response_type} - # field to `PARTIAL`. - # - # For the last response message, the `detect_intent_response` is fully - # populated, and - # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse#response_type DetectIntentResponse.response_type} - # is set to `FINAL`. - # @!attribute [rw] recognition_result - # @return [::Google::Cloud::Dialogflow::CX::V3::StreamingRecognitionResult] - # The result of speech recognition. - # - # Note: The following fields are mutually exclusive: `recognition_result`, `detect_intent_response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] detect_intent_response - # @return [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse] - # The response from detect intent. - # - # Note: The following fields are mutually exclusive: `detect_intent_response`, `recognition_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] debugging_info - # @return [::Google::Cloud::Dialogflow::CX::V3::CloudConversationDebuggingInfo] - # Debugging info that would get populated when - # `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 7 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 - # ``` - # - # 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::CX::V3::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] stability - # @return [::Float] - # An estimate of the likelihood that the speech recognizer will - # not change its guess about this interim recognition result: - # * If the value is unspecified or 0.0, Dialogflow didn't compute the - # stability. In particular, Dialogflow will only provide stability for - # `TRANSCRIPT` results with `is_final = false`. - # * Otherwise, the value is in (0.0, 1.0] where 0.0 means completely - # unstable and 1.0 means completely stable. - # @!attribute [rw] speech_word_info - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::SpeechWordInfo>] - # Word-specific information for the words recognized by Speech in - # {::Google::Cloud::Dialogflow::CX::V3::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 speech. 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 - # {::Google::Cloud::Dialogflow::CX::V3::InputAudioConfig#single_utterance `single_utterance`} - # was set to `true`, and is not used otherwise. - END_OF_SINGLE_UTTERANCE = 2 - end - end - - # Represents the parameters of a 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 the agent is - # used. - # @!attribute [rw] geo_location - # @return [::Google::Type::LatLng] - # The geo location of this conversational query. - # @!attribute [rw] session_entity_types - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::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 into the webhook associated with - # the agent. Arbitrary JSON objects are supported. - # 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" - # } - # } - # ``` - # @!attribute [rw] parameters - # @return [::Google::Protobuf::Struct] - # Additional parameters to be put into [session - # parameters][SessionInfo.parameters]. To remove a - # parameter from the session, clients should explicitly set the parameter - # value to null. - # - # You can reference the session parameters in the agent with the following - # format: $session.params.parameter-id. - # - # 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] parameter_scope - # @return [::String] - # Scope for the parameters. If not specified, parameters will be treated as - # session parameters. Parameters with custom scope will not be put into - # {::Google::Cloud::Dialogflow::CX::V3::SessionInfo#parameters session parameters}. - # - # You can reference the parameters with custom scope in the agent with the - # following format: $parameter-scope.params.parameter-id. - # @!attribute [rw] current_page - # @return [::String] - # The unique identifier of the {::Google::Cloud::Dialogflow::CX::V3::Page page} to - # override the [current page][QueryResult.current_page] in the session. - # Format: - # `projects//locations//agents//flows//pages/`. - # - # If `current_page` is specified, the previous state of the session will be - # ignored by Dialogflow, including the [previous - # page][QueryResult.current_page] and the [previous session - # parameters][QueryResult.parameters]. - # In most cases, - # {::Google::Cloud::Dialogflow::CX::V3::QueryParameters#current_page current_page} - # and {::Google::Cloud::Dialogflow::CX::V3::QueryParameters#parameters parameters} - # should be configured together to direct a session to a specific state. - # @!attribute [rw] disable_webhook - # @return [::Boolean] - # Whether to disable webhook calls for this request. - # @!attribute [rw] analyze_query_text_sentiment - # @return [::Boolean] - # Configures whether sentiment analysis should be performed. 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 Dialogflow web console. The headers defined - # within this field will overwrite the headers configured through 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] flow_versions - # @return [::Array<::String>] - # A list of flow versions to override for the request. - # Format: - # `projects//locations//agents//flows//versions/`. - # - # If version 1 of flow X is included in this list, the traffic of - # flow X will go through version 1 regardless of the version configuration in - # the environment. Each flow can have at most one version specified in this - # list. - # @!attribute [rw] current_playbook - # @return [::String] - # Optional. The unique identifier of the - # {::Google::Cloud::Dialogflow::CX::V3::Playbook playbook} to start or continue the - # session with. If `current_playbook` is specified, the previous state of the - # session will be ignored by Dialogflow. - # - # Format: - # `projects//locations//agents//playbooks/`. - # @!attribute [rw] llm_model_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::LlmModelSettings] - # Optional. Use the specified LLM model settings for processing the request. - # @!attribute [rw] channel - # @return [::String] - # The channel which this query is for. - # - # If specified, only the - # {::Google::Cloud::Dialogflow::CX::V3::ResponseMessage ResponseMessage} associated - # with the channel will be returned. If no - # {::Google::Cloud::Dialogflow::CX::V3::ResponseMessage ResponseMessage} is - # associated with the channel, it falls back to the - # {::Google::Cloud::Dialogflow::CX::V3::ResponseMessage ResponseMessage} with - # unspecified channel. - # - # If unspecified, the - # {::Google::Cloud::Dialogflow::CX::V3::ResponseMessage ResponseMessage} with - # unspecified channel will be returned. - # @!attribute [rw] session_ttl - # @return [::Google::Protobuf::Duration] - # Optional. Configure lifetime of the Dialogflow session. - # By default, a Dialogflow 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. - # @!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::CX::V3::SearchConfig] - # Optional. Search configuration for UCS search queries. - # @!attribute [rw] populate_data_store_connection_signals - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # Optional. If set to true and data stores are involved in serving the - # request then - # DetectIntentResponse.query_result.data_store_connection_signals - # will be filled with data that can help evaluations. - 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 - - # Search configuration for UCS search queries. - # @!attribute [rw] boost_specs - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::BoostSpecs>] - # Optional. Boosting configuration for the datastores. - # - # 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::CX::V3::FilterSpecs>] - # Optional. Filter configuration for the datastores. - # - # Maps 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 - end - - # 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::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::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 - - # 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::CX::V3::BoostSpec>] - # Optional. A list of boosting specifications. - class BoostSpecs - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Filter 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] 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 - - # Represents the query input. It can contain one of: - # - # 1. A conversational query in the form of text. - # - # 2. An intent query that specifies which intent to trigger. - # - # 3. Natural language speech audio to be processed. - # - # 4. An event to be triggered. - # - # 5. DTMF digits to invoke an intent and fill in parameter value. - # - # 6. The results of a tool executed by the client. - # @!attribute [rw] text - # @return [::Google::Cloud::Dialogflow::CX::V3::TextInput] - # The natural language text to be processed. - # - # Note: The following fields are mutually exclusive: `text`, `intent`, `audio`, `event`, `dtmf`, `tool_call_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] intent - # @return [::Google::Cloud::Dialogflow::CX::V3::IntentInput] - # The intent to be triggered. - # - # Note: The following fields are mutually exclusive: `intent`, `text`, `audio`, `event`, `dtmf`, `tool_call_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] audio - # @return [::Google::Cloud::Dialogflow::CX::V3::AudioInput] - # The natural language speech audio to be processed. - # - # Note: The following fields are mutually exclusive: `audio`, `text`, `intent`, `event`, `dtmf`, `tool_call_result`. 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::CX::V3::EventInput] - # The event to be triggered. - # - # Note: The following fields are mutually exclusive: `event`, `text`, `intent`, `audio`, `dtmf`, `tool_call_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] dtmf - # @return [::Google::Cloud::Dialogflow::CX::V3::DtmfInput] - # The DTMF event to be handled. - # - # Note: The following fields are mutually exclusive: `dtmf`, `text`, `intent`, `audio`, `event`, `tool_call_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] tool_call_result - # @return [::Google::Cloud::Dialogflow::CX::V3::ToolCallResult] - # The results of a tool executed by the client. - # - # Note: The following fields are mutually exclusive: `tool_call_result`, `text`, `intent`, `audio`, `event`, `dtmf`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] language_code - # @return [::String] - # Required. The language of the input. See [Language - # Support](https://cloud.google.com/dialogflow/cx/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 QueryInput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the result of a conversational query. - # @!attribute [rw] text - # @return [::String] - # If {::Google::Cloud::Dialogflow::CX::V3::TextInput natural language text} was - # provided as input, this field will contain a copy of the text. - # - # Note: The following fields are mutually exclusive: `text`, `trigger_intent`, `transcript`, `trigger_event`, `dtmf`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] trigger_intent - # @return [::String] - # If an {::Google::Cloud::Dialogflow::CX::V3::IntentInput intent} was provided as - # input, this field will contain a copy of the intent identifier. Format: - # `projects//locations//agents//intents/`. - # - # Note: The following fields are mutually exclusive: `trigger_intent`, `text`, `transcript`, `trigger_event`, `dtmf`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] transcript - # @return [::String] - # If [natural language speech - # audio][google.cloud.dialogflow.cx.v3.AudioInput] was provided as input, - # this field will contain the transcript for the audio. - # - # Note: The following fields are mutually exclusive: `transcript`, `text`, `trigger_intent`, `trigger_event`, `dtmf`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] trigger_event - # @return [::String] - # If an {::Google::Cloud::Dialogflow::CX::V3::EventInput event} was provided as - # input, this field will contain the name of the event. - # - # Note: The following fields are mutually exclusive: `trigger_event`, `text`, `trigger_intent`, `transcript`, `dtmf`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] dtmf - # @return [::Google::Cloud::Dialogflow::CX::V3::DtmfInput] - # If a {::Google::Cloud::Dialogflow::CX::V3::DtmfInput DTMF} was provided as - # input, this field will contain a copy of the - # {::Google::Cloud::Dialogflow::CX::V3::DtmfInput DtmfInput}. - # - # Note: The following fields are mutually exclusive: `dtmf`, `text`, `trigger_intent`, `transcript`, `trigger_event`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] language_code - # @return [::String] - # The language that was triggered during intent detection. - # See [Language - # Support](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # for a list of the currently supported language codes. - # @!attribute [rw] parameters - # @return [::Google::Protobuf::Struct] - # The collected [session - # parameters][google.cloud.dialogflow.cx.v3.SessionInfo.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] response_messages - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ResponseMessage>] - # The list of rich messages returned to the client. Responses vary from - # simple text messages to more sophisticated, structured payloads used - # to drive complex logic. - # @!attribute [rw] webhook_statuses - # @return [::Array<::Google::Rpc::Status>] - # The list of webhook call status in the order of call sequence. - # @!attribute [rw] webhook_payloads - # @return [::Array<::Google::Protobuf::Struct>] - # The list of webhook payload in - # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse#payload WebhookResponse.payload}, - # in the order of call sequence. If some webhook call fails or doesn't return - # any payload, an empty `Struct` would be used instead. - # @!attribute [rw] current_page - # @return [::Google::Cloud::Dialogflow::CX::V3::Page] - # The current {::Google::Cloud::Dialogflow::CX::V3::Page Page}. Some, not all - # fields are filled in this message, including but not limited to `name` and - # `display_name`. - # @!attribute [rw] current_flow - # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] - # The current {::Google::Cloud::Dialogflow::CX::V3::Flow Flow}. Some, not all - # fields are filled in this message, including but not limited to `name` and - # `display_name`. - # @!attribute [rw] intent - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] - # The {::Google::Cloud::Dialogflow::CX::V3::Intent Intent} that matched the - # conversational query. Some, not all fields are filled in this message, - # including but not limited to: `name` and `display_name`. This field is - # deprecated, please use - # {::Google::Cloud::Dialogflow::CX::V3::QueryResult#match QueryResult.match} - # instead. - # @!attribute [rw] intent_detection_confidence - # @deprecated This field is deprecated and may be removed in the next major version update. - # @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. - # This field is deprecated, please use - # {::Google::Cloud::Dialogflow::CX::V3::QueryResult#match QueryResult.match} - # instead. - # @!attribute [rw] match - # @return [::Google::Cloud::Dialogflow::CX::V3::Match] - # Intent match result, could be an intent or an event. - # @!attribute [rw] diagnostic_info - # @return [::Google::Protobuf::Struct] - # The free-form diagnostic info. For example, this field could contain - # webhook call latency. The fields of this data can change without notice, - # so you should not write code that depends on its structure. - # - # One of the fields is called "Alternative Matched Intents", which may - # aid with debugging. The following describes these intent results: - # - # - The list is empty if no intent was matched to end-user input. - # - Only intents that are referenced in the currently active flow are - # included. - # - The matched intent is included. - # - Other intents that could have matched end-user input, but did not match - # because they are referenced by intent routes that are out of - # [scope](https://cloud.google.com/dialogflow/cx/docs/concept/handler#scope), - # are included. - # - Other intents referenced by intent routes in scope that matched end-user - # input, but had a lower confidence score. - # @!attribute [rw] sentiment_analysis_result - # @return [::Google::Cloud::Dialogflow::CX::V3::SentimentAnalysisResult] - # The sentiment analyss result, which depends on - # [`analyze_query_text_sentiment`] - # [google.cloud.dialogflow.cx.v3.QueryParameters.analyze_query_text_sentiment], - # specified in the request. - # @!attribute [rw] advanced_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::AdvancedSettings] - # Returns the current advanced settings including IVR settings. Even though - # the operations configured by these settings are performed by Dialogflow, - # the client may need to perform special logic at the moment. For example, if - # Dialogflow exports audio to Google Cloud Storage, then the client may need - # to wait for the resulting object to appear in the bucket before proceeding. - # @!attribute [rw] allow_answer_feedback - # @return [::Boolean] - # Indicates whether the Thumbs up/Thumbs down rating controls are need to be - # shown for the response in the Dialogflow Messenger widget. - # @!attribute [rw] data_store_connection_signals - # @return [::Google::Cloud::Dialogflow::CX::V3::DataStoreConnectionSignals] - # Optional. Data store connection feature output signals. - # Filled only when data stores are involved in serving the query. - class QueryResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the natural language text to be processed. - # @!attribute [rw] text - # @return [::String] - # Required. The UTF-8 encoded natural language text to be processed. - class TextInput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the intent to trigger programmatically rather than as a result of - # natural language processing. - # @!attribute [rw] intent - # @return [::String] - # Required. The unique identifier of the intent. - # Format: - # `projects//locations//agents//intents/`. - class IntentInput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the natural speech audio to be processed. - # @!attribute [rw] config - # @return [::Google::Cloud::Dialogflow::CX::V3::InputAudioConfig] - # Required. Instructs the speech recognizer how to process the speech audio. - # @!attribute [rw] audio - # @return [::String] - # The natural language speech audio to be processed. - # A single request can contain up to 2 minutes of speech audio data. - # The [transcribed - # text][google.cloud.dialogflow.cx.v3.QueryResult.transcript] cannot contain - # more than 256 bytes. - # - # For non-streaming audio detect intent, both `config` and `audio` must be - # provided. - # For streaming audio detect intent, `config` must be provided in - # the first request and `audio` must be provided in all following requests. - class AudioInput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the event to trigger. - # @!attribute [rw] event - # @return [::String] - # Name of the event. - class EventInput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the input for dtmf event. - # @!attribute [rw] digits - # @return [::String] - # The dtmf digits. - # @!attribute [rw] finish_digit - # @return [::String] - # The finish digit (if any). - class DtmfInput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents one match result of [MatchIntent][]. - # @!attribute [rw] intent - # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] - # The {::Google::Cloud::Dialogflow::CX::V3::Intent Intent} that matched the query. - # Some, not all fields are filled in this message, including but not limited - # to: `name` and `display_name`. Only filled for - # {::Google::Cloud::Dialogflow::CX::V3::Match::MatchType `INTENT`} match type. - # @!attribute [rw] event - # @return [::String] - # The event that matched the query. Filled for - # {::Google::Cloud::Dialogflow::CX::V3::Match::MatchType `EVENT`}, - # {::Google::Cloud::Dialogflow::CX::V3::Match::MatchType `NO_MATCH`} and - # {::Google::Cloud::Dialogflow::CX::V3::Match::MatchType `NO_INPUT`} match types. - # @!attribute [rw] parameters - # @return [::Google::Protobuf::Struct] - # The collection of parameters extracted from the query. - # - # 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] resolved_input - # @return [::String] - # Final text input which was matched during MatchIntent. This value can be - # different from original input sent in request because of spelling - # correction or other processing. - # @!attribute [rw] match_type - # @return [::Google::Cloud::Dialogflow::CX::V3::Match::MatchType] - # Type of this {::Google::Cloud::Dialogflow::CX::V3::Match Match}. - # @!attribute [rw] confidence - # @return [::Float] - # The confidence of this match. 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. - class Match - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Type of a Match. - module MatchType - # Not specified. Should never be used. - MATCH_TYPE_UNSPECIFIED = 0 - - # The query was matched to an intent. - INTENT = 1 - - # The query directly triggered an intent. - DIRECT_INTENT = 2 - - # The query was used for parameter filling. - PARAMETER_FILLING = 3 - - # No match was found for the query. - NO_MATCH = 4 - - # Indicates an empty query. - NO_INPUT = 5 - - # The query directly triggered an event. - EVENT = 6 - - # The query was matched to a Knowledge Connector answer. - KNOWLEDGE_CONNECTOR = 8 - - # The query was handled by a - # {::Google::Cloud::Dialogflow::CX::V3::Playbook `Playbook`}. - PLAYBOOK = 9 - end - end - - # Request of [MatchIntent][]. - # @!attribute [rw] session - # @return [::String] - # Required. The name of the session this query is sent to. - # Format: - # `projects//locations//agents//sessions/` - # or - # `projects//locations//agents//environments//sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. - # 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 of the `Session ID` must not exceed 36 characters. - # - # For more information, see the [sessions - # guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). - # @!attribute [rw] query_params - # @return [::Google::Cloud::Dialogflow::CX::V3::QueryParameters] - # The parameters of this query. - # @!attribute [rw] query_input - # @return [::Google::Cloud::Dialogflow::CX::V3::QueryInput] - # Required. The input specification. - # @!attribute [rw] persist_parameter_changes - # @return [::Boolean] - # Persist session parameter changes from `query_params`. - class MatchIntentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response of [MatchIntent][]. - # @!attribute [rw] text - # @return [::String] - # If {::Google::Cloud::Dialogflow::CX::V3::TextInput natural language text} was - # provided as input, this field will contain a copy of the text. - # - # Note: The following fields are mutually exclusive: `text`, `trigger_intent`, `transcript`, `trigger_event`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] trigger_intent - # @return [::String] - # If an {::Google::Cloud::Dialogflow::CX::V3::IntentInput intent} was provided as - # input, this field will contain a copy of the intent identifier. Format: - # `projects//locations//agents//intents/`. - # - # Note: The following fields are mutually exclusive: `trigger_intent`, `text`, `transcript`, `trigger_event`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] transcript - # @return [::String] - # If [natural language speech - # audio][google.cloud.dialogflow.cx.v3.AudioInput] was provided as input, - # this field will contain the transcript for the audio. - # - # Note: The following fields are mutually exclusive: `transcript`, `text`, `trigger_intent`, `trigger_event`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] trigger_event - # @return [::String] - # If an {::Google::Cloud::Dialogflow::CX::V3::EventInput event} was provided as - # input, this field will contain a copy of the event name. - # - # Note: The following fields are mutually exclusive: `trigger_event`, `text`, `trigger_intent`, `transcript`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] matches - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Match>] - # Match results, if more than one, ordered descendingly by the confidence - # we have that the particular intent matches the query. - # @!attribute [rw] current_page - # @return [::Google::Cloud::Dialogflow::CX::V3::Page] - # The current {::Google::Cloud::Dialogflow::CX::V3::Page Page}. Some, not all - # fields are filled in this message, including but not limited to `name` and - # `display_name`. - class MatchIntentResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request of [FulfillIntent][] - # @!attribute [rw] match_intent_request - # @return [::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest] - # Must be same as the corresponding MatchIntent request, otherwise the - # behavior is undefined. - # @!attribute [rw] match - # @return [::Google::Cloud::Dialogflow::CX::V3::Match] - # The matched intent/event to fulfill. - # @!attribute [rw] output_audio_config - # @return [::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig] - # Instructs the speech synthesizer how to generate output audio. - class FulfillIntentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response of [FulfillIntent][] - # @!attribute [rw] response_id - # @return [::String] - # Output only. 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::CX::V3::QueryResult] - # The result of the conversational query. - # @!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 - # {::Google::Cloud::Dialogflow::CX::V3::QueryResult#response_messages `query_result.response_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::CX::V3::OutputAudioConfig] - # The config used by the speech synthesizer to generate the output audio. - class FulfillIntentResponse - 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. - # @!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 SentimentAnalysisResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response view specifies which fields in the - # {::Google::Cloud::Dialogflow::CX::V3::QueryResult QueryResult} to return. - module DetectIntentResponseView - # Not specified. `DETECT_INTENT_RESPONSE_VIEW_DEFAULT` will be used. - DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED = 0 - - # Full response view includes all fields. - DETECT_INTENT_RESPONSE_VIEW_FULL = 1 - - # Basic response view omits the following fields: - # - - # {::Google::Cloud::Dialogflow::CX::V3::QueryResult#diagnostic_info QueryResult.diagnostic_info} - DETECT_INTENT_RESPONSE_VIEW_BASIC = 2 - - # Default response view omits the following fields: - # - - # [QueryResult.trace_blocks][google.cloud.dialogflow.cx.v3.QueryResult.trace_blocks] - DETECT_INTENT_RESPONSE_VIEW_DEFAULT = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/session_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/session_entity_type.rb deleted file mode 100644 index 0c36904bb5b1..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/session_entity_type.rb +++ /dev/null @@ -1,193 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - # Session entity types are referred to as **User** entity types and are - # entities that are built for an individual user such as favorites, - # preferences, playlists, and so on. - # - # You can redefine a session entity type at the session level to extend or - # replace a {::Google::Cloud::Dialogflow::CX::V3::EntityType custom entity type} at - # the user session level (we refer to the entity types defined at the agent - # level as "custom entity types"). - # - # Note: session entity types apply to all queries, regardless of the language. - # - # For more information about entity types, see the [Dialogflow - # documentation](https://cloud.google.com/dialogflow/docs/entities-overview). - # @!attribute [rw] name - # @return [::String] - # Required. The unique identifier of the session entity type. - # Format: - # `projects//locations//agents//sessions//entityTypes/` - # or - # `projects//locations//agents//environments//sessions//entityTypes/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. - # @!attribute [rw] entity_override_mode - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityType::Entity>] - # Required. The collection of entities to override or supplement the custom - # entity type. - class SessionEntityType - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The types of modifications for the 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::CX::V3::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::CX::V3::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//locations//agents//sessions/` - # or - # `projects//locations//agents//environments//sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. - # @!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 ListSessionEntityTypesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client#list_session_entity_types SessionEntityTypes.ListSessionEntityTypes}. - # @!attribute [rw] session_entity_types - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityTypes::Client#get_session_entity_type SessionEntityTypes.GetSessionEntityType}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the session entity type. - # Format: - # `projects//locations//agents//sessions//entityTypes/` - # or - # `projects//locations//agents//environments//sessions//entityTypes/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. - class GetSessionEntityTypeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::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//locations//agents//sessions/` - # or - # `projects//locations//agents//environments//sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. - # @!attribute [rw] session_entity_type - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityTypes::Client#update_session_entity_type SessionEntityTypes.UpdateSessionEntityType}. - # @!attribute [rw] session_entity_type - # @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] - # Required. The session entity type to update. - # Format: - # `projects//locations//agents//sessions//entityTypes/` - # or - # `projects//locations//agents//environments//sessions//entityTypes/`. - # If `Environment ID` is not specified, - # we assume default 'draft' environment. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # 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::CX::V3::SessionEntityTypes::Client#delete_session_entity_type SessionEntityTypes.DeleteSessionEntityType}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the session entity type to delete. - # Format: - # `projects//locations//agents//sessions//entityTypes/` - # or - # `projects//locations//agents//environments//sessions//entityTypes/`. - # If `Environment ID` is not specified, - # we assume default 'draft' environment. - class DeleteSessionEntityTypeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/test_case.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/test_case.rb deleted file mode 100644 index 474fed46f6a6..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/test_case.rb +++ /dev/null @@ -1,835 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - # Represents a test case. - # @!attribute [rw] name - # @return [::String] - # The unique identifier of the test case. - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#create_test_case TestCases.CreateTestCase} - # will populate the name automatically. Otherwise use format: - # `projects//locations//agents//testCases/`. - # @!attribute [rw] tags - # @return [::Array<::String>] - # Tags are short descriptions that users may apply to test cases for - # organizational and filtering purposes. Each tag should start with "#" and - # has a limit of 30 characters. - # @!attribute [rw] display_name - # @return [::String] - # Required. The human-readable name of the test case, unique within the - # agent. Limit of 200 characters. - # @!attribute [rw] notes - # @return [::String] - # Additional freeform notes about the test case. Limit of 400 characters. - # @!attribute [rw] test_config - # @return [::Google::Cloud::Dialogflow::CX::V3::TestConfig] - # Config for the test case. - # @!attribute [rw] test_case_conversation_turns - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ConversationTurn>] - # The conversation turns uttered when the test case was created, in - # chronological order. These include the canonical set of agent utterances - # that should occur when the agent is working properly. - # @!attribute [r] creation_time - # @return [::Google::Protobuf::Timestamp] - # Output only. When the test was created. - # @!attribute [rw] last_test_result - # @return [::Google::Cloud::Dialogflow::CX::V3::TestCaseResult] - # The latest test result. - class TestCase - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a result from running a test case in an agent environment. - # @!attribute [rw] name - # @return [::String] - # The resource name for the test case result. Format: - # `projects//locations//agents//testCases//results/`. - # @!attribute [rw] environment - # @return [::String] - # Environment where the test was run. If not set, it indicates the draft - # environment. - # @!attribute [rw] conversation_turns - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ConversationTurn>] - # The conversation turns uttered during the test case replay in chronological - # order. - # @!attribute [rw] test_result - # @return [::Google::Cloud::Dialogflow::CX::V3::TestResult] - # Whether the test case passed in the agent environment. - # @!attribute [rw] test_time - # @return [::Google::Protobuf::Timestamp] - # The time that the test was run. - class TestCaseResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents configurations for a test case. - # @!attribute [rw] tracking_parameters - # @return [::Array<::String>] - # Session parameters to be compared when calculating differences. - # @!attribute [rw] flow - # @return [::String] - # Flow name to start the test case with. - # Format: - # `projects//locations//agents//flows/`. - # - # Only one of `flow` and `page` should be set to indicate the starting point - # of the test case. If neither is set, the test case will start with start - # page on the default start flow. - # @!attribute [rw] page - # @return [::String] - # The {::Google::Cloud::Dialogflow::CX::V3::Page page} to start the test case with. - # Format: - # `projects//locations//agents//flows//pages/`. - # - # Only one of `flow` and `page` should be set to indicate the starting point - # of the test case. If neither is set, the test case will start with start - # page on the default start flow. - class TestConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One interaction between a human and virtual agent. The human provides some - # input and the virtual agent provides a response. - # @!attribute [rw] user_input - # @return [::Google::Cloud::Dialogflow::CX::V3::ConversationTurn::UserInput] - # The user input. - # @!attribute [rw] virtual_agent_output - # @return [::Google::Cloud::Dialogflow::CX::V3::ConversationTurn::VirtualAgentOutput] - # The virtual agent output. - class ConversationTurn - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The input from the human user. - # @!attribute [rw] input - # @return [::Google::Cloud::Dialogflow::CX::V3::QueryInput] - # Supports {::Google::Cloud::Dialogflow::CX::V3::QueryInput#text text input}, - # {::Google::Cloud::Dialogflow::CX::V3::QueryInput#event event input}, [dtmf - # input][google.cloud.dialogflow.cx.v3.QueryInput.dtmf] in the test case. - # @!attribute [rw] injected_parameters - # @return [::Google::Protobuf::Struct] - # Parameters that need to be injected into the conversation during intent - # detection. - # @!attribute [rw] is_webhook_enabled - # @return [::Boolean] - # If webhooks should be allowed to trigger in response to the user - # utterance. Often if parameters are injected, webhooks should not be - # enabled. - # @!attribute [rw] enable_sentiment_analysis - # @return [::Boolean] - # Whether sentiment analysis is enabled. - class UserInput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The output from the virtual agent. - # @!attribute [rw] session_parameters - # @return [::Google::Protobuf::Struct] - # The session parameters available to the bot at this point. - # @!attribute [r] differences - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TestRunDifference>] - # Output only. If this is part of a [result conversation - # turn][TestCaseResult.conversation_turns], the list of differences - # between the original run and the replay for this output, if any. - # @!attribute [rw] diagnostic_info - # @return [::Google::Protobuf::Struct] - # Required. Input only. The diagnostic - # [info][Session.DetectIntentResponse.QueryResult.diagnostic_info] - # output for the turn. Required to calculate the testing coverage. - # @!attribute [rw] triggered_intent - # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] - # The {::Google::Cloud::Dialogflow::CX::V3::Intent Intent} that triggered the - # response. Only name and displayName will be set. - # @!attribute [rw] current_page - # @return [::Google::Cloud::Dialogflow::CX::V3::Page] - # The {::Google::Cloud::Dialogflow::CX::V3::Page Page} on which the utterance was - # spoken. Only name and displayName will be set. - # @!attribute [rw] text_responses - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::Text>] - # The {::Google::Cloud::Dialogflow::CX::V3::ResponseMessage::Text text} responses - # from the agent for the turn. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # Response error from the agent in the test result. If set, other output - # is empty. - class VirtualAgentOutput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The description of differences between original and replayed agent output. - # @!attribute [rw] type - # @return [::Google::Cloud::Dialogflow::CX::V3::TestRunDifference::DiffType] - # The type of diff. - # @!attribute [rw] description - # @return [::String] - # A human readable description of the diff, showing the actual output vs - # expected output. - class TestRunDifference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # What part of the message replay differs from the test case. - module DiffType - # Should never be used. - DIFF_TYPE_UNSPECIFIED = 0 - - # The intent. - INTENT = 1 - - # The page. - PAGE = 2 - - # The parameters. - PARAMETERS = 3 - - # The message utterance. - UTTERANCE = 4 - - # The flow. - FLOW = 5 - end - end - - # Transition coverage represents the percentage of all possible page - # transitions (page-level transition routes and event handlers, excluding - # transition route groups) present within any of a parent's test cases. - # @!attribute [rw] transitions - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TransitionCoverage::Transition>] - # The list of Transitions present in the agent. - # @!attribute [rw] coverage_score - # @return [::Float] - # The percent of transitions in the agent that are covered. - class TransitionCoverage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The source or target of a transition. - # @!attribute [rw] page - # @return [::Google::Cloud::Dialogflow::CX::V3::Page] - # Indicates a transition to a {::Google::Cloud::Dialogflow::CX::V3::Page Page}. - # Only some fields such as name and displayname will be set. - # - # Note: The following fields are mutually exclusive: `page`, `flow`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] flow - # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] - # Indicates a transition to a {::Google::Cloud::Dialogflow::CX::V3::Flow Flow}. - # Only some fields such as name and displayname will be set. - # - # Note: The following fields are mutually exclusive: `flow`, `page`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class TransitionNode - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A transition in a page. - # @!attribute [rw] source - # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionCoverage::TransitionNode] - # The start node of a transition. - # @!attribute [rw] index - # @return [::Integer] - # The index of a transition in the transition list. Starting from 0. - # @!attribute [rw] target - # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionCoverage::TransitionNode] - # The end node of a transition. - # @!attribute [rw] covered - # @return [::Boolean] - # Whether the transition is covered by at least one of the - # agent's test cases. - # @!attribute [rw] transition_route - # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRoute] - # Intent route or condition route. - # - # Note: The following fields are mutually exclusive: `transition_route`, `event_handler`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] event_handler - # @return [::Google::Cloud::Dialogflow::CX::V3::EventHandler] - # Event handler. - # - # Note: The following fields are mutually exclusive: `event_handler`, `transition_route`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Transition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Transition route group coverage represents the percentage of all possible - # transition routes present within any of a parent's test cases. The results - # are grouped by the transition route group. - # @!attribute [rw] coverages - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroupCoverage::Coverage>] - # Transition route group coverages. - # @!attribute [rw] coverage_score - # @return [::Float] - # The percent of transition routes in all the transition route groups that - # are covered. - class TransitionRouteGroupCoverage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Coverage result message for one transition route group. - # @!attribute [rw] route_group - # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] - # Transition route group metadata. Only name and displayName will be set. - # @!attribute [rw] transitions - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroupCoverage::Coverage::Transition>] - # The list of transition routes and coverage in the transition route group. - # @!attribute [rw] coverage_score - # @return [::Float] - # The percent of transition routes in the transition route group that are - # covered. - class Coverage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A transition coverage in a transition route group. - # @!attribute [rw] transition_route - # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRoute] - # Intent route or condition route. - # @!attribute [rw] covered - # @return [::Boolean] - # Whether the transition route is covered by at least one of the - # agent's test cases. - class Transition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Intent coverage represents the percentage of all possible intents in the - # agent that are triggered in any of a parent's test cases. - # @!attribute [rw] intents - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::IntentCoverage::Intent>] - # The list of Intents present in the agent - # @!attribute [rw] coverage_score - # @return [::Float] - # The percent of intents in the agent that are covered. - class IntentCoverage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The agent's intent. - # @!attribute [rw] intent - # @return [::String] - # The intent full resource name - # @!attribute [rw] covered - # @return [::Boolean] - # Whether the intent is covered by at least one of the agent's - # test cases. - class Intent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#calculate_coverage TestCases.CalculateCoverage}. - # @!attribute [rw] agent - # @return [::String] - # Required. The agent to calculate coverage for. - # Format: `projects//locations//agents/`. - # @!attribute [rw] type - # @return [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest::CoverageType] - # Required. The type of coverage requested. - class CalculateCoverageRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of coverage score requested. - module CoverageType - # Should never be used. - COVERAGE_TYPE_UNSPECIFIED = 0 - - # Intent coverage. - INTENT = 1 - - # Page transition coverage. - PAGE_TRANSITION = 2 - - # Transition route group coverage. - TRANSITION_ROUTE_GROUP = 3 - end - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#calculate_coverage TestCases.CalculateCoverage}. - # @!attribute [rw] agent - # @return [::String] - # The agent to calculate coverage for. - # Format: `projects//locations//agents/`. - # @!attribute [rw] intent_coverage - # @return [::Google::Cloud::Dialogflow::CX::V3::IntentCoverage] - # Intent coverage. - # - # Note: The following fields are mutually exclusive: `intent_coverage`, `transition_coverage`, `route_group_coverage`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] transition_coverage - # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionCoverage] - # Transition (excluding transition route groups) coverage. - # - # Note: The following fields are mutually exclusive: `transition_coverage`, `intent_coverage`, `route_group_coverage`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] route_group_coverage - # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroupCoverage] - # Transition route group coverage. - # - # Note: The following fields are mutually exclusive: `route_group_coverage`, `intent_coverage`, `transition_coverage`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class CalculateCoverageResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_cases TestCases.ListTestCases}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to list all pages for. - # Format: `projects//locations//agents/`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return in a single page. By default 20. - # Note that when TestCaseView = FULL, the maximum page size allowed is 20. - # When TestCaseView = BASIC, the maximum page size allowed is 500. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token value returned from a previous list request. - # @!attribute [rw] view - # @return [::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest::TestCaseView] - # Specifies whether response should include all fields or just the metadata. - class ListTestCasesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specifies how much test case information to include in the response. - module TestCaseView - # The default / unset value. - # The API will default to the BASIC view. - TEST_CASE_VIEW_UNSPECIFIED = 0 - - # Include basic metadata about the test case, but not the conversation - # turns. This is the default value. - BASIC = 1 - - # Include everything. - FULL = 2 - end - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_cases TestCases.ListTestCases}. - # @!attribute [rw] test_cases - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TestCase>] - # The list of test cases. 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 ListTestCasesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_delete_test_cases TestCases.BatchDeleteTestCases}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to delete test cases from. - # Format: `projects//locations//agents/`. - # @!attribute [rw] names - # @return [::Array<::String>] - # Required. Format of test case names: - # `projects//locations//agents//testCases/`. - class BatchDeleteTestCasesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#create_test_case TestCases.CreateTestCase}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to create the test case for. - # Format: `projects//locations//agents/`. - # @!attribute [rw] test_case - # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] - # Required. The test case to create. - class CreateTestCaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#update_test_case TestCases.UpdateTestCase}. - # @!attribute [rw] test_case - # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] - # Required. The test case to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The mask to specify which fields should be updated. The - # {::Google::Cloud::Dialogflow::CX::V3::TestCase#creation_time `creationTime`} and - # {::Google::Cloud::Dialogflow::CX::V3::TestCase#last_test_result `lastTestResult`} - # cannot be updated. - class UpdateTestCaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#get_test_case TestCases.GetTestCase}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the testcase. - # Format: - # `projects//locations//agents//testCases/`. - class GetTestCaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#run_test_case TestCases.RunTestCase}. - # @!attribute [rw] name - # @return [::String] - # Required. Format of test case name to run: - # `projects//locations//agents//testCases/`. - # @!attribute [rw] environment - # @return [::String] - # Optional. Environment name. If not set, draft environment is assumed. - # Format: - # `projects//locations//agents//environments/`. - class RunTestCaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#run_test_case TestCases.RunTestCase}. - # @!attribute [rw] result - # @return [::Google::Cloud::Dialogflow::CX::V3::TestCaseResult] - # The result. - class RunTestCaseResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata returned for the - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#run_test_case TestCases.RunTestCase} - # long running operation. This message currently has no fields. - class RunTestCaseMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_run_test_cases TestCases.BatchRunTestCases}. - # @!attribute [rw] parent - # @return [::String] - # Required. Agent name. Format: - # `projects//locations//agents/`. - # @!attribute [rw] environment - # @return [::String] - # Optional. If not set, draft environment is assumed. Format: - # `projects//locations//agents//environments/`. - # @!attribute [rw] test_cases - # @return [::Array<::String>] - # Required. Format: - # `projects//locations//agents//testCases/`. - class BatchRunTestCasesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_run_test_cases TestCases.BatchRunTestCases}. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>] - # The test case results. The detailed - # [conversation - # turns][google.cloud.dialogflow.cx.v3.TestCaseResult.conversation_turns] are - # empty in this response. - class BatchRunTestCasesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata returned for the - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_run_test_cases TestCases.BatchRunTestCases} - # long running operation. - # @!attribute [rw] errors - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TestError>] - # The test errors. - class BatchRunTestCasesMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Error info for running a test. - # @!attribute [rw] test_case - # @return [::String] - # The test case resource name. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # The status associated with the test. - # @!attribute [rw] test_time - # @return [::Google::Protobuf::Timestamp] - # The timestamp when the test was completed. - class TestError - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#import_test_cases TestCases.ImportTestCases}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to import test cases to. - # Format: `projects//locations//agents/`. - # @!attribute [rw] gcs_uri - # @return [::String] - # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI - # to import test cases from. The format of this URI must be - # `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: `gcs_uri`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] content - # @return [::String] - # Uncompressed raw byte content for test cases. - # - # Note: The following fields are mutually exclusive: `content`, `gcs_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ImportTestCasesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#import_test_cases TestCases.ImportTestCases}. - # @!attribute [rw] names - # @return [::Array<::String>] - # The unique identifiers of the new test cases. - # Format: - # `projects//locations//agents//testCases/`. - class ImportTestCasesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata returned for the - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#import_test_cases TestCases.ImportTestCases} - # long running operation. - # @!attribute [rw] errors - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TestCaseError>] - # Errors for failed test cases. - class ImportTestCasesMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Error info for importing a test. - # @!attribute [rw] test_case - # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] - # The test case. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # The status associated with the test case. - class TestCaseError - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#export_test_cases TestCases.ExportTestCases}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent where to export test cases from. - # Format: `projects//locations//agents/`. - # @!attribute [rw] gcs_uri - # @return [::String] - # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to - # export the test cases to. The format of this URI must be - # `gs:///`. If unspecified, the serialized test - # cases 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). - # @!attribute [rw] data_format - # @return [::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest::DataFormat] - # The data format of the exported test cases. If not specified, `BLOB` is - # assumed. - # @!attribute [rw] filter - # @return [::String] - # The filter expression used to filter exported test cases, see - # [API Filtering](https://aip.dev/160). The expression is case insensitive - # and supports the following syntax: - # - # name = [OR name = ] ... - # - # For example: - # - # * "name = t1 OR name = t2" matches the test case with the exact resource - # name "t1" or "t2". - class ExportTestCasesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Data format of the exported test cases. - module DataFormat - # Unspecified format. - DATA_FORMAT_UNSPECIFIED = 0 - - # Raw bytes. - BLOB = 1 - - # JSON format. - JSON = 2 - end - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#export_test_cases TestCases.ExportTestCases}. - # @!attribute [rw] gcs_uri - # @return [::String] - # The URI to a file containing the exported test cases. This field is - # populated only if `gcs_uri` is specified in - # {::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest ExportTestCasesRequest}. - # - # Note: The following fields are mutually exclusive: `gcs_uri`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] content - # @return [::String] - # Uncompressed raw byte content for test cases. - # - # Note: The following fields are mutually exclusive: `content`, `gcs_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ExportTestCasesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata returned for the - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#export_test_cases TestCases.ExportTestCases} - # long running operation. This message currently has no fields. - class ExportTestCasesMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_case_results TestCases.ListTestCaseResults}. - # @!attribute [rw] parent - # @return [::String] - # Required. The test case to list results for. - # Format: - # `projects//locations//agents//testCases/`. - # Specify a `-` as a wildcard for TestCase ID to - # list results across multiple test cases. - # @!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. - # @!attribute [rw] filter - # @return [::String] - # The filter expression used to filter test case results. See - # [API Filtering](https://aip.dev/160). - # - # The expression is case insensitive. Only 'AND' is supported for logical - # operators. The supported syntax is listed below in detail: - # - # [AND ] ... - # [AND latest] - # - # The supported fields and operators are: - # field operator - # `environment` `=`, `IN` (Use value `draft` for draft environment) - # `test_time` `>`, `<` - # - # `latest` only returns the latest test result in all results for each test - # case. - # - # Examples: - # * "environment=draft AND latest" matches the latest test result for each - # test case in the draft environment. - # * "environment IN (e1,e2)" matches any test case results with an - # environment resource name of either "e1" or "e2". - # * "test_time > 1602540713" matches any test case results with test time - # later than a unix timestamp in seconds 1602540713. - class ListTestCaseResultsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_case_results TestCases.ListTestCaseResults}. - # @!attribute [rw] test_case_results - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>] - # The list of test case results. - # @!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 ListTestCaseResultsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#get_test_case_result TestCases.GetTestCaseResult}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the testcase. - # Format: - # `projects//locations//agents//testCases//results/`. - class GetTestCaseResultRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The test result for a test case and an agent environment. - module TestResult - # Not specified. Should never be used. - TEST_RESULT_UNSPECIFIED = 0 - - # The test passed. - PASSED = 1 - - # The test did not pass. - FAILED = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/transition_route_group.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/transition_route_group.rb deleted file mode 100644 index 97fa85525003..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/transition_route_group.rb +++ /dev/null @@ -1,212 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dialogflow - module CX - module V3 - # A TransitionRouteGroup represents a group of - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRoute `TransitionRoutes`} to be - # used by a {::Google::Cloud::Dialogflow::CX::V3::Page Page}. - # @!attribute [rw] name - # @return [::String] - # The unique identifier of the transition route group. - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#create_transition_route_group TransitionRouteGroups.CreateTransitionRouteGroup} - # populates the name automatically. Format: - # `projects//locations//agents//flows//transitionRouteGroups/` - # . - # @!attribute [rw] display_name - # @return [::String] - # Required. The human-readable name of the transition route group, unique - # within the flow. The display name can be no longer than 30 characters. - # @!attribute [rw] transition_routes - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TransitionRoute>] - # Transition routes associated with the - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup}. - class TransitionRouteGroup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#list_transition_route_groups TransitionRouteGroups.ListTransitionRouteGroups}. - # @!attribute [rw] parent - # @return [::String] - # Required. The flow to list all transition route groups for. - # Format: - # `projects//locations//agents//flows/` - # or `projects//locations//agents/. - # @!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. - # @!attribute [rw] language_code - # @return [::String] - # The language to list transition route groups for. The following fields are - # language dependent: - # - # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` - # * - # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - class ListTransitionRouteGroupsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#list_transition_route_groups TransitionRouteGroups.ListTransitionRouteGroups}. - # @!attribute [rw] transition_route_groups - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup>] - # The list of transition route groups. There will be a maximum number of - # items returned based on the page_size field in the request. The list may in - # some cases be empty or contain fewer entries than page_size even if this - # isn't the last page. - # @!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 ListTransitionRouteGroupsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#get_transition_route_group TransitionRouteGroups.GetTransitionRouteGroup}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup}. - # Format: - # `projects//locations//agents//flows//transitionRouteGroups/` - # or - # `projects//locations//agents//transitionRouteGroups/`. - # @!attribute [rw] language_code - # @return [::String] - # The language to retrieve the transition route group for. The following - # fields are language dependent: - # - # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` - # * - # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - class GetTransitionRouteGroupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#create_transition_route_group TransitionRouteGroups.CreateTransitionRouteGroup}. - # @!attribute [rw] parent - # @return [::String] - # Required. The flow to create an - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup} - # for. Format: - # `projects//locations//agents//flows/` - # or `projects//locations//agents/` - # for agent-level groups. - # @!attribute [rw] transition_route_group - # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] - # Required. The transition route group to create. - # @!attribute [rw] language_code - # @return [::String] - # The language of the following fields in `TransitionRouteGroup`: - # - # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` - # * - # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - class CreateTransitionRouteGroupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#update_transition_route_group TransitionRouteGroups.UpdateTransitionRouteGroup}. - # @!attribute [rw] transition_route_group - # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] - # Required. The transition route group to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The mask to control which fields get updated. - # @!attribute [rw] language_code - # @return [::String] - # The language of the following fields in `TransitionRouteGroup`: - # - # * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` - # * - # `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` - # - # If not specified, the agent's default language is used. - # [Many - # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) - # are supported. - # Note: languages must be enabled in the agent before they can be used. - class UpdateTransitionRouteGroupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#delete_transition_route_group TransitionRouteGroups.DeleteTransitionRouteGroup}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the - # {::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup TransitionRouteGroup} - # to delete. Format: - # `projects//locations//agents//flows//transitionRouteGroups/` - # or - # `projects//locations//agents//transitionRouteGroups/`. - # @!attribute [rw] force - # @return [::Boolean] - # This field has no effect for transition route group that no page is using. - # If the transition route group is referenced by any page: - # - # * If `force` is set to false, an error will be returned with message - # indicating pages that reference the transition route group. - # * If `force` is set to true, Dialogflow will remove the transition route - # group, as well as any reference to it. - class DeleteTransitionRouteGroupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/validation_message.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/validation_message.rb deleted file mode 100644 index b6ff511ea4b9..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/validation_message.rb +++ /dev/null @@ -1,125 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - # Agent/flow validation message. - # @!attribute [rw] resource_type - # @return [::Google::Cloud::Dialogflow::CX::V3::ValidationMessage::ResourceType] - # The type of the resources where the message is found. - # @!attribute [rw] resources - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::String>] - # The names of the resources where the message is found. - # @!attribute [rw] resource_names - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ResourceName>] - # The resource names of the resources where the message is found. - # @!attribute [rw] severity - # @return [::Google::Cloud::Dialogflow::CX::V3::ValidationMessage::Severity] - # Indicates the severity of the message. - # @!attribute [rw] detail - # @return [::String] - # The message detail. - class ValidationMessage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Resource types. - module ResourceType - # Unspecified. - RESOURCE_TYPE_UNSPECIFIED = 0 - - # Agent. - AGENT = 1 - - # Intent. - INTENT = 2 - - # Intent training phrase. - INTENT_TRAINING_PHRASE = 8 - - # Intent parameter. - INTENT_PARAMETER = 9 - - # Multiple intents. - INTENTS = 10 - - # Multiple training phrases. - INTENT_TRAINING_PHRASES = 11 - - # Entity type. - ENTITY_TYPE = 3 - - # Multiple entity types. - ENTITY_TYPES = 12 - - # Webhook. - WEBHOOK = 4 - - # Flow. - FLOW = 5 - - # Page. - PAGE = 6 - - # Multiple pages. - PAGES = 13 - - # Transition route group. - TRANSITION_ROUTE_GROUP = 7 - - # Agent transition route group. - AGENT_TRANSITION_ROUTE_GROUP = 14 - end - - # Severity level. - module Severity - # Unspecified. - 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 failures. - ERROR = 3 - end - end - - # Resource name and display name. - # @!attribute [rw] name - # @return [::String] - # Name. - # @!attribute [rw] display_name - # @return [::String] - # Display name. - class ResourceName - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/version.rb deleted file mode 100644 index d850ccd9bda7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/version.rb +++ /dev/null @@ -1,235 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - # Metadata associated with the long running operation for - # {::Google::Cloud::Dialogflow::CX::V3::Versions::Client#create_version Versions.CreateVersion}. - # @!attribute [rw] version - # @return [::String] - # Name of the created version. - # Format: - # `projects//locations//agents//flows//versions/`. - class CreateVersionOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a version of a flow. - # @!attribute [rw] name - # @return [::String] - # Format: - # projects//locations//agents//flows//versions/. - # Version ID is a self-increasing number generated by Dialogflow upon version - # creation. - # @!attribute [rw] display_name - # @return [::String] - # Required. The human-readable name of the version. Limit of 64 characters. - # @!attribute [rw] description - # @return [::String] - # The description of the version. The maximum length is 500 characters. If - # exceeded, the request is rejected. - # @!attribute [r] nlu_settings - # @return [::Google::Cloud::Dialogflow::CX::V3::NluSettings] - # Output only. The NLU settings of the flow at version creation. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Create time of the version. - # @!attribute [r] state - # @return [::Google::Cloud::Dialogflow::CX::V3::Version::State] - # Output only. The state 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 state of the version. - module State - # Not specified. This value is not used. - STATE_UNSPECIFIED = 0 - - # Version is not ready to serve (e.g. training is running). - RUNNING = 1 - - # Training has succeeded and this version is ready to serve. - SUCCEEDED = 2 - - # Version training failed. - FAILED = 3 - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Versions::Client#list_versions Versions.ListVersions}. - # @!attribute [rw] parent - # @return [::String] - # Required. The {::Google::Cloud::Dialogflow::CX::V3::Flow Flow} to list all - # versions for. Format: - # `projects//locations//agents//flows/`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return in a single page. By default 20 and - # at most 100. - # @!attribute [rw] page_token - # @return [::String] - # 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::CX::V3::Versions::Client#list_versions Versions.ListVersions}. - # @!attribute [rw] versions - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Version>] - # A list of versions. There will be a maximum number of items returned based - # on the page_size field in the request. The list may in some cases be empty - # or contain fewer entries than page_size even if this isn't the last page. - # @!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::CX::V3::Versions::Client#get_version Versions.GetVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the {::Google::Cloud::Dialogflow::CX::V3::Version Version}. - # Format: - # `projects//locations//agents//flows//versions/`. - class GetVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Versions::Client#create_version Versions.CreateVersion}. - # @!attribute [rw] parent - # @return [::String] - # Required. The {::Google::Cloud::Dialogflow::CX::V3::Flow Flow} to create an - # {::Google::Cloud::Dialogflow::CX::V3::Version Version} for. Format: - # `projects//locations//agents//flows/`. - # @!attribute [rw] version - # @return [::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Versions::Client#update_version Versions.UpdateVersion}. - # @!attribute [rw] version - # @return [::Google::Cloud::Dialogflow::CX::V3::Version] - # Required. The version to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The mask to control which fields get updated. Currently only - # `description` and `display_name` can be updated. - class UpdateVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Versions::Client#delete_version Versions.DeleteVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the {::Google::Cloud::Dialogflow::CX::V3::Version Version} - # to delete. Format: - # `projects//locations//agents//flows//versions/`. - class DeleteVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Versions::Client#load_version Versions.LoadVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The {::Google::Cloud::Dialogflow::CX::V3::Version Version} to be loaded - # to draft flow. Format: - # `projects//locations//agents//flows//versions/`. - # @!attribute [rw] allow_override_agent_resources - # @return [::Boolean] - # This field is used to prevent accidental overwrite of other agent - # resources, which can potentially impact other flow's behavior. If - # `allow_override_agent_resources` is false, conflicted agent-level resources - # will not be overridden (i.e. intents, entities, webhooks). - class LoadVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Versions::Client#compare_versions Versions.CompareVersions}. - # @!attribute [rw] base_version - # @return [::String] - # Required. Name of the base flow version to compare with the target version. - # Use version ID `0` to indicate the draft version of the specified flow. - # - # Format: - # `projects//locations//agents//flows//versions/`. - # @!attribute [rw] target_version - # @return [::String] - # Required. Name of the target flow version to compare with the - # base version. Use version ID `0` to indicate the draft version of the - # specified flow. Format: - # `projects//locations//agents//flows//versions/`. - # @!attribute [rw] language_code - # @return [::String] - # The language to compare the flow versions for. - # - # 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 CompareVersionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::Versions::Client#compare_versions Versions.CompareVersions}. - # @!attribute [rw] base_version_content_json - # @return [::String] - # JSON representation of the base version content. - # @!attribute [rw] target_version_content_json - # @return [::String] - # JSON representation of the target version content. - # @!attribute [rw] compare_time - # @return [::Google::Protobuf::Timestamp] - # The timestamp when the two version compares. - class CompareVersionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb deleted file mode 100644 index 54bae9f3b8a7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb +++ /dev/null @@ -1,782 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 CX - module V3 - # Webhooks host the developer's business logic. During a session, webhooks - # allow the developer to use the data extracted by Dialogflow's natural - # language processing to generate dynamic responses, validate collected data, - # or trigger actions on the backend. - # @!attribute [rw] name - # @return [::String] - # The unique identifier of the webhook. - # Required for the - # {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#update_webhook Webhooks.UpdateWebhook} - # method. - # {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#create_webhook Webhooks.CreateWebhook} - # populates the name automatically. Format: - # `projects//locations//agents//webhooks/`. - # @!attribute [rw] display_name - # @return [::String] - # Required. The human-readable name of the webhook, unique within the agent. - # @!attribute [rw] generic_web_service - # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService] - # Configuration for a generic web service. - # - # Note: The following fields are mutually exclusive: `generic_web_service`, `service_directory`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] service_directory - # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook::ServiceDirectoryConfig] - # Configuration for a [Service - # Directory](https://cloud.google.com/service-directory) service. - # - # Note: The following fields are mutually exclusive: `service_directory`, `generic_web_service`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # Webhook execution timeout. Execution is considered failed if Dialogflow - # doesn't receive a response from webhook at the end of the timeout period. - # Defaults to 5 seconds, maximum allowed timeout is 30 seconds. - # @!attribute [rw] disabled - # @return [::Boolean] - # Indicates whether the webhook is disabled. - class Webhook - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents configuration for a generic web service. - # @!attribute [rw] uri - # @return [::String] - # Required. The webhook URI for receiving POST requests. It must use https - # protocol. - # @!attribute [rw] username - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # The user name for HTTP Basic authentication. - # @!attribute [rw] password - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # The password for HTTP Basic authentication. - # @!attribute [rw] secret_version_for_username_password - # @return [::String] - # Optional. The SecretManager secret version resource storing the - # username:password pair for HTTP Basic authentication. Format: - # `projects/{project}/secrets/{secret}/versions/{version}` - # @!attribute [rw] request_headers - # @return [::Google::Protobuf::Map{::String => ::String}] - # The HTTP request headers to send together with webhook requests. - # @!attribute [rw] secret_versions_for_request_headers - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService::SecretVersionHeaderValue}] - # Optional. The HTTP request headers to send together with webhook - # requests. Header values are stored in SecretManager secret versions. - # - # When the same header name is specified in both `request_headers` and - # `secret_versions_for_request_headers`, the value in - # `secret_versions_for_request_headers` will be used. - # @!attribute [rw] allowed_ca_certs - # @return [::Array<::String>] - # Optional. Specifies a list of 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'") - # ``` - # @!attribute [rw] oauth_config - # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService::OAuthConfig] - # Optional. The OAuth configuration of the webhook. If specified, - # Dialogflow will initiate the OAuth client credential flow to exchange an - # access token from the 3rd party platform and put it in the auth header. - # @!attribute [rw] service_agent_auth - # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService::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. - # @!attribute [rw] service_account_auth_config - # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService::ServiceAccountAuthConfig] - # Optional. Configuration for service account authentication. - # @!attribute [rw] webhook_type - # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService::WebhookType] - # Optional. Type of the webhook. - # @!attribute [rw] http_method - # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService::HttpMethod] - # Optional. HTTP method for the flexible webhook calls. Standard webhook - # always uses POST. - # @!attribute [rw] request_body - # @return [::String] - # Optional. Defines a custom JSON object as request body to send to - # flexible webhook. - # @!attribute [rw] parameter_mapping - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Maps the values extracted from specific fields of the flexible - # webhook response into session parameters. - # - Key: session parameter name - # - Value: field path in the webhook response - class GenericWebService - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents the value of an HTTP header stored in a SecretManager secret - # version. - # @!attribute [rw] secret_version - # @return [::String] - # Required. The SecretManager secret version resource storing the header - # value. Format: `projects/{project}/secrets/{secret}/versions/{version}` - class SecretVersionHeaderValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents configuration of OAuth client credential flow for 3rd party - # API authentication. - # @!attribute [rw] client_id - # @return [::String] - # Required. The client ID provided by the 3rd party platform. - # @!attribute [rw] client_secret - # @return [::String] - # Optional. The client secret provided by the 3rd party platform. - # @!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 provided by the 3rd party platform to - # exchange 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 - end - - # Configuration for authentication using a service account. - # @!attribute [rw] service_account - # @return [::String] - # Required. The email address of the service account used to authenticate - # the webhook call. Dialogflow uses this service account to exchange an - # access token and the access token is then sent in the `Authorization` - # header of the webhook request. - # - # The service account must have the - # `roles/iam.serviceAccountTokenCreator` role granted to the - # [Dialogflow service - # agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). - class ServiceAccountAuthConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RequestHeadersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService::SecretVersionHeaderValue] - class SecretVersionsForRequestHeadersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ParameterMappingEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Indicate the auth token type generated from the [Diglogflow 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 - - # No token used. - NONE = 1 - - # 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 = 2 - - # 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 = 3 - end - - # Represents the type of webhook configuration. - module WebhookType - # Default value. This value is unused. - WEBHOOK_TYPE_UNSPECIFIED = 0 - - # Represents a standard webhook. - STANDARD = 1 - - # Represents a flexible webhook. - FLEXIBLE = 2 - end - - # HTTP method to use when calling webhooks. - module HttpMethod - # HTTP method not specified. - HTTP_METHOD_UNSPECIFIED = 0 - - # HTTP POST Method. - POST = 1 - - # HTTP GET Method. - GET = 2 - - # HTTP HEAD Method. - HEAD = 3 - - # HTTP PUT Method. - PUT = 4 - - # HTTP DELETE Method. - DELETE = 5 - - # HTTP PATCH Method. - PATCH = 6 - - # HTTP OPTIONS Method. - OPTIONS = 7 - end - end - - # Represents configuration for a [Service - # Directory](https://cloud.google.com/service-directory) service. - # @!attribute [rw] service - # @return [::String] - # Required. The name of [Service - # Directory](https://cloud.google.com/service-directory) service. - # Format: - # `projects//locations//namespaces//services/`. - # `Location ID` of the service directory must be the same as the location - # of the agent. - # @!attribute [rw] generic_web_service - # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook::GenericWebService] - # Generic Service configuration of this webhook. - class ServiceDirectoryConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#list_webhooks Webhooks.ListWebhooks}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to list all webhooks for. - # Format: `projects//locations//agents/`. - # @!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 ListWebhooksRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#list_webhooks Webhooks.ListWebhooks}. - # @!attribute [rw] webhooks - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::Webhook>] - # The list of webhooks. 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 ListWebhooksResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#get_webhook Webhooks.GetWebhook}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the webhook. - # Format: - # `projects//locations//agents//webhooks/`. - class GetWebhookRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#create_webhook Webhooks.CreateWebhook}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to create a webhook for. - # Format: `projects//locations//agents/`. - # @!attribute [rw] webhook - # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] - # Required. The webhook to create. - class CreateWebhookRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#update_webhook Webhooks.UpdateWebhook}. - # @!attribute [rw] webhook - # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] - # Required. The webhook to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The mask to control which fields get updated. If the mask is not present, - # all fields will be updated. - class UpdateWebhookRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#delete_webhook Webhooks.DeleteWebhook}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the webhook to delete. - # Format: - # `projects//locations//agents//webhooks/`. - # @!attribute [rw] force - # @return [::Boolean] - # This field has no effect for webhook not being used. - # For webhooks that are used by pages/flows/transition route groups: - # - # * If `force` is set to false, an error will be returned with message - # indicating the referenced resources. - # * If `force` is set to true, Dialogflow will remove the webhook, as well - # as any references to the webhook (i.e. - # {::Google::Cloud::Dialogflow::CX::V3::Fulfillment#webhook Webhook} and - # {::Google::Cloud::Dialogflow::CX::V3::Fulfillment#tag tag}in fulfillments that - # point to this webhook will be removed). - class DeleteWebhookRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for a webhook call. The request is sent as a JSON object - # and the field names will be presented in camel cases. - # - # You may see undocumented fields in an actual request. These fields are used - # internally by Dialogflow and should be ignored. - # @!attribute [rw] detect_intent_response_id - # @return [::String] - # Always present. The unique identifier of the - # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse DetectIntentResponse} - # that will be returned to the API caller. - # @!attribute [rw] text - # @return [::String] - # If {::Google::Cloud::Dialogflow::CX::V3::TextInput natural language text} was - # provided as input, this field will contain a copy of the text. - # - # Note: The following fields are mutually exclusive: `text`, `trigger_intent`, `transcript`, `trigger_event`, `dtmf_digits`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] trigger_intent - # @return [::String] - # If an {::Google::Cloud::Dialogflow::CX::V3::IntentInput intent} was provided as - # input, this field will contain a copy of the intent identifier. Format: - # `projects//locations//agents//intents/`. - # - # Note: The following fields are mutually exclusive: `trigger_intent`, `text`, `transcript`, `trigger_event`, `dtmf_digits`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] transcript - # @return [::String] - # If [natural language speech - # audio][google.cloud.dialogflow.cx.v3.AudioInput] was provided as input, - # this field will contain the transcript for the audio. - # - # Note: The following fields are mutually exclusive: `transcript`, `text`, `trigger_intent`, `trigger_event`, `dtmf_digits`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] trigger_event - # @return [::String] - # If an {::Google::Cloud::Dialogflow::CX::V3::EventInput event} was provided as - # input, this field will contain the name of the event. - # - # Note: The following fields are mutually exclusive: `trigger_event`, `text`, `trigger_intent`, `transcript`, `dtmf_digits`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] dtmf_digits - # @return [::String] - # If {::Google::Cloud::Dialogflow::CX::V3::DtmfInput DTMF} was provided as input, - # this field will contain the DTMF digits. - # - # Note: The following fields are mutually exclusive: `dtmf_digits`, `text`, `trigger_intent`, `transcript`, `trigger_event`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] language_code - # @return [::String] - # The language code specified in the [original - # request][QueryInput.language_code]. - # @!attribute [rw] fulfillment_info - # @return [::Google::Cloud::Dialogflow::CX::V3::WebhookRequest::FulfillmentInfo] - # Always present. Information about the fulfillment that triggered this - # webhook call. - # @!attribute [rw] intent_info - # @return [::Google::Cloud::Dialogflow::CX::V3::WebhookRequest::IntentInfo] - # Information about the last matched intent. - # @!attribute [rw] page_info - # @return [::Google::Cloud::Dialogflow::CX::V3::PageInfo] - # Information about page status. - # @!attribute [rw] session_info - # @return [::Google::Cloud::Dialogflow::CX::V3::SessionInfo] - # Information about session status. - # @!attribute [rw] messages - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ResponseMessage>] - # The list of rich message responses to present to the user. Webhook can - # choose to append or replace this list in - # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse#fulfillment_response WebhookResponse.fulfillment_response}; - # @!attribute [rw] payload - # @return [::Google::Protobuf::Struct] - # Custom data set in - # {::Google::Cloud::Dialogflow::CX::V3::QueryParameters#payload QueryParameters.payload}. - # @!attribute [rw] sentiment_analysis_result - # @return [::Google::Cloud::Dialogflow::CX::V3::WebhookRequest::SentimentAnalysisResult] - # The sentiment analysis result of the current user request. The field is - # filled when sentiment analysis is configured to be enabled for the request. - # @!attribute [rw] language_info - # @return [::Google::Cloud::Dialogflow::CX::V3::LanguageInfo] - # Information about the language of the request. - class WebhookRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents fulfillment information communicated to the webhook. - # @!attribute [rw] tag - # @return [::String] - # Always present. - # The value of the - # {::Google::Cloud::Dialogflow::CX::V3::Fulfillment#tag Fulfillment.tag} field - # will be populated in this field by Dialogflow when the associated webhook - # is called. The tag is typically used by the webhook service to identify - # which fulfillment is being called, but it could be used for other - # purposes. - class FulfillmentInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents intent information communicated to the webhook. - # @!attribute [rw] last_matched_intent - # @return [::String] - # Always present. The unique identifier of the last matched - # {::Google::Cloud::Dialogflow::CX::V3::Intent intent}. - # Format: - # `projects//locations//agents//intents/`. - # @!attribute [rw] display_name - # @return [::String] - # Always present. The display name of the last matched - # {::Google::Cloud::Dialogflow::CX::V3::Intent intent}. - # @!attribute [rw] parameters - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dialogflow::CX::V3::WebhookRequest::IntentInfo::IntentParameterValue}] - # Parameters identified as a result of intent matching. This is a map of - # the name of the identified parameter to the value of the parameter - # identified from the user's utterance. All parameters defined in the - # matched intent that are identified will be surfaced here. - # @!attribute [rw] confidence - # @return [::Float] - # The confidence of the matched intent. Values range from 0.0 (completely - # uncertain) to 1.0 (completely certain). - class IntentInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents a value for an intent parameter. - # @!attribute [rw] original_value - # @return [::String] - # Always present. Original text value extracted from user utterance. - # @!attribute [rw] resolved_value - # @return [::Google::Protobuf::Value] - # Always present. Structured value for the parameter extracted from user - # utterance. - class IntentParameterValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Dialogflow::CX::V3::WebhookRequest::IntentInfo::IntentParameterValue] - class ParametersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Represents the result of sentiment analysis. - # @!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 SentimentAnalysisResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The response message for a webhook call. - # @!attribute [rw] fulfillment_response - # @return [::Google::Cloud::Dialogflow::CX::V3::WebhookResponse::FulfillmentResponse] - # The fulfillment response to send to the user. This field can be omitted by - # the webhook if it does not intend to send any response to the user. - # @!attribute [rw] page_info - # @return [::Google::Cloud::Dialogflow::CX::V3::PageInfo] - # Information about page status. This field can be omitted by the webhook if - # it does not intend to modify page status. - # @!attribute [rw] session_info - # @return [::Google::Cloud::Dialogflow::CX::V3::SessionInfo] - # Information about session status. This field can be omitted by the webhook - # if it does not intend to modify session status. - # @!attribute [rw] payload - # @return [::Google::Protobuf::Struct] - # Value to append directly to - # {::Google::Cloud::Dialogflow::CX::V3::QueryResult#webhook_payloads QueryResult.webhook_payloads}. - # @!attribute [rw] target_page - # @return [::String] - # The target page to transition to. - # Format: - # `projects//locations//agents//flows//pages/`. - # - # Note: The following fields are mutually exclusive: `target_page`, `target_flow`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] target_flow - # @return [::String] - # The target flow to transition to. - # Format: - # `projects//locations//agents//flows/`. - # - # Note: The following fields are mutually exclusive: `target_flow`, `target_page`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class WebhookResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents a fulfillment response to the user. - # @!attribute [rw] messages - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::ResponseMessage>] - # The list of rich message responses to present to the user. - # @!attribute [rw] merge_behavior - # @return [::Google::Cloud::Dialogflow::CX::V3::WebhookResponse::FulfillmentResponse::MergeBehavior] - # Merge behavior for `messages`. - class FulfillmentResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Defines merge behavior for `messages`. - module MergeBehavior - # Not specified. `APPEND` will be used. - MERGE_BEHAVIOR_UNSPECIFIED = 0 - - # `messages` will be appended to the list of messages waiting to be sent - # to the user. - APPEND = 1 - - # `messages` will replace the list of messages waiting to be sent to the - # user. - REPLACE = 2 - end - end - end - - # Represents page information communicated to and from the webhook. - # @!attribute [rw] current_page - # @return [::String] - # Always present for - # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest}. Ignored for - # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. The - # unique identifier of the current page. Format: - # `projects//locations//agents//flows//pages/`. - # @!attribute [rw] display_name - # @return [::String] - # Always present for - # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest}. Ignored for - # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. The - # display name of the current page. - # @!attribute [rw] form_info - # @return [::Google::Cloud::Dialogflow::CX::V3::PageInfo::FormInfo] - # Optional for both - # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest} and - # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. - # Information about the form. - class PageInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents form information. - # @!attribute [rw] parameter_info - # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::PageInfo::FormInfo::ParameterInfo>] - # Optional for both - # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest} and - # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. The - # parameters contained in the form. Note that the webhook cannot add or - # remove any form parameter. - class FormInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents parameter information. - # @!attribute [rw] display_name - # @return [::String] - # Always present for - # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest}. - # Required for - # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. - # The human-readable name of the parameter, unique within the form. This - # field cannot be modified by the webhook. - # @!attribute [rw] required - # @return [::Boolean] - # Optional for both - # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest} and - # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. - # Indicates whether the parameter is required. Optional parameters will - # not trigger prompts; however, they are filled if the user specifies - # them. Required parameters must be filled before form filling concludes. - # @!attribute [rw] state - # @return [::Google::Cloud::Dialogflow::CX::V3::PageInfo::FormInfo::ParameterInfo::ParameterState] - # Always present for - # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest}. - # Required for - # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. The - # state of the parameter. This field can be set to - # {::Google::Cloud::Dialogflow::CX::V3::PageInfo::FormInfo::ParameterInfo::ParameterState::INVALID INVALID} - # by the webhook to invalidate the parameter; other values set by the - # webhook will be ignored. - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - # Optional for both - # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest} and - # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. The - # value of the parameter. This field can be set by the webhook to change - # the parameter value. - # @!attribute [rw] just_collected - # @return [::Boolean] - # Optional for - # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest}. Ignored - # for {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. - # Indicates if the parameter value was just collected on the last - # conversation turn. - class ParameterInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents the state of a parameter. - module ParameterState - # Not specified. This value should be never used. - PARAMETER_STATE_UNSPECIFIED = 0 - - # Indicates that the parameter does not have a value. - EMPTY = 1 - - # Indicates that the parameter value is invalid. This field can be used - # by the webhook to invalidate the parameter and ask the server to - # collect it from the user again. - INVALID = 2 - - # Indicates that the parameter has a value. - FILLED = 3 - end - end - end - end - - # Represents session information communicated to and from the webhook. - # @!attribute [rw] session - # @return [::String] - # Always present for - # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest}. Ignored for - # {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. The - # unique identifier of the - # {::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest#session session}. This - # field can be used by the webhook to identify a session. - # Format: - # `projects//locations//agents//sessions/` - # or - # `projects//locations//agents//environments//sessions/` - # if environment is specified. - # @!attribute [rw] parameters - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Optional for - # {::Google::Cloud::Dialogflow::CX::V3::WebhookRequest WebhookRequest}. Optional - # for {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. All - # parameters collected from forms and intents during the session. Parameters - # can be created, updated, or removed by the webhook. To remove a parameter - # from the session, the webhook should explicitly set the parameter value to - # null in {::Google::Cloud::Dialogflow::CX::V3::WebhookResponse WebhookResponse}. - # The map is keyed by parameters' display names. - class SessionInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class ParametersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Represents the language information of the request. - # @!attribute [rw] input_language_code - # @return [::String] - # The language code specified in the original - # {::Google::Cloud::Dialogflow::CX::V3::QueryInput#language_code request}. - # @!attribute [rw] resolved_language_code - # @return [::String] - # The language code detected for this request based on the user - # conversation. - # @!attribute [rw] confidence_score - # @return [::Float] - # The confidence score of the detected language between 0 and 1. - class LanguageInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/struct.rb deleted file mode 100644 index 39e1aca868d2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3/proto_docs/google/type/latlng.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/proto_docs/google/type/latlng.rb deleted file mode 100644 index c15e78a39a56..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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 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-cx-v3/snippets/Gemfile b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/Gemfile deleted file mode 100644 index 58cc499704d2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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-cx-v3", path: "../" -else - gem "google-cloud-dialogflow-cx-v3" -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-cx-v3/snippets/agents/create_agent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/create_agent.rb deleted file mode 100644 index cb7bf8736192..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/create_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_v3_generated_Agents_CreateAgent_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the create_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::CX::V3::Agents::Client#create_agent. -# -def create_agent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest.new - - # Call the create_agent method. - result = client.create_agent request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. - p result -end -# [END dialogflow_v3_generated_Agents_CreateAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/delete_agent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/delete_agent.rb deleted file mode 100644 index b81fd3714e04..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Agents_DeleteAgent_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Agents::Client#delete_agent. -# -def delete_agent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::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_v3_generated_Agents_DeleteAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/export_agent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/export_agent.rb deleted file mode 100644 index 4dd3f088ca15..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Agents_ExportAgent_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Agents::Client#export_agent. -# -def export_agent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::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_v3_generated_Agents_ExportAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent.rb deleted file mode 100644 index 40bfc561bd30..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Agents_GetAgent_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Agents::Client#get_agent. -# -def get_agent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::GetAgentRequest.new - - # Call the get_agent method. - result = client.get_agent request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. - p result -end -# [END dialogflow_v3_generated_Agents_GetAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent_validation_result.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent_validation_result.rb deleted file mode 100644 index b01f9e618881..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent_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_v3_generated_Agents_GetAgentValidationResult_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the get_agent_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::CX::V3::Agents::Client#get_agent_validation_result. -# -def get_agent_validation_result - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest.new - - # Call the get_agent_validation_result method. - result = client.get_agent_validation_result request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AgentValidationResult. - p result -end -# [END dialogflow_v3_generated_Agents_GetAgentValidationResult_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_generative_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_generative_settings.rb deleted file mode 100644 index f53032bd862b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/get_generative_settings.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_v3_generated_Agents_GetGenerativeSettings_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the get_generative_settings 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::CX::V3::Agents::Client#get_generative_settings. -# -def get_generative_settings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest.new - - # Call the get_generative_settings method. - result = client.get_generative_settings request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::GenerativeSettings. - p result -end -# [END dialogflow_v3_generated_Agents_GetGenerativeSettings_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/list_agents.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/list_agents.rb deleted file mode 100644 index 3a5752210e20..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/list_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_v3_generated_Agents_ListAgents_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the list_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::CX::V3::Agents::Client#list_agents. -# -def list_agents - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest.new - - # Call the list_agents method. - result = client.list_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::CX::V3::Agent. - p item - end -end -# [END dialogflow_v3_generated_Agents_ListAgents_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/restore_agent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/restore_agent.rb deleted file mode 100644 index 2433849ac6d7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Agents_RestoreAgent_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Agents::Client#restore_agent. -# -def restore_agent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::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_v3_generated_Agents_RestoreAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/update_agent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/update_agent.rb deleted file mode 100644 index 3db81cfbc612..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/update_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_v3_generated_Agents_UpdateAgent_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the update_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::CX::V3::Agents::Client#update_agent. -# -def update_agent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest.new - - # Call the update_agent method. - result = client.update_agent request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. - p result -end -# [END dialogflow_v3_generated_Agents_UpdateAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/update_generative_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/update_generative_settings.rb deleted file mode 100644 index bfc3b6c140b5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/update_generative_settings.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_v3_generated_Agents_UpdateGenerativeSettings_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the update_generative_settings 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::CX::V3::Agents::Client#update_generative_settings. -# -def update_generative_settings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest.new - - # Call the update_generative_settings method. - result = client.update_generative_settings request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::GenerativeSettings. - p result -end -# [END dialogflow_v3_generated_Agents_UpdateGenerativeSettings_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/validate_agent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/validate_agent.rb deleted file mode 100644 index de9ab4a03c03..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/agents/validate_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_v3_generated_Agents_ValidateAgent_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the validate_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::CX::V3::Agents::Client#validate_agent. -# -def validate_agent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest.new - - # Call the validate_agent method. - result = client.validate_agent request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AgentValidationResult. - p result -end -# [END dialogflow_v3_generated_Agents_ValidateAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/changelogs/get_changelog.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/changelogs/get_changelog.rb deleted file mode 100644 index 17b987ed836c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/changelogs/get_changelog.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_v3_generated_Changelogs_GetChangelog_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the get_changelog call in the Changelogs service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Changelogs::Client#get_changelog. -# -def get_changelog - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest.new - - # Call the get_changelog method. - result = client.get_changelog request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Changelog. - p result -end -# [END dialogflow_v3_generated_Changelogs_GetChangelog_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/changelogs/list_changelogs.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/changelogs/list_changelogs.rb deleted file mode 100644 index 20038de9a824..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/changelogs/list_changelogs.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_v3_generated_Changelogs_ListChangelogs_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the list_changelogs call in the Changelogs service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Changelogs::Client#list_changelogs. -# -def list_changelogs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest.new - - # Call the list_changelogs method. - result = client.list_changelogs request - - # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Changelog. - p item - end -end -# [END dialogflow_v3_generated_Changelogs_ListChangelogs_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/deployments/get_deployment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/deployments/get_deployment.rb deleted file mode 100644 index 959bca1e48bc..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/deployments/get_deployment.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_v3_generated_Deployments_GetDeployment_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the get_deployment call in the Deployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Deployments::Client#get_deployment. -# -def get_deployment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest.new - - # Call the get_deployment method. - result = client.get_deployment request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Deployment. - p result -end -# [END dialogflow_v3_generated_Deployments_GetDeployment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/deployments/list_deployments.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/deployments/list_deployments.rb deleted file mode 100644 index 30a16458ef94..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/deployments/list_deployments.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_v3_generated_Deployments_ListDeployments_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the list_deployments call in the Deployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Deployments::Client#list_deployments. -# -def list_deployments - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest.new - - # Call the list_deployments method. - result = client.list_deployments request - - # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Deployment. - p item - end -end -# [END dialogflow_v3_generated_Deployments_ListDeployments_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/create_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/create_entity_type.rb deleted file mode 100644 index e9b4bd9a8383..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_EntityTypes_CreateEntityType_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::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::CX::V3::EntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest.new - - # Call the create_entity_type method. - result = client.create_entity_type request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::EntityType. - p result -end -# [END dialogflow_v3_generated_EntityTypes_CreateEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/delete_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/delete_entity_type.rb deleted file mode 100644 index 728393aa4135..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_EntityTypes_DeleteEntityType_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::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::CX::V3::EntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::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_v3_generated_EntityTypes_DeleteEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/export_entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/export_entity_types.rb deleted file mode 100644 index b3eb7329f093..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/export_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_v3_generated_EntityTypes_ExportEntityTypes_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the export_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::CX::V3::EntityTypes::Client#export_entity_types. -# -def export_entity_types - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest.new - - # Call the export_entity_types method. - result = client.export_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_v3_generated_EntityTypes_ExportEntityTypes_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/get_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/get_entity_type.rb deleted file mode 100644 index 7c19fbbb315f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_EntityTypes_GetEntityType_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::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::CX::V3::EntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::GetEntityTypeRequest.new - - # Call the get_entity_type method. - result = client.get_entity_type request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::EntityType. - p result -end -# [END dialogflow_v3_generated_EntityTypes_GetEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/import_entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/import_entity_types.rb deleted file mode 100644 index 019b221c76cb..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/import_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_v3_generated_EntityTypes_ImportEntityTypes_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the import_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::CX::V3::EntityTypes::Client#import_entity_types. -# -def import_entity_types - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest.new - - # Call the import_entity_types method. - result = client.import_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_v3_generated_EntityTypes_ImportEntityTypes_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/list_entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/list_entity_types.rb deleted file mode 100644 index 134251909f14..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_EntityTypes_ListEntityTypes_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::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::CX::V3::EntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityType. - p item - end -end -# [END dialogflow_v3_generated_EntityTypes_ListEntityTypes_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/update_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/entity_types/update_entity_type.rb deleted file mode 100644 index 0bb801564f2e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_EntityTypes_UpdateEntityType_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::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::CX::V3::EntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest.new - - # Call the update_entity_type method. - result = client.update_entity_type request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::EntityType. - p result -end -# [END dialogflow_v3_generated_EntityTypes_UpdateEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/create_environment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/create_environment.rb deleted file mode 100644 index b836547f33d7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/create_environment.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_v3_generated_Environments_CreateEnvironment_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Environments::Client#create_environment. -# -def create_environment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest.new - - # Call the create_environment method. - result = client.create_environment request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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_v3_generated_Environments_CreateEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/delete_environment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/delete_environment.rb deleted file mode 100644 index ac3ba1737b8e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Environments_DeleteEnvironment_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Environments::Client#delete_environment. -# -def delete_environment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::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_v3_generated_Environments_DeleteEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/deploy_flow.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/deploy_flow.rb deleted file mode 100644 index 5a8f0eeae5fc..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/deploy_flow.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_v3_generated_Environments_DeployFlow_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the deploy_flow 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::CX::V3::Environments::Client#deploy_flow. -# -def deploy_flow - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest.new - - # Call the deploy_flow method. - result = client.deploy_flow request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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_v3_generated_Environments_DeployFlow_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/get_environment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/get_environment.rb deleted file mode 100644 index 8ff377a13294..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Environments_GetEnvironment_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Environments::Client#get_environment. -# -def get_environment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest.new - - # Call the get_environment method. - result = client.get_environment request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Environment. - p result -end -# [END dialogflow_v3_generated_Environments_GetEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/list_continuous_test_results.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/list_continuous_test_results.rb deleted file mode 100644 index 80c09617365c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/list_continuous_test_results.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_v3_generated_Environments_ListContinuousTestResults_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the list_continuous_test_results 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::CX::V3::Environments::Client#list_continuous_test_results. -# -def list_continuous_test_results - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest.new - - # Call the list_continuous_test_results method. - result = client.list_continuous_test_results request - - # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::ContinuousTestResult. - p item - end -end -# [END dialogflow_v3_generated_Environments_ListContinuousTestResults_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/list_environments.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/list_environments.rb deleted file mode 100644 index 96701976be27..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Environments_ListEnvironments_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Environments::Client#list_environments. -# -def list_environments - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Environment. - p item - end -end -# [END dialogflow_v3_generated_Environments_ListEnvironments_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/lookup_environment_history.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/lookup_environment_history.rb deleted file mode 100644 index 25a30078458b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/lookup_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_v3_generated_Environments_LookupEnvironmentHistory_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the lookup_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::CX::V3::Environments::Client#lookup_environment_history. -# -def lookup_environment_history - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest.new - - # Call the lookup_environment_history method. - result = client.lookup_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::CX::V3::Environment. - p item - end -end -# [END dialogflow_v3_generated_Environments_LookupEnvironmentHistory_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/run_continuous_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/run_continuous_test.rb deleted file mode 100644 index a13e9221f982..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/run_continuous_test.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_v3_generated_Environments_RunContinuousTest_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the run_continuous_test 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::CX::V3::Environments::Client#run_continuous_test. -# -def run_continuous_test - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest.new - - # Call the run_continuous_test method. - result = client.run_continuous_test request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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_v3_generated_Environments_RunContinuousTest_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/update_environment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/update_environment.rb deleted file mode 100644 index c01169c65456..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/environments/update_environment.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_v3_generated_Environments_UpdateEnvironment_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Environments::Client#update_environment. -# -def update_environment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest.new - - # Call the update_environment method. - result = client.update_environment request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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_v3_generated_Environments_UpdateEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/create_experiment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/create_experiment.rb deleted file mode 100644 index 2926ab20768e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/create_experiment.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_v3_generated_Experiments_CreateExperiment_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the create_experiment call in the Experiments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Experiments::Client#create_experiment. -# -def create_experiment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest.new - - # Call the create_experiment method. - result = client.create_experiment request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. - p result -end -# [END dialogflow_v3_generated_Experiments_CreateExperiment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/delete_experiment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/delete_experiment.rb deleted file mode 100644 index 36e1e6d5c785..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/delete_experiment.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_v3_generated_Experiments_DeleteExperiment_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the delete_experiment call in the Experiments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Experiments::Client#delete_experiment. -# -def delete_experiment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest.new - - # Call the delete_experiment method. - result = client.delete_experiment request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dialogflow_v3_generated_Experiments_DeleteExperiment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/get_experiment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/get_experiment.rb deleted file mode 100644 index 33a286b517de..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/get_experiment.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_v3_generated_Experiments_GetExperiment_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the get_experiment call in the Experiments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Experiments::Client#get_experiment. -# -def get_experiment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest.new - - # Call the get_experiment method. - result = client.get_experiment request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. - p result -end -# [END dialogflow_v3_generated_Experiments_GetExperiment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/list_experiments.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/list_experiments.rb deleted file mode 100644 index dd1b255ae666..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/list_experiments.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_v3_generated_Experiments_ListExperiments_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the list_experiments call in the Experiments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Experiments::Client#list_experiments. -# -def list_experiments - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest.new - - # Call the list_experiments method. - result = client.list_experiments request - - # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Experiment. - p item - end -end -# [END dialogflow_v3_generated_Experiments_ListExperiments_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/start_experiment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/start_experiment.rb deleted file mode 100644 index 1279deafbbd7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/start_experiment.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_v3_generated_Experiments_StartExperiment_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the start_experiment call in the Experiments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Experiments::Client#start_experiment. -# -def start_experiment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest.new - - # Call the start_experiment method. - result = client.start_experiment request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. - p result -end -# [END dialogflow_v3_generated_Experiments_StartExperiment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/stop_experiment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/stop_experiment.rb deleted file mode 100644 index 3d53a5719294..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/stop_experiment.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_v3_generated_Experiments_StopExperiment_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the stop_experiment call in the Experiments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Experiments::Client#stop_experiment. -# -def stop_experiment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest.new - - # Call the stop_experiment method. - result = client.stop_experiment request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. - p result -end -# [END dialogflow_v3_generated_Experiments_StopExperiment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/update_experiment.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/update_experiment.rb deleted file mode 100644 index d82b6c0fa751..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/experiments/update_experiment.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_v3_generated_Experiments_UpdateExperiment_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the update_experiment call in the Experiments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Experiments::Client#update_experiment. -# -def update_experiment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest.new - - # Call the update_experiment method. - result = client.update_experiment request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. - p result -end -# [END dialogflow_v3_generated_Experiments_UpdateExperiment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/create_flow.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/create_flow.rb deleted file mode 100644 index a66d58ed9409..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/create_flow.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_v3_generated_Flows_CreateFlow_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the create_flow call in the Flows service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Flows::Client#create_flow. -# -def create_flow - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest.new - - # Call the create_flow method. - result = client.create_flow request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. - p result -end -# [END dialogflow_v3_generated_Flows_CreateFlow_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/delete_flow.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/delete_flow.rb deleted file mode 100644 index d5b7f9487717..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/delete_flow.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_v3_generated_Flows_DeleteFlow_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the delete_flow call in the Flows service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Flows::Client#delete_flow. -# -def delete_flow - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest.new - - # Call the delete_flow method. - result = client.delete_flow request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dialogflow_v3_generated_Flows_DeleteFlow_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/export_flow.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/export_flow.rb deleted file mode 100644 index 12f4341e5d0c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/export_flow.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_v3_generated_Flows_ExportFlow_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the export_flow call in the Flows service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Flows::Client#export_flow. -# -def export_flow - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest.new - - # Call the export_flow method. - result = client.export_flow request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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_v3_generated_Flows_ExportFlow_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow.rb deleted file mode 100644 index 1e3c7a71bb60..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow.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_v3_generated_Flows_GetFlow_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the get_flow call in the Flows service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Flows::Client#get_flow. -# -def get_flow - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::GetFlowRequest.new - - # Call the get_flow method. - result = client.get_flow request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. - p result -end -# [END dialogflow_v3_generated_Flows_GetFlow_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow_validation_result.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow_validation_result.rb deleted file mode 100644 index b4d34f485932..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow_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_v3_generated_Flows_GetFlowValidationResult_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the get_flow_validation_result call in the Flows service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Flows::Client#get_flow_validation_result. -# -def get_flow_validation_result - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest.new - - # Call the get_flow_validation_result method. - result = client.get_flow_validation_result request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FlowValidationResult. - p result -end -# [END dialogflow_v3_generated_Flows_GetFlowValidationResult_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/import_flow.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/import_flow.rb deleted file mode 100644 index 1aed6e9924de..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/import_flow.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_v3_generated_Flows_ImportFlow_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the import_flow call in the Flows service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Flows::Client#import_flow. -# -def import_flow - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest.new - - # Call the import_flow method. - result = client.import_flow request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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_v3_generated_Flows_ImportFlow_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/list_flows.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/list_flows.rb deleted file mode 100644 index 375ca2789ab0..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/list_flows.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_v3_generated_Flows_ListFlows_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the list_flows call in the Flows service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Flows::Client#list_flows. -# -def list_flows - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest.new - - # Call the list_flows method. - result = client.list_flows request - - # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Flow. - p item - end -end -# [END dialogflow_v3_generated_Flows_ListFlows_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/train_flow.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/train_flow.rb deleted file mode 100644 index 865191b559c0..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/train_flow.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_v3_generated_Flows_TrainFlow_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the train_flow call in the Flows service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Flows::Client#train_flow. -# -def train_flow - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest.new - - # Call the train_flow method. - result = client.train_flow request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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_v3_generated_Flows_TrainFlow_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/update_flow.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/update_flow.rb deleted file mode 100644 index 86f322385938..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/update_flow.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_v3_generated_Flows_UpdateFlow_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the update_flow call in the Flows service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Flows::Client#update_flow. -# -def update_flow - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest.new - - # Call the update_flow method. - result = client.update_flow request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. - p result -end -# [END dialogflow_v3_generated_Flows_UpdateFlow_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/validate_flow.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/validate_flow.rb deleted file mode 100644 index d4b01430be56..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/flows/validate_flow.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_v3_generated_Flows_ValidateFlow_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the validate_flow call in the Flows service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Flows::Client#validate_flow. -# -def validate_flow - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest.new - - # Call the validate_flow method. - result = client.validate_flow request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FlowValidationResult. - p result -end -# [END dialogflow_v3_generated_Flows_ValidateFlow_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/create_generator.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/create_generator.rb deleted file mode 100644 index 4fda4c0102a9..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Generators_CreateGenerator_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Generators::Client#create_generator. -# -def create_generator - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Generators::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest.new - - # Call the create_generator method. - result = client.create_generator request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Generator. - p result -end -# [END dialogflow_v3_generated_Generators_CreateGenerator_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/delete_generator.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/delete_generator.rb deleted file mode 100644 index 815d939d4230..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Generators_DeleteGenerator_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Generators::Client#delete_generator. -# -def delete_generator - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Generators::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::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_v3_generated_Generators_DeleteGenerator_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/get_generator.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/get_generator.rb deleted file mode 100644 index 96344e19d99c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Generators_GetGenerator_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Generators::Client#get_generator. -# -def get_generator - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Generators::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest.new - - # Call the get_generator method. - result = client.get_generator request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Generator. - p result -end -# [END dialogflow_v3_generated_Generators_GetGenerator_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/list_generators.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/list_generators.rb deleted file mode 100644 index cf87578466f2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Generators_ListGenerators_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Generators::Client#list_generators. -# -def list_generators - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Generators::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Generator. - p item - end -end -# [END dialogflow_v3_generated_Generators_ListGenerators_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/update_generator.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/generators/update_generator.rb deleted file mode 100644 index 24ac684e840b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Generators_UpdateGenerator_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Generators::Client#update_generator. -# -def update_generator - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Generators::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest.new - - # Call the update_generator method. - result = client.update_generator request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Generator. - p result -end -# [END dialogflow_v3_generated_Generators_UpdateGenerator_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/create_intent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/create_intent.rb deleted file mode 100644 index aa6d4100c53b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Intents_CreateIntent_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Intents::Client#create_intent. -# -def create_intent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest.new - - # Call the create_intent method. - result = client.create_intent request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Intent. - p result -end -# [END dialogflow_v3_generated_Intents_CreateIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/delete_intent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/delete_intent.rb deleted file mode 100644 index dafa20750bdf..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Intents_DeleteIntent_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Intents::Client#delete_intent. -# -def delete_intent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::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_v3_generated_Intents_DeleteIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/export_intents.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/export_intents.rb deleted file mode 100644 index 893da025b132..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/export_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_v3_generated_Intents_ExportIntents_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the export_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::CX::V3::Intents::Client#export_intents. -# -def export_intents - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest.new - - # Call the export_intents method. - result = client.export_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_v3_generated_Intents_ExportIntents_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/get_intent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/get_intent.rb deleted file mode 100644 index 73a3d873df2c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Intents_GetIntent_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Intents::Client#get_intent. -# -def get_intent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::GetIntentRequest.new - - # Call the get_intent method. - result = client.get_intent request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Intent. - p result -end -# [END dialogflow_v3_generated_Intents_GetIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/import_intents.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/import_intents.rb deleted file mode 100644 index c842dc082d4f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/import_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_v3_generated_Intents_ImportIntents_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the import_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::CX::V3::Intents::Client#import_intents. -# -def import_intents - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest.new - - # Call the import_intents method. - result = client.import_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_v3_generated_Intents_ImportIntents_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/list_intents.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/list_intents.rb deleted file mode 100644 index 6c354c11a23c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Intents_ListIntents_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Intents::Client#list_intents. -# -def list_intents - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Intent. - p item - end -end -# [END dialogflow_v3_generated_Intents_ListIntents_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/update_intent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/intents/update_intent.rb deleted file mode 100644 index c47ee7bac094..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Intents_UpdateIntent_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Intents::Client#update_intent. -# -def update_intent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest.new - - # Call the update_intent method. - result = client.update_intent request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Intent. - p result -end -# [END dialogflow_v3_generated_Intents_UpdateIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/create_page.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/create_page.rb deleted file mode 100644 index 1f8bf8b0526f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/create_page.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_v3_generated_Pages_CreatePage_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the create_page call in the Pages service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Pages::Client#create_page. -# -def create_page - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::CreatePageRequest.new - - # Call the create_page method. - result = client.create_page request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. - p result -end -# [END dialogflow_v3_generated_Pages_CreatePage_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/delete_page.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/delete_page.rb deleted file mode 100644 index 045a38e147bf..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/delete_page.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_v3_generated_Pages_DeletePage_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the delete_page call in the Pages service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Pages::Client#delete_page. -# -def delete_page - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::DeletePageRequest.new - - # Call the delete_page method. - result = client.delete_page request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dialogflow_v3_generated_Pages_DeletePage_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/get_page.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/get_page.rb deleted file mode 100644 index 899bea46dca0..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/get_page.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_v3_generated_Pages_GetPage_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the get_page call in the Pages service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Pages::Client#get_page. -# -def get_page - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::GetPageRequest.new - - # Call the get_page method. - result = client.get_page request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. - p result -end -# [END dialogflow_v3_generated_Pages_GetPage_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/list_pages.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/list_pages.rb deleted file mode 100644 index 761863e65cce..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/list_pages.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_v3_generated_Pages_ListPages_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the list_pages call in the Pages service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Pages::Client#list_pages. -# -def list_pages - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ListPagesRequest.new - - # Call the list_pages method. - result = client.list_pages request - - # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Page. - p item - end -end -# [END dialogflow_v3_generated_Pages_ListPages_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/update_page.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/update_page.rb deleted file mode 100644 index bea306fd20ce..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/pages/update_page.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_v3_generated_Pages_UpdatePage_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the update_page call in the Pages service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Pages::Client#update_page. -# -def update_page - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest.new - - # Call the update_page method. - result = client.update_page request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. - p result -end -# [END dialogflow_v3_generated_Pages_UpdatePage_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/create_security_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/create_security_settings.rb deleted file mode 100644 index 9d2e33ac0d6d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/create_security_settings.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_v3_generated_SecuritySettingsService_CreateSecuritySettings_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the create_security_settings call in the SecuritySettingsService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#create_security_settings. -# -def create_security_settings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest.new - - # Call the create_security_settings method. - result = client.create_security_settings request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. - p result -end -# [END dialogflow_v3_generated_SecuritySettingsService_CreateSecuritySettings_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/delete_security_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/delete_security_settings.rb deleted file mode 100644 index 4654492300a7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/delete_security_settings.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_v3_generated_SecuritySettingsService_DeleteSecuritySettings_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the delete_security_settings call in the SecuritySettingsService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#delete_security_settings. -# -def delete_security_settings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest.new - - # Call the delete_security_settings method. - result = client.delete_security_settings request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dialogflow_v3_generated_SecuritySettingsService_DeleteSecuritySettings_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/get_security_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/get_security_settings.rb deleted file mode 100644 index ea47f2995a50..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/get_security_settings.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_v3_generated_SecuritySettingsService_GetSecuritySettings_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the get_security_settings call in the SecuritySettingsService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#get_security_settings. -# -def get_security_settings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest.new - - # Call the get_security_settings method. - result = client.get_security_settings request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. - p result -end -# [END dialogflow_v3_generated_SecuritySettingsService_GetSecuritySettings_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/list_security_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/list_security_settings.rb deleted file mode 100644 index 3b9b5610189d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/list_security_settings.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_v3_generated_SecuritySettingsService_ListSecuritySettings_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the list_security_settings call in the SecuritySettingsService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#list_security_settings. -# -def list_security_settings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest.new - - # Call the list_security_settings method. - result = client.list_security_settings request - - # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::SecuritySettings. - p item - end -end -# [END dialogflow_v3_generated_SecuritySettingsService_ListSecuritySettings_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/update_security_settings.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/update_security_settings.rb deleted file mode 100644 index 7d8c8b807796..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/update_security_settings.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_v3_generated_SecuritySettingsService_UpdateSecuritySettings_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the update_security_settings call in the SecuritySettingsService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#update_security_settings. -# -def update_security_settings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest.new - - # Call the update_security_settings method. - result = client.update_security_settings request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. - p result -end -# [END dialogflow_v3_generated_SecuritySettingsService_UpdateSecuritySettings_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/create_session_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/create_session_entity_type.rb deleted file mode 100644 index acf52fa33a09..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_SessionEntityTypes_CreateSessionEntityType_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::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::CX::V3::SessionEntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityType. - p result -end -# [END dialogflow_v3_generated_SessionEntityTypes_CreateSessionEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/delete_session_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/delete_session_entity_type.rb deleted file mode 100644 index 749d8ced56da..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_SessionEntityTypes_DeleteSessionEntityType_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::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::CX::V3::SessionEntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::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_v3_generated_SessionEntityTypes_DeleteSessionEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/get_session_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/get_session_entity_type.rb deleted file mode 100644 index a739844a53e9..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_SessionEntityTypes_GetSessionEntityType_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::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::CX::V3::SessionEntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityType. - p result -end -# [END dialogflow_v3_generated_SessionEntityTypes_GetSessionEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/list_session_entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/list_session_entity_types.rb deleted file mode 100644 index 98978b59f6fd..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_SessionEntityTypes_ListSessionEntityTypes_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::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::CX::V3::SessionEntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityType. - p item - end -end -# [END dialogflow_v3_generated_SessionEntityTypes_ListSessionEntityTypes_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/update_session_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/update_session_entity_type.rb deleted file mode 100644 index 0f62fdda9f61..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_SessionEntityTypes_UpdateSessionEntityType_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::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::CX::V3::SessionEntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityType. - p result -end -# [END dialogflow_v3_generated_SessionEntityTypes_UpdateSessionEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/detect_intent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/detect_intent.rb deleted file mode 100644 index 4a3479b8e346..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Sessions_DetectIntent_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Sessions::Client#detect_intent. -# -def detect_intent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new - - # Call the detect_intent method. - result = client.detect_intent request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse. - p result -end -# [END dialogflow_v3_generated_Sessions_DetectIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/fulfill_intent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/fulfill_intent.rb deleted file mode 100644 index 993db87c1414..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/fulfill_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_v3_generated_Sessions_FulfillIntent_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the fulfill_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::CX::V3::Sessions::Client#fulfill_intent. -# -def fulfill_intent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest.new - - # Call the fulfill_intent method. - result = client.fulfill_intent request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse. - p result -end -# [END dialogflow_v3_generated_Sessions_FulfillIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/match_intent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/match_intent.rb deleted file mode 100644 index d84752c23442..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/match_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_v3_generated_Sessions_MatchIntent_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the match_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::CX::V3::Sessions::Client#match_intent. -# -def match_intent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest.new - - # Call the match_intent method. - result = client.match_intent request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse. - p result -end -# [END dialogflow_v3_generated_Sessions_MatchIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/server_streaming_detect_intent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/server_streaming_detect_intent.rb deleted file mode 100644 index 82bfeb6585e3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/server_streaming_detect_intent.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dialogflow_v3_generated_Sessions_ServerStreamingDetectIntent_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the server_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::CX::V3::Sessions::Client#server_streaming_detect_intent. -# -def server_streaming_detect_intent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new - - # Call the server_streaming_detect_intent method to start streaming. - output = client.server_streaming_detect_intent request - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse - output.each do |current_response| - p current_response - end -end -# [END dialogflow_v3_generated_Sessions_ServerStreamingDetectIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/streaming_detect_intent.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/streaming_detect_intent.rb deleted file mode 100644 index 7269925f68cd..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Sessions_StreamingDetectIntent_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::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::CX::V3::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::CX::V3::StreamingDetectIntentRequest.new - input << Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new - input.close - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentResponse - output.each do |current_response| - p current_response - end -end -# [END dialogflow_v3_generated_Sessions_StreamingDetectIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/submit_answer_feedback.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/submit_answer_feedback.rb deleted file mode 100644 index 4b663f60ecb4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/sessions/submit_answer_feedback.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_v3_generated_Sessions_SubmitAnswerFeedback_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the submit_answer_feedback 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::CX::V3::Sessions::Client#submit_answer_feedback. -# -def submit_answer_feedback - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest.new - - # Call the submit_answer_feedback method. - result = client.submit_answer_feedback request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AnswerFeedback. - p result -end -# [END dialogflow_v3_generated_Sessions_SubmitAnswerFeedback_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/snippet_metadata_google.cloud.dialogflow.cx.v3.json b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/snippet_metadata_google.cloud.dialogflow.cx.v3.json deleted file mode 100644 index 4e9f0e73ab9e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/snippet_metadata_google.cloud.dialogflow.cx.v3.json +++ /dev/null @@ -1,5495 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-dialogflow-cx-v3", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.dialogflow.cx.v3", - "version": "v3" - } - ] - }, - "snippets": [ - { - "region_tag": "dialogflow_v3_generated_Pages_ListPages_sync", - "title": "Snippet for the list_pages call in the Pages service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Pages::Client#list_pages.", - "file": "pages/list_pages.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_pages", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client#list_pages", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListPagesResponse", - "client": { - "short_name": "Pages::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client" - }, - "method": { - "short_name": "ListPages", - "full_name": "google.cloud.dialogflow.cx.v3.Pages.ListPages", - "service": { - "short_name": "Pages", - "full_name": "google.cloud.dialogflow.cx.v3.Pages" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Pages_GetPage_sync", - "title": "Snippet for the get_page call in the Pages service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Pages::Client#get_page.", - "file": "pages/get_page.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_page", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client#get_page", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetPageRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Page", - "client": { - "short_name": "Pages::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client" - }, - "method": { - "short_name": "GetPage", - "full_name": "google.cloud.dialogflow.cx.v3.Pages.GetPage", - "service": { - "short_name": "Pages", - "full_name": "google.cloud.dialogflow.cx.v3.Pages" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Pages_CreatePage_sync", - "title": "Snippet for the create_page call in the Pages service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Pages::Client#create_page.", - "file": "pages/create_page.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_page", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client#create_page", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Page", - "client": { - "short_name": "Pages::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client" - }, - "method": { - "short_name": "CreatePage", - "full_name": "google.cloud.dialogflow.cx.v3.Pages.CreatePage", - "service": { - "short_name": "Pages", - "full_name": "google.cloud.dialogflow.cx.v3.Pages" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Pages_UpdatePage_sync", - "title": "Snippet for the update_page call in the Pages service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Pages::Client#update_page.", - "file": "pages/update_page.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_page", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client#update_page", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Page", - "client": { - "short_name": "Pages::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client" - }, - "method": { - "short_name": "UpdatePage", - "full_name": "google.cloud.dialogflow.cx.v3.Pages.UpdatePage", - "service": { - "short_name": "Pages", - "full_name": "google.cloud.dialogflow.cx.v3.Pages" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Pages_DeletePage_sync", - "title": "Snippet for the delete_page call in the Pages service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Pages::Client#delete_page.", - "file": "pages/delete_page.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_page", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client#delete_page", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Pages::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Pages::Client" - }, - "method": { - "short_name": "DeletePage", - "full_name": "google.cloud.dialogflow.cx.v3.Pages.DeletePage", - "service": { - "short_name": "Pages", - "full_name": "google.cloud.dialogflow.cx.v3.Pages" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Flows_CreateFlow_sync", - "title": "Snippet for the create_flow call in the Flows service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Flows::Client#create_flow.", - "file": "flows/create_flow.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_flow", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client#create_flow", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Flow", - "client": { - "short_name": "Flows::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client" - }, - "method": { - "short_name": "CreateFlow", - "full_name": "google.cloud.dialogflow.cx.v3.Flows.CreateFlow", - "service": { - "short_name": "Flows", - "full_name": "google.cloud.dialogflow.cx.v3.Flows" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Flows_DeleteFlow_sync", - "title": "Snippet for the delete_flow call in the Flows service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Flows::Client#delete_flow.", - "file": "flows/delete_flow.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_flow", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client#delete_flow", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Flows::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client" - }, - "method": { - "short_name": "DeleteFlow", - "full_name": "google.cloud.dialogflow.cx.v3.Flows.DeleteFlow", - "service": { - "short_name": "Flows", - "full_name": "google.cloud.dialogflow.cx.v3.Flows" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Flows_ListFlows_sync", - "title": "Snippet for the list_flows call in the Flows service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Flows::Client#list_flows.", - "file": "flows/list_flows.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_flows", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client#list_flows", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListFlowsResponse", - "client": { - "short_name": "Flows::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client" - }, - "method": { - "short_name": "ListFlows", - "full_name": "google.cloud.dialogflow.cx.v3.Flows.ListFlows", - "service": { - "short_name": "Flows", - "full_name": "google.cloud.dialogflow.cx.v3.Flows" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Flows_GetFlow_sync", - "title": "Snippet for the get_flow call in the Flows service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Flows::Client#get_flow.", - "file": "flows/get_flow.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_flow", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client#get_flow", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Flow", - "client": { - "short_name": "Flows::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client" - }, - "method": { - "short_name": "GetFlow", - "full_name": "google.cloud.dialogflow.cx.v3.Flows.GetFlow", - "service": { - "short_name": "Flows", - "full_name": "google.cloud.dialogflow.cx.v3.Flows" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Flows_UpdateFlow_sync", - "title": "Snippet for the update_flow call in the Flows service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Flows::Client#update_flow.", - "file": "flows/update_flow.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_flow", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client#update_flow", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Flow", - "client": { - "short_name": "Flows::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client" - }, - "method": { - "short_name": "UpdateFlow", - "full_name": "google.cloud.dialogflow.cx.v3.Flows.UpdateFlow", - "service": { - "short_name": "Flows", - "full_name": "google.cloud.dialogflow.cx.v3.Flows" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Flows_TrainFlow_sync", - "title": "Snippet for the train_flow call in the Flows service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Flows::Client#train_flow.", - "file": "flows/train_flow.rb", - "language": "RUBY", - "client_method": { - "short_name": "train_flow", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client#train_flow", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Flows::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client" - }, - "method": { - "short_name": "TrainFlow", - "full_name": "google.cloud.dialogflow.cx.v3.Flows.TrainFlow", - "service": { - "short_name": "Flows", - "full_name": "google.cloud.dialogflow.cx.v3.Flows" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Flows_ValidateFlow_sync", - "title": "Snippet for the validate_flow call in the Flows service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Flows::Client#validate_flow.", - "file": "flows/validate_flow.rb", - "language": "RUBY", - "client_method": { - "short_name": "validate_flow", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client#validate_flow", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult", - "client": { - "short_name": "Flows::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client" - }, - "method": { - "short_name": "ValidateFlow", - "full_name": "google.cloud.dialogflow.cx.v3.Flows.ValidateFlow", - "service": { - "short_name": "Flows", - "full_name": "google.cloud.dialogflow.cx.v3.Flows" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Flows_GetFlowValidationResult_sync", - "title": "Snippet for the get_flow_validation_result call in the Flows service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Flows::Client#get_flow_validation_result.", - "file": "flows/get_flow_validation_result.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_flow_validation_result", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client#get_flow_validation_result", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult", - "client": { - "short_name": "Flows::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client" - }, - "method": { - "short_name": "GetFlowValidationResult", - "full_name": "google.cloud.dialogflow.cx.v3.Flows.GetFlowValidationResult", - "service": { - "short_name": "Flows", - "full_name": "google.cloud.dialogflow.cx.v3.Flows" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Flows_ImportFlow_sync", - "title": "Snippet for the import_flow call in the Flows service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Flows::Client#import_flow.", - "file": "flows/import_flow.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_flow", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client#import_flow", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Flows::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client" - }, - "method": { - "short_name": "ImportFlow", - "full_name": "google.cloud.dialogflow.cx.v3.Flows.ImportFlow", - "service": { - "short_name": "Flows", - "full_name": "google.cloud.dialogflow.cx.v3.Flows" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Flows_ExportFlow_sync", - "title": "Snippet for the export_flow call in the Flows service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Flows::Client#export_flow.", - "file": "flows/export_flow.rb", - "language": "RUBY", - "client_method": { - "short_name": "export_flow", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client#export_flow", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Flows::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Flows::Client" - }, - "method": { - "short_name": "ExportFlow", - "full_name": "google.cloud.dialogflow.cx.v3.Flows.ExportFlow", - "service": { - "short_name": "Flows", - "full_name": "google.cloud.dialogflow.cx.v3.Flows" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Agents_ListAgents_sync", - "title": "Snippet for the list_agents call in the Agents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Agents::Client#list_agents.", - "file": "agents/list_agents.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_agents", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#list_agents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListAgentsResponse", - "client": { - "short_name": "Agents::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" - }, - "method": { - "short_name": "ListAgents", - "full_name": "google.cloud.dialogflow.cx.v3.Agents.ListAgents", - "service": { - "short_name": "Agents", - "full_name": "google.cloud.dialogflow.cx.v3.Agents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Agents::Client#get_agent.", - "file": "agents/get_agent.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_agent", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#get_agent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetAgentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Agent", - "client": { - "short_name": "Agents::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" - }, - "method": { - "short_name": "GetAgent", - "full_name": "google.cloud.dialogflow.cx.v3.Agents.GetAgent", - "service": { - "short_name": "Agents", - "full_name": "google.cloud.dialogflow.cx.v3.Agents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Agents_CreateAgent_sync", - "title": "Snippet for the create_agent call in the Agents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Agents::Client#create_agent.", - "file": "agents/create_agent.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_agent", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#create_agent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Agent", - "client": { - "short_name": "Agents::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" - }, - "method": { - "short_name": "CreateAgent", - "full_name": "google.cloud.dialogflow.cx.v3.Agents.CreateAgent", - "service": { - "short_name": "Agents", - "full_name": "google.cloud.dialogflow.cx.v3.Agents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Agents_UpdateAgent_sync", - "title": "Snippet for the update_agent call in the Agents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Agents::Client#update_agent.", - "file": "agents/update_agent.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_agent", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#update_agent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Agent", - "client": { - "short_name": "Agents::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" - }, - "method": { - "short_name": "UpdateAgent", - "full_name": "google.cloud.dialogflow.cx.v3.Agents.UpdateAgent", - "service": { - "short_name": "Agents", - "full_name": "google.cloud.dialogflow.cx.v3.Agents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Agents::Client#delete_agent.", - "file": "agents/delete_agent.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_agent", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#delete_agent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteAgentRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Agents::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" - }, - "method": { - "short_name": "DeleteAgent", - "full_name": "google.cloud.dialogflow.cx.v3.Agents.DeleteAgent", - "service": { - "short_name": "Agents", - "full_name": "google.cloud.dialogflow.cx.v3.Agents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Agents::Client#export_agent.", - "file": "agents/export_agent.rb", - "language": "RUBY", - "client_method": { - "short_name": "export_agent", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#export_agent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Agents::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" - }, - "method": { - "short_name": "ExportAgent", - "full_name": "google.cloud.dialogflow.cx.v3.Agents.ExportAgent", - "service": { - "short_name": "Agents", - "full_name": "google.cloud.dialogflow.cx.v3.Agents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Agents::Client#restore_agent.", - "file": "agents/restore_agent.rb", - "language": "RUBY", - "client_method": { - "short_name": "restore_agent", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#restore_agent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Agents::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" - }, - "method": { - "short_name": "RestoreAgent", - "full_name": "google.cloud.dialogflow.cx.v3.Agents.RestoreAgent", - "service": { - "short_name": "Agents", - "full_name": "google.cloud.dialogflow.cx.v3.Agents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Agents_ValidateAgent_sync", - "title": "Snippet for the validate_agent call in the Agents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Agents::Client#validate_agent.", - "file": "agents/validate_agent.rb", - "language": "RUBY", - "client_method": { - "short_name": "validate_agent", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#validate_agent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult", - "client": { - "short_name": "Agents::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" - }, - "method": { - "short_name": "ValidateAgent", - "full_name": "google.cloud.dialogflow.cx.v3.Agents.ValidateAgent", - "service": { - "short_name": "Agents", - "full_name": "google.cloud.dialogflow.cx.v3.Agents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Agents_GetAgentValidationResult_sync", - "title": "Snippet for the get_agent_validation_result call in the Agents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Agents::Client#get_agent_validation_result.", - "file": "agents/get_agent_validation_result.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_agent_validation_result", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#get_agent_validation_result", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult", - "client": { - "short_name": "Agents::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" - }, - "method": { - "short_name": "GetAgentValidationResult", - "full_name": "google.cloud.dialogflow.cx.v3.Agents.GetAgentValidationResult", - "service": { - "short_name": "Agents", - "full_name": "google.cloud.dialogflow.cx.v3.Agents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Agents_GetGenerativeSettings_sync", - "title": "Snippet for the get_generative_settings call in the Agents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Agents::Client#get_generative_settings.", - "file": "agents/get_generative_settings.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_generative_settings", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#get_generative_settings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings", - "client": { - "short_name": "Agents::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" - }, - "method": { - "short_name": "GetGenerativeSettings", - "full_name": "google.cloud.dialogflow.cx.v3.Agents.GetGenerativeSettings", - "service": { - "short_name": "Agents", - "full_name": "google.cloud.dialogflow.cx.v3.Agents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Agents_UpdateGenerativeSettings_sync", - "title": "Snippet for the update_generative_settings call in the Agents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Agents::Client#update_generative_settings.", - "file": "agents/update_generative_settings.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_generative_settings", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client#update_generative_settings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings", - "client": { - "short_name": "Agents::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Agents::Client" - }, - "method": { - "short_name": "UpdateGenerativeSettings", - "full_name": "google.cloud.dialogflow.cx.v3.Agents.UpdateGenerativeSettings", - "service": { - "short_name": "Agents", - "full_name": "google.cloud.dialogflow.cx.v3.Agents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Changelogs_ListChangelogs_sync", - "title": "Snippet for the list_changelogs call in the Changelogs service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Changelogs::Client#list_changelogs.", - "file": "changelogs/list_changelogs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_changelogs", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client#list_changelogs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListChangelogsResponse", - "client": { - "short_name": "Changelogs::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client" - }, - "method": { - "short_name": "ListChangelogs", - "full_name": "google.cloud.dialogflow.cx.v3.Changelogs.ListChangelogs", - "service": { - "short_name": "Changelogs", - "full_name": "google.cloud.dialogflow.cx.v3.Changelogs" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Changelogs_GetChangelog_sync", - "title": "Snippet for the get_changelog call in the Changelogs service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Changelogs::Client#get_changelog.", - "file": "changelogs/get_changelog.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_changelog", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client#get_changelog", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Changelog", - "client": { - "short_name": "Changelogs::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client" - }, - "method": { - "short_name": "GetChangelog", - "full_name": "google.cloud.dialogflow.cx.v3.Changelogs.GetChangelog", - "service": { - "short_name": "Changelogs", - "full_name": "google.cloud.dialogflow.cx.v3.Changelogs" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Deployments_ListDeployments_sync", - "title": "Snippet for the list_deployments call in the Deployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Deployments::Client#list_deployments.", - "file": "deployments/list_deployments.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_deployments", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Deployments::Client#list_deployments", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsResponse", - "client": { - "short_name": "Deployments::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Deployments::Client" - }, - "method": { - "short_name": "ListDeployments", - "full_name": "google.cloud.dialogflow.cx.v3.Deployments.ListDeployments", - "service": { - "short_name": "Deployments", - "full_name": "google.cloud.dialogflow.cx.v3.Deployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Deployments_GetDeployment_sync", - "title": "Snippet for the get_deployment call in the Deployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Deployments::Client#get_deployment.", - "file": "deployments/get_deployment.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_deployment", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Deployments::Client#get_deployment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Deployment", - "client": { - "short_name": "Deployments::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Deployments::Client" - }, - "method": { - "short_name": "GetDeployment", - "full_name": "google.cloud.dialogflow.cx.v3.Deployments.GetDeployment", - "service": { - "short_name": "Deployments", - "full_name": "google.cloud.dialogflow.cx.v3.Deployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::EntityTypes::Client#get_entity_type", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetEntityTypeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::EntityType", - "client": { - "short_name": "EntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client" - }, - "method": { - "short_name": "GetEntityType", - "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes.GetEntityType", - "service": { - "short_name": "EntityTypes", - "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::EntityTypes::Client#create_entity_type", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::EntityType", - "client": { - "short_name": "EntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client" - }, - "method": { - "short_name": "CreateEntityType", - "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes.CreateEntityType", - "service": { - "short_name": "EntityTypes", - "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::EntityTypes::Client#update_entity_type", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::EntityType", - "client": { - "short_name": "EntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client" - }, - "method": { - "short_name": "UpdateEntityType", - "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes.UpdateEntityType", - "service": { - "short_name": "EntityTypes", - "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::EntityTypes::Client#delete_entity_type", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "EntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client" - }, - "method": { - "short_name": "DeleteEntityType", - "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes.DeleteEntityType", - "service": { - "short_name": "EntityTypes", - "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::EntityTypes::Client#list_entity_types", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesResponse", - "client": { - "short_name": "EntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client" - }, - "method": { - "short_name": "ListEntityTypes", - "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes.ListEntityTypes", - "service": { - "short_name": "EntityTypes", - "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_EntityTypes_ExportEntityTypes_sync", - "title": "Snippet for the export_entity_types call in the EntityTypes service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#export_entity_types.", - "file": "entity_types/export_entity_types.rb", - "language": "RUBY", - "client_method": { - "short_name": "export_entity_types", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#export_entity_types", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "EntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client" - }, - "method": { - "short_name": "ExportEntityTypes", - "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes.ExportEntityTypes", - "service": { - "short_name": "EntityTypes", - "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_EntityTypes_ImportEntityTypes_sync", - "title": "Snippet for the import_entity_types call in the EntityTypes service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#import_entity_types.", - "file": "entity_types/import_entity_types.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_entity_types", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#import_entity_types", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "EntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client" - }, - "method": { - "short_name": "ImportEntityTypes", - "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes.ImportEntityTypes", - "service": { - "short_name": "EntityTypes", - "full_name": "google.cloud.dialogflow.cx.v3.EntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Intents::Client#list_intents.", - "file": "intents/list_intents.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_intents", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client#list_intents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListIntentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListIntentsResponse", - "client": { - "short_name": "Intents::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client" - }, - "method": { - "short_name": "ListIntents", - "full_name": "google.cloud.dialogflow.cx.v3.Intents.ListIntents", - "service": { - "short_name": "Intents", - "full_name": "google.cloud.dialogflow.cx.v3.Intents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Intents::Client#get_intent.", - "file": "intents/get_intent.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_intent", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client#get_intent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetIntentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Intent", - "client": { - "short_name": "Intents::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client" - }, - "method": { - "short_name": "GetIntent", - "full_name": "google.cloud.dialogflow.cx.v3.Intents.GetIntent", - "service": { - "short_name": "Intents", - "full_name": "google.cloud.dialogflow.cx.v3.Intents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Intents::Client#create_intent.", - "file": "intents/create_intent.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_intent", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client#create_intent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Intent", - "client": { - "short_name": "Intents::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client" - }, - "method": { - "short_name": "CreateIntent", - "full_name": "google.cloud.dialogflow.cx.v3.Intents.CreateIntent", - "service": { - "short_name": "Intents", - "full_name": "google.cloud.dialogflow.cx.v3.Intents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Intents::Client#update_intent.", - "file": "intents/update_intent.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_intent", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client#update_intent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Intent", - "client": { - "short_name": "Intents::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client" - }, - "method": { - "short_name": "UpdateIntent", - "full_name": "google.cloud.dialogflow.cx.v3.Intents.UpdateIntent", - "service": { - "short_name": "Intents", - "full_name": "google.cloud.dialogflow.cx.v3.Intents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Intents::Client#delete_intent.", - "file": "intents/delete_intent.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_intent", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client#delete_intent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteIntentRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Intents::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client" - }, - "method": { - "short_name": "DeleteIntent", - "full_name": "google.cloud.dialogflow.cx.v3.Intents.DeleteIntent", - "service": { - "short_name": "Intents", - "full_name": "google.cloud.dialogflow.cx.v3.Intents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Intents_ImportIntents_sync", - "title": "Snippet for the import_intents call in the Intents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Intents::Client#import_intents.", - "file": "intents/import_intents.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_intents", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client#import_intents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Intents::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client" - }, - "method": { - "short_name": "ImportIntents", - "full_name": "google.cloud.dialogflow.cx.v3.Intents.ImportIntents", - "service": { - "short_name": "Intents", - "full_name": "google.cloud.dialogflow.cx.v3.Intents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Intents_ExportIntents_sync", - "title": "Snippet for the export_intents call in the Intents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Intents::Client#export_intents.", - "file": "intents/export_intents.rb", - "language": "RUBY", - "client_method": { - "short_name": "export_intents", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client#export_intents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Intents::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Intents::Client" - }, - "method": { - "short_name": "ExportIntents", - "full_name": "google.cloud.dialogflow.cx.v3.Intents.ExportIntents", - "service": { - "short_name": "Intents", - "full_name": "google.cloud.dialogflow.cx.v3.Intents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::SessionEntityTypes::Client#list_session_entity_types", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListSessionEntityTypesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListSessionEntityTypesResponse", - "client": { - "short_name": "SessionEntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client" - }, - "method": { - "short_name": "ListSessionEntityTypes", - "full_name": "google.cloud.dialogflow.cx.v3.SessionEntityTypes.ListSessionEntityTypes", - "service": { - "short_name": "SessionEntityTypes", - "full_name": "google.cloud.dialogflow.cx.v3.SessionEntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::SessionEntityTypes::Client#get_session_entity_type", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetSessionEntityTypeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::SessionEntityType", - "client": { - "short_name": "SessionEntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client" - }, - "method": { - "short_name": "GetSessionEntityType", - "full_name": "google.cloud.dialogflow.cx.v3.SessionEntityTypes.GetSessionEntityType", - "service": { - "short_name": "SessionEntityTypes", - "full_name": "google.cloud.dialogflow.cx.v3.SessionEntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::SessionEntityTypes::Client#create_session_entity_type", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::CreateSessionEntityTypeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::SessionEntityType", - "client": { - "short_name": "SessionEntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client" - }, - "method": { - "short_name": "CreateSessionEntityType", - "full_name": "google.cloud.dialogflow.cx.v3.SessionEntityTypes.CreateSessionEntityType", - "service": { - "short_name": "SessionEntityTypes", - "full_name": "google.cloud.dialogflow.cx.v3.SessionEntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::SessionEntityTypes::Client#update_session_entity_type", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateSessionEntityTypeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::SessionEntityType", - "client": { - "short_name": "SessionEntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client" - }, - "method": { - "short_name": "UpdateSessionEntityType", - "full_name": "google.cloud.dialogflow.cx.v3.SessionEntityTypes.UpdateSessionEntityType", - "service": { - "short_name": "SessionEntityTypes", - "full_name": "google.cloud.dialogflow.cx.v3.SessionEntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::SessionEntityTypes::Client#delete_session_entity_type", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteSessionEntityTypeRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SessionEntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client" - }, - "method": { - "short_name": "DeleteSessionEntityType", - "full_name": "google.cloud.dialogflow.cx.v3.SessionEntityTypes.DeleteSessionEntityType", - "service": { - "short_name": "SessionEntityTypes", - "full_name": "google.cloud.dialogflow.cx.v3.SessionEntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Sessions::Client#detect_intent.", - "file": "sessions/detect_intent.rb", - "language": "RUBY", - "client_method": { - "short_name": "detect_intent", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#detect_intent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse", - "client": { - "short_name": "Sessions::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client" - }, - "method": { - "short_name": "DetectIntent", - "full_name": "google.cloud.dialogflow.cx.v3.Sessions.DetectIntent", - "service": { - "short_name": "Sessions", - "full_name": "google.cloud.dialogflow.cx.v3.Sessions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Sessions_ServerStreamingDetectIntent_sync", - "title": "Snippet for the server_streaming_detect_intent call in the Sessions service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Sessions::Client#server_streaming_detect_intent.", - "file": "sessions/server_streaming_detect_intent.rb", - "language": "RUBY", - "client_method": { - "short_name": "server_streaming_detect_intent", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#server_streaming_detect_intent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse", - "client": { - "short_name": "Sessions::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client" - }, - "method": { - "short_name": "ServerStreamingDetectIntent", - "full_name": "google.cloud.dialogflow.cx.v3.Sessions.ServerStreamingDetectIntent", - "service": { - "short_name": "Sessions", - "full_name": "google.cloud.dialogflow.cx.v3.Sessions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 49, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::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::CX::V3::Sessions::Client#streaming_detect_intent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentResponse", - "client": { - "short_name": "Sessions::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client" - }, - "method": { - "short_name": "StreamingDetectIntent", - "full_name": "google.cloud.dialogflow.cx.v3.Sessions.StreamingDetectIntent", - "service": { - "short_name": "Sessions", - "full_name": "google.cloud.dialogflow.cx.v3.Sessions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 55, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Sessions_MatchIntent_sync", - "title": "Snippet for the match_intent call in the Sessions service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Sessions::Client#match_intent.", - "file": "sessions/match_intent.rb", - "language": "RUBY", - "client_method": { - "short_name": "match_intent", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#match_intent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse", - "client": { - "short_name": "Sessions::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client" - }, - "method": { - "short_name": "MatchIntent", - "full_name": "google.cloud.dialogflow.cx.v3.Sessions.MatchIntent", - "service": { - "short_name": "Sessions", - "full_name": "google.cloud.dialogflow.cx.v3.Sessions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Sessions_FulfillIntent_sync", - "title": "Snippet for the fulfill_intent call in the Sessions service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Sessions::Client#fulfill_intent.", - "file": "sessions/fulfill_intent.rb", - "language": "RUBY", - "client_method": { - "short_name": "fulfill_intent", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#fulfill_intent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse", - "client": { - "short_name": "Sessions::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client" - }, - "method": { - "short_name": "FulfillIntent", - "full_name": "google.cloud.dialogflow.cx.v3.Sessions.FulfillIntent", - "service": { - "short_name": "Sessions", - "full_name": "google.cloud.dialogflow.cx.v3.Sessions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Sessions_SubmitAnswerFeedback_sync", - "title": "Snippet for the submit_answer_feedback call in the Sessions service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Sessions::Client#submit_answer_feedback.", - "file": "sessions/submit_answer_feedback.rb", - "language": "RUBY", - "client_method": { - "short_name": "submit_answer_feedback", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client#submit_answer_feedback", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback", - "client": { - "short_name": "Sessions::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Sessions::Client" - }, - "method": { - "short_name": "SubmitAnswerFeedback", - "full_name": "google.cloud.dialogflow.cx.v3.Sessions.SubmitAnswerFeedback", - "service": { - "short_name": "Sessions", - "full_name": "google.cloud.dialogflow.cx.v3.Sessions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_TransitionRouteGroups_ListTransitionRouteGroups_sync", - "title": "Snippet for the list_transition_route_groups call in the TransitionRouteGroups service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#list_transition_route_groups.", - "file": "transition_route_groups/list_transition_route_groups.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_transition_route_groups", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#list_transition_route_groups", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsResponse", - "client": { - "short_name": "TransitionRouteGroups::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client" - }, - "method": { - "short_name": "ListTransitionRouteGroups", - "full_name": "google.cloud.dialogflow.cx.v3.TransitionRouteGroups.ListTransitionRouteGroups", - "service": { - "short_name": "TransitionRouteGroups", - "full_name": "google.cloud.dialogflow.cx.v3.TransitionRouteGroups" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_TransitionRouteGroups_GetTransitionRouteGroup_sync", - "title": "Snippet for the get_transition_route_group call in the TransitionRouteGroups service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#get_transition_route_group.", - "file": "transition_route_groups/get_transition_route_group.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_transition_route_group", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#get_transition_route_group", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup", - "client": { - "short_name": "TransitionRouteGroups::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client" - }, - "method": { - "short_name": "GetTransitionRouteGroup", - "full_name": "google.cloud.dialogflow.cx.v3.TransitionRouteGroups.GetTransitionRouteGroup", - "service": { - "short_name": "TransitionRouteGroups", - "full_name": "google.cloud.dialogflow.cx.v3.TransitionRouteGroups" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_TransitionRouteGroups_CreateTransitionRouteGroup_sync", - "title": "Snippet for the create_transition_route_group call in the TransitionRouteGroups service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#create_transition_route_group.", - "file": "transition_route_groups/create_transition_route_group.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_transition_route_group", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#create_transition_route_group", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup", - "client": { - "short_name": "TransitionRouteGroups::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client" - }, - "method": { - "short_name": "CreateTransitionRouteGroup", - "full_name": "google.cloud.dialogflow.cx.v3.TransitionRouteGroups.CreateTransitionRouteGroup", - "service": { - "short_name": "TransitionRouteGroups", - "full_name": "google.cloud.dialogflow.cx.v3.TransitionRouteGroups" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_sync", - "title": "Snippet for the update_transition_route_group call in the TransitionRouteGroups service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#update_transition_route_group.", - "file": "transition_route_groups/update_transition_route_group.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_transition_route_group", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#update_transition_route_group", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup", - "client": { - "short_name": "TransitionRouteGroups::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client" - }, - "method": { - "short_name": "UpdateTransitionRouteGroup", - "full_name": "google.cloud.dialogflow.cx.v3.TransitionRouteGroups.UpdateTransitionRouteGroup", - "service": { - "short_name": "TransitionRouteGroups", - "full_name": "google.cloud.dialogflow.cx.v3.TransitionRouteGroups" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_sync", - "title": "Snippet for the delete_transition_route_group call in the TransitionRouteGroups service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#delete_transition_route_group.", - "file": "transition_route_groups/delete_transition_route_group.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_transition_route_group", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#delete_transition_route_group", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "TransitionRouteGroups::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client" - }, - "method": { - "short_name": "DeleteTransitionRouteGroup", - "full_name": "google.cloud.dialogflow.cx.v3.TransitionRouteGroups.DeleteTransitionRouteGroup", - "service": { - "short_name": "TransitionRouteGroups", - "full_name": "google.cloud.dialogflow.cx.v3.TransitionRouteGroups" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_TestCases_ListTestCases_sync", - "title": "Snippet for the list_test_cases call in the TestCases service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_cases.", - "file": "test_cases/list_test_cases.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_test_cases", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_cases", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListTestCasesResponse", - "client": { - "short_name": "TestCases::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" - }, - "method": { - "short_name": "ListTestCases", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases.ListTestCases", - "service": { - "short_name": "TestCases", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_TestCases_BatchDeleteTestCases_sync", - "title": "Snippet for the batch_delete_test_cases call in the TestCases service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_delete_test_cases.", - "file": "test_cases/batch_delete_test_cases.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_delete_test_cases", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_delete_test_cases", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "TestCases::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" - }, - "method": { - "short_name": "BatchDeleteTestCases", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases.BatchDeleteTestCases", - "service": { - "short_name": "TestCases", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_TestCases_GetTestCase_sync", - "title": "Snippet for the get_test_case call in the TestCases service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#get_test_case.", - "file": "test_cases/get_test_case.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_test_case", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#get_test_case", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::TestCase", - "client": { - "short_name": "TestCases::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" - }, - "method": { - "short_name": "GetTestCase", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases.GetTestCase", - "service": { - "short_name": "TestCases", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_TestCases_CreateTestCase_sync", - "title": "Snippet for the create_test_case call in the TestCases service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#create_test_case.", - "file": "test_cases/create_test_case.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_test_case", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#create_test_case", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::TestCase", - "client": { - "short_name": "TestCases::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" - }, - "method": { - "short_name": "CreateTestCase", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases.CreateTestCase", - "service": { - "short_name": "TestCases", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_TestCases_UpdateTestCase_sync", - "title": "Snippet for the update_test_case call in the TestCases service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#update_test_case.", - "file": "test_cases/update_test_case.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_test_case", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#update_test_case", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::TestCase", - "client": { - "short_name": "TestCases::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" - }, - "method": { - "short_name": "UpdateTestCase", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases.UpdateTestCase", - "service": { - "short_name": "TestCases", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_TestCases_RunTestCase_sync", - "title": "Snippet for the run_test_case call in the TestCases service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#run_test_case.", - "file": "test_cases/run_test_case.rb", - "language": "RUBY", - "client_method": { - "short_name": "run_test_case", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#run_test_case", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TestCases::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" - }, - "method": { - "short_name": "RunTestCase", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases.RunTestCase", - "service": { - "short_name": "TestCases", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_TestCases_BatchRunTestCases_sync", - "title": "Snippet for the batch_run_test_cases call in the TestCases service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_run_test_cases.", - "file": "test_cases/batch_run_test_cases.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_run_test_cases", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_run_test_cases", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TestCases::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" - }, - "method": { - "short_name": "BatchRunTestCases", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases.BatchRunTestCases", - "service": { - "short_name": "TestCases", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_TestCases_CalculateCoverage_sync", - "title": "Snippet for the calculate_coverage call in the TestCases service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#calculate_coverage.", - "file": "test_cases/calculate_coverage.rb", - "language": "RUBY", - "client_method": { - "short_name": "calculate_coverage", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#calculate_coverage", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse", - "client": { - "short_name": "TestCases::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" - }, - "method": { - "short_name": "CalculateCoverage", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases.CalculateCoverage", - "service": { - "short_name": "TestCases", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_TestCases_ImportTestCases_sync", - "title": "Snippet for the import_test_cases call in the TestCases service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#import_test_cases.", - "file": "test_cases/import_test_cases.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_test_cases", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#import_test_cases", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TestCases::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" - }, - "method": { - "short_name": "ImportTestCases", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases.ImportTestCases", - "service": { - "short_name": "TestCases", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_TestCases_ExportTestCases_sync", - "title": "Snippet for the export_test_cases call in the TestCases service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#export_test_cases.", - "file": "test_cases/export_test_cases.rb", - "language": "RUBY", - "client_method": { - "short_name": "export_test_cases", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#export_test_cases", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TestCases::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" - }, - "method": { - "short_name": "ExportTestCases", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases.ExportTestCases", - "service": { - "short_name": "TestCases", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_TestCases_ListTestCaseResults_sync", - "title": "Snippet for the list_test_case_results call in the TestCases service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_case_results.", - "file": "test_cases/list_test_case_results.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_test_case_results", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_case_results", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsResponse", - "client": { - "short_name": "TestCases::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" - }, - "method": { - "short_name": "ListTestCaseResults", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases.ListTestCaseResults", - "service": { - "short_name": "TestCases", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_TestCases_GetTestCaseResult_sync", - "title": "Snippet for the get_test_case_result call in the TestCases service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::TestCases::Client#get_test_case_result.", - "file": "test_cases/get_test_case_result.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_test_case_result", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client#get_test_case_result", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::TestCaseResult", - "client": { - "short_name": "TestCases::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::TestCases::Client" - }, - "method": { - "short_name": "GetTestCaseResult", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases.GetTestCaseResult", - "service": { - "short_name": "TestCases", - "full_name": "google.cloud.dialogflow.cx.v3.TestCases" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Webhooks_ListWebhooks_sync", - "title": "Snippet for the list_webhooks call in the Webhooks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#list_webhooks.", - "file": "webhooks/list_webhooks.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_webhooks", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#list_webhooks", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListWebhooksResponse", - "client": { - "short_name": "Webhooks::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client" - }, - "method": { - "short_name": "ListWebhooks", - "full_name": "google.cloud.dialogflow.cx.v3.Webhooks.ListWebhooks", - "service": { - "short_name": "Webhooks", - "full_name": "google.cloud.dialogflow.cx.v3.Webhooks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Webhooks_GetWebhook_sync", - "title": "Snippet for the get_webhook call in the Webhooks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#get_webhook.", - "file": "webhooks/get_webhook.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_webhook", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#get_webhook", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Webhook", - "client": { - "short_name": "Webhooks::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client" - }, - "method": { - "short_name": "GetWebhook", - "full_name": "google.cloud.dialogflow.cx.v3.Webhooks.GetWebhook", - "service": { - "short_name": "Webhooks", - "full_name": "google.cloud.dialogflow.cx.v3.Webhooks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Webhooks_CreateWebhook_sync", - "title": "Snippet for the create_webhook call in the Webhooks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#create_webhook.", - "file": "webhooks/create_webhook.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_webhook", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#create_webhook", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Webhook", - "client": { - "short_name": "Webhooks::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client" - }, - "method": { - "short_name": "CreateWebhook", - "full_name": "google.cloud.dialogflow.cx.v3.Webhooks.CreateWebhook", - "service": { - "short_name": "Webhooks", - "full_name": "google.cloud.dialogflow.cx.v3.Webhooks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Webhooks_UpdateWebhook_sync", - "title": "Snippet for the update_webhook call in the Webhooks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#update_webhook.", - "file": "webhooks/update_webhook.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_webhook", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#update_webhook", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Webhook", - "client": { - "short_name": "Webhooks::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client" - }, - "method": { - "short_name": "UpdateWebhook", - "full_name": "google.cloud.dialogflow.cx.v3.Webhooks.UpdateWebhook", - "service": { - "short_name": "Webhooks", - "full_name": "google.cloud.dialogflow.cx.v3.Webhooks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Webhooks_DeleteWebhook_sync", - "title": "Snippet for the delete_webhook call in the Webhooks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#delete_webhook.", - "file": "webhooks/delete_webhook.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_webhook", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#delete_webhook", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Webhooks::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client" - }, - "method": { - "short_name": "DeleteWebhook", - "full_name": "google.cloud.dialogflow.cx.v3.Webhooks.DeleteWebhook", - "service": { - "short_name": "Webhooks", - "full_name": "google.cloud.dialogflow.cx.v3.Webhooks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Environments::Client#list_environments.", - "file": "environments/list_environments.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_environments", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client#list_environments", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListEnvironmentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListEnvironmentsResponse", - "client": { - "short_name": "Environments::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client" - }, - "method": { - "short_name": "ListEnvironments", - "full_name": "google.cloud.dialogflow.cx.v3.Environments.ListEnvironments", - "service": { - "short_name": "Environments", - "full_name": "google.cloud.dialogflow.cx.v3.Environments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Environments::Client#get_environment.", - "file": "environments/get_environment.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_environment", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client#get_environment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Environment", - "client": { - "short_name": "Environments::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client" - }, - "method": { - "short_name": "GetEnvironment", - "full_name": "google.cloud.dialogflow.cx.v3.Environments.GetEnvironment", - "service": { - "short_name": "Environments", - "full_name": "google.cloud.dialogflow.cx.v3.Environments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Environments::Client#create_environment.", - "file": "environments/create_environment.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_environment", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client#create_environment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Environments::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client" - }, - "method": { - "short_name": "CreateEnvironment", - "full_name": "google.cloud.dialogflow.cx.v3.Environments.CreateEnvironment", - "service": { - "short_name": "Environments", - "full_name": "google.cloud.dialogflow.cx.v3.Environments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Environments::Client#update_environment.", - "file": "environments/update_environment.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_environment", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client#update_environment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Environments::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client" - }, - "method": { - "short_name": "UpdateEnvironment", - "full_name": "google.cloud.dialogflow.cx.v3.Environments.UpdateEnvironment", - "service": { - "short_name": "Environments", - "full_name": "google.cloud.dialogflow.cx.v3.Environments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Environments::Client#delete_environment.", - "file": "environments/delete_environment.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_environment", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client#delete_environment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteEnvironmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Environments::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client" - }, - "method": { - "short_name": "DeleteEnvironment", - "full_name": "google.cloud.dialogflow.cx.v3.Environments.DeleteEnvironment", - "service": { - "short_name": "Environments", - "full_name": "google.cloud.dialogflow.cx.v3.Environments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Environments_LookupEnvironmentHistory_sync", - "title": "Snippet for the lookup_environment_history call in the Environments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Environments::Client#lookup_environment_history.", - "file": "environments/lookup_environment_history.rb", - "language": "RUBY", - "client_method": { - "short_name": "lookup_environment_history", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client#lookup_environment_history", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryResponse", - "client": { - "short_name": "Environments::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client" - }, - "method": { - "short_name": "LookupEnvironmentHistory", - "full_name": "google.cloud.dialogflow.cx.v3.Environments.LookupEnvironmentHistory", - "service": { - "short_name": "Environments", - "full_name": "google.cloud.dialogflow.cx.v3.Environments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Environments_RunContinuousTest_sync", - "title": "Snippet for the run_continuous_test call in the Environments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Environments::Client#run_continuous_test.", - "file": "environments/run_continuous_test.rb", - "language": "RUBY", - "client_method": { - "short_name": "run_continuous_test", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client#run_continuous_test", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Environments::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client" - }, - "method": { - "short_name": "RunContinuousTest", - "full_name": "google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest", - "service": { - "short_name": "Environments", - "full_name": "google.cloud.dialogflow.cx.v3.Environments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Environments_ListContinuousTestResults_sync", - "title": "Snippet for the list_continuous_test_results call in the Environments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Environments::Client#list_continuous_test_results.", - "file": "environments/list_continuous_test_results.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_continuous_test_results", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client#list_continuous_test_results", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsResponse", - "client": { - "short_name": "Environments::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client" - }, - "method": { - "short_name": "ListContinuousTestResults", - "full_name": "google.cloud.dialogflow.cx.v3.Environments.ListContinuousTestResults", - "service": { - "short_name": "Environments", - "full_name": "google.cloud.dialogflow.cx.v3.Environments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Environments_DeployFlow_sync", - "title": "Snippet for the deploy_flow call in the Environments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Environments::Client#deploy_flow.", - "file": "environments/deploy_flow.rb", - "language": "RUBY", - "client_method": { - "short_name": "deploy_flow", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client#deploy_flow", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Environments::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Environments::Client" - }, - "method": { - "short_name": "DeployFlow", - "full_name": "google.cloud.dialogflow.cx.v3.Environments.DeployFlow", - "service": { - "short_name": "Environments", - "full_name": "google.cloud.dialogflow.cx.v3.Environments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Examples_CreateExample_sync", - "title": "Snippet for the create_example call in the Examples service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Examples::Client#create_example.", - "file": "examples/create_example.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_example", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client#create_example", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::CreateExampleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Example", - "client": { - "short_name": "Examples::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client" - }, - "method": { - "short_name": "CreateExample", - "full_name": "google.cloud.dialogflow.cx.v3.Examples.CreateExample", - "service": { - "short_name": "Examples", - "full_name": "google.cloud.dialogflow.cx.v3.Examples" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Examples_DeleteExample_sync", - "title": "Snippet for the delete_example call in the Examples service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Examples::Client#delete_example.", - "file": "examples/delete_example.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_example", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client#delete_example", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteExampleRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Examples::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client" - }, - "method": { - "short_name": "DeleteExample", - "full_name": "google.cloud.dialogflow.cx.v3.Examples.DeleteExample", - "service": { - "short_name": "Examples", - "full_name": "google.cloud.dialogflow.cx.v3.Examples" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Examples_ListExamples_sync", - "title": "Snippet for the list_examples call in the Examples service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Examples::Client#list_examples.", - "file": "examples/list_examples.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_examples", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client#list_examples", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListExamplesResponse", - "client": { - "short_name": "Examples::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client" - }, - "method": { - "short_name": "ListExamples", - "full_name": "google.cloud.dialogflow.cx.v3.Examples.ListExamples", - "service": { - "short_name": "Examples", - "full_name": "google.cloud.dialogflow.cx.v3.Examples" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Examples_GetExample_sync", - "title": "Snippet for the get_example call in the Examples service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Examples::Client#get_example.", - "file": "examples/get_example.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_example", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client#get_example", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetExampleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Example", - "client": { - "short_name": "Examples::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client" - }, - "method": { - "short_name": "GetExample", - "full_name": "google.cloud.dialogflow.cx.v3.Examples.GetExample", - "service": { - "short_name": "Examples", - "full_name": "google.cloud.dialogflow.cx.v3.Examples" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Examples_UpdateExample_sync", - "title": "Snippet for the update_example call in the Examples service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Examples::Client#update_example.", - "file": "examples/update_example.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_example", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client#update_example", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateExampleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Example", - "client": { - "short_name": "Examples::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Examples::Client" - }, - "method": { - "short_name": "UpdateExample", - "full_name": "google.cloud.dialogflow.cx.v3.Examples.UpdateExample", - "service": { - "short_name": "Examples", - "full_name": "google.cloud.dialogflow.cx.v3.Examples" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Experiments_ListExperiments_sync", - "title": "Snippet for the list_experiments call in the Experiments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Experiments::Client#list_experiments.", - "file": "experiments/list_experiments.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_experiments", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#list_experiments", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListExperimentsResponse", - "client": { - "short_name": "Experiments::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client" - }, - "method": { - "short_name": "ListExperiments", - "full_name": "google.cloud.dialogflow.cx.v3.Experiments.ListExperiments", - "service": { - "short_name": "Experiments", - "full_name": "google.cloud.dialogflow.cx.v3.Experiments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Experiments_GetExperiment_sync", - "title": "Snippet for the get_experiment call in the Experiments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Experiments::Client#get_experiment.", - "file": "experiments/get_experiment.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_experiment", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#get_experiment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Experiment", - "client": { - "short_name": "Experiments::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client" - }, - "method": { - "short_name": "GetExperiment", - "full_name": "google.cloud.dialogflow.cx.v3.Experiments.GetExperiment", - "service": { - "short_name": "Experiments", - "full_name": "google.cloud.dialogflow.cx.v3.Experiments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Experiments_CreateExperiment_sync", - "title": "Snippet for the create_experiment call in the Experiments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Experiments::Client#create_experiment.", - "file": "experiments/create_experiment.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_experiment", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#create_experiment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Experiment", - "client": { - "short_name": "Experiments::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client" - }, - "method": { - "short_name": "CreateExperiment", - "full_name": "google.cloud.dialogflow.cx.v3.Experiments.CreateExperiment", - "service": { - "short_name": "Experiments", - "full_name": "google.cloud.dialogflow.cx.v3.Experiments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Experiments_UpdateExperiment_sync", - "title": "Snippet for the update_experiment call in the Experiments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Experiments::Client#update_experiment.", - "file": "experiments/update_experiment.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_experiment", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#update_experiment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Experiment", - "client": { - "short_name": "Experiments::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client" - }, - "method": { - "short_name": "UpdateExperiment", - "full_name": "google.cloud.dialogflow.cx.v3.Experiments.UpdateExperiment", - "service": { - "short_name": "Experiments", - "full_name": "google.cloud.dialogflow.cx.v3.Experiments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Experiments_DeleteExperiment_sync", - "title": "Snippet for the delete_experiment call in the Experiments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Experiments::Client#delete_experiment.", - "file": "experiments/delete_experiment.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_experiment", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#delete_experiment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Experiments::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client" - }, - "method": { - "short_name": "DeleteExperiment", - "full_name": "google.cloud.dialogflow.cx.v3.Experiments.DeleteExperiment", - "service": { - "short_name": "Experiments", - "full_name": "google.cloud.dialogflow.cx.v3.Experiments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Experiments_StartExperiment_sync", - "title": "Snippet for the start_experiment call in the Experiments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Experiments::Client#start_experiment.", - "file": "experiments/start_experiment.rb", - "language": "RUBY", - "client_method": { - "short_name": "start_experiment", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#start_experiment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Experiment", - "client": { - "short_name": "Experiments::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client" - }, - "method": { - "short_name": "StartExperiment", - "full_name": "google.cloud.dialogflow.cx.v3.Experiments.StartExperiment", - "service": { - "short_name": "Experiments", - "full_name": "google.cloud.dialogflow.cx.v3.Experiments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Experiments_StopExperiment_sync", - "title": "Snippet for the stop_experiment call in the Experiments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Experiments::Client#stop_experiment.", - "file": "experiments/stop_experiment.rb", - "language": "RUBY", - "client_method": { - "short_name": "stop_experiment", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client#stop_experiment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Experiment", - "client": { - "short_name": "Experiments::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Experiments::Client" - }, - "method": { - "short_name": "StopExperiment", - "full_name": "google.cloud.dialogflow.cx.v3.Experiments.StopExperiment", - "service": { - "short_name": "Experiments", - "full_name": "google.cloud.dialogflow.cx.v3.Experiments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Generators::Client#list_generators.", - "file": "generators/list_generators.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_generators", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client#list_generators", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsResponse", - "client": { - "short_name": "Generators::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client" - }, - "method": { - "short_name": "ListGenerators", - "full_name": "google.cloud.dialogflow.cx.v3.Generators.ListGenerators", - "service": { - "short_name": "Generators", - "full_name": "google.cloud.dialogflow.cx.v3.Generators" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Generators::Client#get_generator.", - "file": "generators/get_generator.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_generator", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client#get_generator", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Generator", - "client": { - "short_name": "Generators::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client" - }, - "method": { - "short_name": "GetGenerator", - "full_name": "google.cloud.dialogflow.cx.v3.Generators.GetGenerator", - "service": { - "short_name": "Generators", - "full_name": "google.cloud.dialogflow.cx.v3.Generators" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Generators::Client#create_generator.", - "file": "generators/create_generator.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_generator", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client#create_generator", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Generator", - "client": { - "short_name": "Generators::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client" - }, - "method": { - "short_name": "CreateGenerator", - "full_name": "google.cloud.dialogflow.cx.v3.Generators.CreateGenerator", - "service": { - "short_name": "Generators", - "full_name": "google.cloud.dialogflow.cx.v3.Generators" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Generators::Client#update_generator.", - "file": "generators/update_generator.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_generator", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client#update_generator", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Generator", - "client": { - "short_name": "Generators::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client" - }, - "method": { - "short_name": "UpdateGenerator", - "full_name": "google.cloud.dialogflow.cx.v3.Generators.UpdateGenerator", - "service": { - "short_name": "Generators", - "full_name": "google.cloud.dialogflow.cx.v3.Generators" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Generators::Client#delete_generator.", - "file": "generators/delete_generator.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_generator", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client#delete_generator", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteGeneratorRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Generators::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Generators::Client" - }, - "method": { - "short_name": "DeleteGenerator", - "full_name": "google.cloud.dialogflow.cx.v3.Generators.DeleteGenerator", - "service": { - "short_name": "Generators", - "full_name": "google.cloud.dialogflow.cx.v3.Generators" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Playbooks_CreatePlaybook_sync", - "title": "Snippet for the create_playbook call in the Playbooks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#create_playbook.", - "file": "playbooks/create_playbook.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_playbook", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#create_playbook", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Playbook", - "client": { - "short_name": "Playbooks::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" - }, - "method": { - "short_name": "CreatePlaybook", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.CreatePlaybook", - "service": { - "short_name": "Playbooks", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Playbooks_DeletePlaybook_sync", - "title": "Snippet for the delete_playbook call in the Playbooks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#delete_playbook.", - "file": "playbooks/delete_playbook.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_playbook", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#delete_playbook", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Playbooks::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" - }, - "method": { - "short_name": "DeletePlaybook", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.DeletePlaybook", - "service": { - "short_name": "Playbooks", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Playbooks_ListPlaybooks_sync", - "title": "Snippet for the list_playbooks call in the Playbooks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#list_playbooks.", - "file": "playbooks/list_playbooks.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_playbooks", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#list_playbooks", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListPlaybooksResponse", - "client": { - "short_name": "Playbooks::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" - }, - "method": { - "short_name": "ListPlaybooks", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.ListPlaybooks", - "service": { - "short_name": "Playbooks", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Playbooks_GetPlaybook_sync", - "title": "Snippet for the get_playbook call in the Playbooks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#get_playbook.", - "file": "playbooks/get_playbook.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_playbook", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#get_playbook", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetPlaybookRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Playbook", - "client": { - "short_name": "Playbooks::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" - }, - "method": { - "short_name": "GetPlaybook", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.GetPlaybook", - "service": { - "short_name": "Playbooks", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Playbooks_ExportPlaybook_sync", - "title": "Snippet for the export_playbook call in the Playbooks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#export_playbook.", - "file": "playbooks/export_playbook.rb", - "language": "RUBY", - "client_method": { - "short_name": "export_playbook", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#export_playbook", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ExportPlaybookRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Playbooks::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" - }, - "method": { - "short_name": "ExportPlaybook", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.ExportPlaybook", - "service": { - "short_name": "Playbooks", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Playbooks_ImportPlaybook_sync", - "title": "Snippet for the import_playbook call in the Playbooks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#import_playbook.", - "file": "playbooks/import_playbook.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_playbook", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#import_playbook", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ImportPlaybookRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Playbooks::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" - }, - "method": { - "short_name": "ImportPlaybook", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.ImportPlaybook", - "service": { - "short_name": "Playbooks", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Playbooks_UpdatePlaybook_sync", - "title": "Snippet for the update_playbook call in the Playbooks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#update_playbook.", - "file": "playbooks/update_playbook.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_playbook", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#update_playbook", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::UpdatePlaybookRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Playbook", - "client": { - "short_name": "Playbooks::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" - }, - "method": { - "short_name": "UpdatePlaybook", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.UpdatePlaybook", - "service": { - "short_name": "Playbooks", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Playbooks_CreatePlaybookVersion_sync", - "title": "Snippet for the create_playbook_version call in the Playbooks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#create_playbook_version.", - "file": "playbooks/create_playbook_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_playbook_version", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#create_playbook_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::CreatePlaybookVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion", - "client": { - "short_name": "Playbooks::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" - }, - "method": { - "short_name": "CreatePlaybookVersion", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.CreatePlaybookVersion", - "service": { - "short_name": "Playbooks", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Playbooks_GetPlaybookVersion_sync", - "title": "Snippet for the get_playbook_version call in the Playbooks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#get_playbook_version.", - "file": "playbooks/get_playbook_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_playbook_version", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#get_playbook_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetPlaybookVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::PlaybookVersion", - "client": { - "short_name": "Playbooks::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" - }, - "method": { - "short_name": "GetPlaybookVersion", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.GetPlaybookVersion", - "service": { - "short_name": "Playbooks", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Playbooks_RestorePlaybookVersion_sync", - "title": "Snippet for the restore_playbook_version call in the Playbooks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#restore_playbook_version.", - "file": "playbooks/restore_playbook_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "restore_playbook_version", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#restore_playbook_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::RestorePlaybookVersionResponse", - "client": { - "short_name": "Playbooks::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" - }, - "method": { - "short_name": "RestorePlaybookVersion", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.RestorePlaybookVersion", - "service": { - "short_name": "Playbooks", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Playbooks_ListPlaybookVersions_sync", - "title": "Snippet for the list_playbook_versions call in the Playbooks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#list_playbook_versions.", - "file": "playbooks/list_playbook_versions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_playbook_versions", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#list_playbook_versions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListPlaybookVersionsResponse", - "client": { - "short_name": "Playbooks::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" - }, - "method": { - "short_name": "ListPlaybookVersions", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.ListPlaybookVersions", - "service": { - "short_name": "Playbooks", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Playbooks_DeletePlaybookVersion_sync", - "title": "Snippet for the delete_playbook_version call in the Playbooks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#delete_playbook_version.", - "file": "playbooks/delete_playbook_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_playbook_version", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client#delete_playbook_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::DeletePlaybookVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Playbooks::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Playbooks::Client" - }, - "method": { - "short_name": "DeletePlaybookVersion", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks.DeletePlaybookVersion", - "service": { - "short_name": "Playbooks", - "full_name": "google.cloud.dialogflow.cx.v3.Playbooks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_SecuritySettingsService_CreateSecuritySettings_sync", - "title": "Snippet for the create_security_settings call in the SecuritySettingsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#create_security_settings.", - "file": "security_settings_service/create_security_settings.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_security_settings", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#create_security_settings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettings", - "client": { - "short_name": "SecuritySettingsService::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client" - }, - "method": { - "short_name": "CreateSecuritySettings", - "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService.CreateSecuritySettings", - "service": { - "short_name": "SecuritySettingsService", - "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_SecuritySettingsService_GetSecuritySettings_sync", - "title": "Snippet for the get_security_settings call in the SecuritySettingsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#get_security_settings.", - "file": "security_settings_service/get_security_settings.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_security_settings", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#get_security_settings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettings", - "client": { - "short_name": "SecuritySettingsService::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client" - }, - "method": { - "short_name": "GetSecuritySettings", - "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService.GetSecuritySettings", - "service": { - "short_name": "SecuritySettingsService", - "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_SecuritySettingsService_UpdateSecuritySettings_sync", - "title": "Snippet for the update_security_settings call in the SecuritySettingsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#update_security_settings.", - "file": "security_settings_service/update_security_settings.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_security_settings", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#update_security_settings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettings", - "client": { - "short_name": "SecuritySettingsService::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client" - }, - "method": { - "short_name": "UpdateSecuritySettings", - "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService.UpdateSecuritySettings", - "service": { - "short_name": "SecuritySettingsService", - "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_SecuritySettingsService_ListSecuritySettings_sync", - "title": "Snippet for the list_security_settings call in the SecuritySettingsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#list_security_settings.", - "file": "security_settings_service/list_security_settings.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_security_settings", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#list_security_settings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsResponse", - "client": { - "short_name": "SecuritySettingsService::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client" - }, - "method": { - "short_name": "ListSecuritySettings", - "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService.ListSecuritySettings", - "service": { - "short_name": "SecuritySettingsService", - "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_SecuritySettingsService_DeleteSecuritySettings_sync", - "title": "Snippet for the delete_security_settings call in the SecuritySettingsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#delete_security_settings.", - "file": "security_settings_service/delete_security_settings.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_security_settings", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#delete_security_settings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SecuritySettingsService::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client" - }, - "method": { - "short_name": "DeleteSecuritySettings", - "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService.DeleteSecuritySettings", - "service": { - "short_name": "SecuritySettingsService", - "full_name": "google.cloud.dialogflow.cx.v3.SecuritySettingsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Tools::Client#create_tool.", - "file": "tools/create_tool.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_tool", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#create_tool", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::CreateToolRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Tool", - "client": { - "short_name": "Tools::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" - }, - "method": { - "short_name": "CreateTool", - "full_name": "google.cloud.dialogflow.cx.v3.Tools.CreateTool", - "service": { - "short_name": "Tools", - "full_name": "google.cloud.dialogflow.cx.v3.Tools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Tools::Client#list_tools.", - "file": "tools/list_tools.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_tools", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#list_tools", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListToolsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListToolsResponse", - "client": { - "short_name": "Tools::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" - }, - "method": { - "short_name": "ListTools", - "full_name": "google.cloud.dialogflow.cx.v3.Tools.ListTools", - "service": { - "short_name": "Tools", - "full_name": "google.cloud.dialogflow.cx.v3.Tools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Tools::Client#get_tool.", - "file": "tools/get_tool.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_tool", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#get_tool", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetToolRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Tool", - "client": { - "short_name": "Tools::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" - }, - "method": { - "short_name": "GetTool", - "full_name": "google.cloud.dialogflow.cx.v3.Tools.GetTool", - "service": { - "short_name": "Tools", - "full_name": "google.cloud.dialogflow.cx.v3.Tools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Tools::Client#update_tool.", - "file": "tools/update_tool.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_tool", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#update_tool", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateToolRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Tool", - "client": { - "short_name": "Tools::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" - }, - "method": { - "short_name": "UpdateTool", - "full_name": "google.cloud.dialogflow.cx.v3.Tools.UpdateTool", - "service": { - "short_name": "Tools", - "full_name": "google.cloud.dialogflow.cx.v3.Tools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Tools::Client#delete_tool.", - "file": "tools/delete_tool.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_tool", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#delete_tool", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteToolRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Tools::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" - }, - "method": { - "short_name": "DeleteTool", - "full_name": "google.cloud.dialogflow.cx.v3.Tools.DeleteTool", - "service": { - "short_name": "Tools", - "full_name": "google.cloud.dialogflow.cx.v3.Tools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Tools_ListToolVersions_sync", - "title": "Snippet for the list_tool_versions call in the Tools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Tools::Client#list_tool_versions.", - "file": "tools/list_tool_versions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_tool_versions", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#list_tool_versions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsResponse", - "client": { - "short_name": "Tools::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" - }, - "method": { - "short_name": "ListToolVersions", - "full_name": "google.cloud.dialogflow.cx.v3.Tools.ListToolVersions", - "service": { - "short_name": "Tools", - "full_name": "google.cloud.dialogflow.cx.v3.Tools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Tools_CreateToolVersion_sync", - "title": "Snippet for the create_tool_version call in the Tools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Tools::Client#create_tool_version.", - "file": "tools/create_tool_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_tool_version", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#create_tool_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::CreateToolVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ToolVersion", - "client": { - "short_name": "Tools::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" - }, - "method": { - "short_name": "CreateToolVersion", - "full_name": "google.cloud.dialogflow.cx.v3.Tools.CreateToolVersion", - "service": { - "short_name": "Tools", - "full_name": "google.cloud.dialogflow.cx.v3.Tools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Tools_GetToolVersion_sync", - "title": "Snippet for the get_tool_version call in the Tools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Tools::Client#get_tool_version.", - "file": "tools/get_tool_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_tool_version", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#get_tool_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetToolVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ToolVersion", - "client": { - "short_name": "Tools::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" - }, - "method": { - "short_name": "GetToolVersion", - "full_name": "google.cloud.dialogflow.cx.v3.Tools.GetToolVersion", - "service": { - "short_name": "Tools", - "full_name": "google.cloud.dialogflow.cx.v3.Tools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Tools_DeleteToolVersion_sync", - "title": "Snippet for the delete_tool_version call in the Tools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Tools::Client#delete_tool_version.", - "file": "tools/delete_tool_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_tool_version", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#delete_tool_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteToolVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Tools::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" - }, - "method": { - "short_name": "DeleteToolVersion", - "full_name": "google.cloud.dialogflow.cx.v3.Tools.DeleteToolVersion", - "service": { - "short_name": "Tools", - "full_name": "google.cloud.dialogflow.cx.v3.Tools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Tools_RestoreToolVersion_sync", - "title": "Snippet for the restore_tool_version call in the Tools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Tools::Client#restore_tool_version.", - "file": "tools/restore_tool_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "restore_tool_version", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client#restore_tool_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionResponse", - "client": { - "short_name": "Tools::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Tools::Client" - }, - "method": { - "short_name": "RestoreToolVersion", - "full_name": "google.cloud.dialogflow.cx.v3.Tools.RestoreToolVersion", - "service": { - "short_name": "Tools", - "full_name": "google.cloud.dialogflow.cx.v3.Tools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Versions::Client#list_versions.", - "file": "versions/list_versions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_versions", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client#list_versions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::ListVersionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::ListVersionsResponse", - "client": { - "short_name": "Versions::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client" - }, - "method": { - "short_name": "ListVersions", - "full_name": "google.cloud.dialogflow.cx.v3.Versions.ListVersions", - "service": { - "short_name": "Versions", - "full_name": "google.cloud.dialogflow.cx.v3.Versions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Versions::Client#get_version.", - "file": "versions/get_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_version", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client#get_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::GetVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Version", - "client": { - "short_name": "Versions::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client" - }, - "method": { - "short_name": "GetVersion", - "full_name": "google.cloud.dialogflow.cx.v3.Versions.GetVersion", - "service": { - "short_name": "Versions", - "full_name": "google.cloud.dialogflow.cx.v3.Versions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Versions::Client#create_version.", - "file": "versions/create_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_version", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client#create_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Versions::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client" - }, - "method": { - "short_name": "CreateVersion", - "full_name": "google.cloud.dialogflow.cx.v3.Versions.CreateVersion", - "service": { - "short_name": "Versions", - "full_name": "google.cloud.dialogflow.cx.v3.Versions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Versions::Client#update_version.", - "file": "versions/update_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_version", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client#update_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::Version", - "client": { - "short_name": "Versions::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client" - }, - "method": { - "short_name": "UpdateVersion", - "full_name": "google.cloud.dialogflow.cx.v3.Versions.UpdateVersion", - "service": { - "short_name": "Versions", - "full_name": "google.cloud.dialogflow.cx.v3.Versions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_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::CX::V3::Versions::Client#delete_version.", - "file": "versions/delete_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_version", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client#delete_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::DeleteVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Versions::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client" - }, - "method": { - "short_name": "DeleteVersion", - "full_name": "google.cloud.dialogflow.cx.v3.Versions.DeleteVersion", - "service": { - "short_name": "Versions", - "full_name": "google.cloud.dialogflow.cx.v3.Versions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Versions_LoadVersion_sync", - "title": "Snippet for the load_version call in the Versions service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Versions::Client#load_version.", - "file": "versions/load_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "load_version", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client#load_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Versions::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client" - }, - "method": { - "short_name": "LoadVersion", - "full_name": "google.cloud.dialogflow.cx.v3.Versions.LoadVersion", - "service": { - "short_name": "Versions", - "full_name": "google.cloud.dialogflow.cx.v3.Versions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v3_generated_Versions_CompareVersions_sync", - "title": "Snippet for the compare_versions call in the Versions service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::CX::V3::Versions::Client#compare_versions.", - "file": "versions/compare_versions.rb", - "language": "RUBY", - "client_method": { - "short_name": "compare_versions", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client#compare_versions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse", - "client": { - "short_name": "Versions::Client", - "full_name": "::Google::Cloud::Dialogflow::CX::V3::Versions::Client" - }, - "method": { - "short_name": "CompareVersions", - "full_name": "google.cloud.dialogflow.cx.v3.Versions.CompareVersions", - "service": { - "short_name": "Versions", - "full_name": "google.cloud.dialogflow.cx.v3.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-cx-v3/snippets/test_cases/batch_delete_test_cases.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_delete_test_cases.rb deleted file mode 100644 index c9ecbecb6517..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_delete_test_cases.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_v3_generated_TestCases_BatchDeleteTestCases_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the batch_delete_test_cases call in the TestCases service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_delete_test_cases. -# -def batch_delete_test_cases - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest.new - - # Call the batch_delete_test_cases method. - result = client.batch_delete_test_cases request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dialogflow_v3_generated_TestCases_BatchDeleteTestCases_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_run_test_cases.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_run_test_cases.rb deleted file mode 100644 index 6f0c23da7670..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_run_test_cases.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_v3_generated_TestCases_BatchRunTestCases_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the batch_run_test_cases call in the TestCases service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_run_test_cases. -# -def batch_run_test_cases - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest.new - - # Call the batch_run_test_cases method. - result = client.batch_run_test_cases request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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_v3_generated_TestCases_BatchRunTestCases_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/calculate_coverage.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/calculate_coverage.rb deleted file mode 100644 index e7b9e9bd6cc3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/calculate_coverage.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_v3_generated_TestCases_CalculateCoverage_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the calculate_coverage call in the TestCases service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#calculate_coverage. -# -def calculate_coverage - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest.new - - # Call the calculate_coverage method. - result = client.calculate_coverage request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse. - p result -end -# [END dialogflow_v3_generated_TestCases_CalculateCoverage_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/create_test_case.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/create_test_case.rb deleted file mode 100644 index 0867d5d79b35..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/create_test_case.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_v3_generated_TestCases_CreateTestCase_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the create_test_case call in the TestCases service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#create_test_case. -# -def create_test_case - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest.new - - # Call the create_test_case method. - result = client.create_test_case request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. - p result -end -# [END dialogflow_v3_generated_TestCases_CreateTestCase_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/export_test_cases.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/export_test_cases.rb deleted file mode 100644 index fdf60afadaba..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/export_test_cases.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_v3_generated_TestCases_ExportTestCases_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the export_test_cases call in the TestCases service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#export_test_cases. -# -def export_test_cases - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest.new - - # Call the export_test_cases method. - result = client.export_test_cases request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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_v3_generated_TestCases_ExportTestCases_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case.rb deleted file mode 100644 index 1b7177eba996..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case.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_v3_generated_TestCases_GetTestCase_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the get_test_case call in the TestCases service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#get_test_case. -# -def get_test_case - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest.new - - # Call the get_test_case method. - result = client.get_test_case request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. - p result -end -# [END dialogflow_v3_generated_TestCases_GetTestCase_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case_result.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case_result.rb deleted file mode 100644 index aa7275baaffc..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case_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_v3_generated_TestCases_GetTestCaseResult_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the get_test_case_result call in the TestCases service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#get_test_case_result. -# -def get_test_case_result - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest.new - - # Call the get_test_case_result method. - result = client.get_test_case_result request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCaseResult. - p result -end -# [END dialogflow_v3_generated_TestCases_GetTestCaseResult_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/import_test_cases.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/import_test_cases.rb deleted file mode 100644 index ec2e71212fe2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/import_test_cases.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_v3_generated_TestCases_ImportTestCases_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the import_test_cases call in the TestCases service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#import_test_cases. -# -def import_test_cases - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest.new - - # Call the import_test_cases method. - result = client.import_test_cases request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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_v3_generated_TestCases_ImportTestCases_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_case_results.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_case_results.rb deleted file mode 100644 index a55831b4b1f4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_case_results.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_v3_generated_TestCases_ListTestCaseResults_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the list_test_case_results call in the TestCases service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_case_results. -# -def list_test_case_results - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest.new - - # Call the list_test_case_results method. - result = client.list_test_case_results request - - # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::TestCaseResult. - p item - end -end -# [END dialogflow_v3_generated_TestCases_ListTestCaseResults_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_cases.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_cases.rb deleted file mode 100644 index 16478c9513d3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_cases.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_v3_generated_TestCases_ListTestCases_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the list_test_cases call in the TestCases service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_cases. -# -def list_test_cases - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest.new - - # Call the list_test_cases method. - result = client.list_test_cases request - - # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::TestCase. - p item - end -end -# [END dialogflow_v3_generated_TestCases_ListTestCases_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/run_test_case.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/run_test_case.rb deleted file mode 100644 index 22c36898f598..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/run_test_case.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_v3_generated_TestCases_RunTestCase_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the run_test_case call in the TestCases service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#run_test_case. -# -def run_test_case - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest.new - - # Call the run_test_case method. - result = client.run_test_case request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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_v3_generated_TestCases_RunTestCase_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/update_test_case.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/update_test_case.rb deleted file mode 100644 index 1d157795bdfe..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/test_cases/update_test_case.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_v3_generated_TestCases_UpdateTestCase_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the update_test_case call in the TestCases service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#update_test_case. -# -def update_test_case - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest.new - - # Call the update_test_case method. - result = client.update_test_case request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. - p result -end -# [END dialogflow_v3_generated_TestCases_UpdateTestCase_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/create_transition_route_group.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/create_transition_route_group.rb deleted file mode 100644 index 8803c04423c6..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/create_transition_route_group.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_v3_generated_TransitionRouteGroups_CreateTransitionRouteGroup_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the create_transition_route_group call in the TransitionRouteGroups service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#create_transition_route_group. -# -def create_transition_route_group - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest.new - - # Call the create_transition_route_group method. - result = client.create_transition_route_group request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. - p result -end -# [END dialogflow_v3_generated_TransitionRouteGroups_CreateTransitionRouteGroup_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/delete_transition_route_group.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/delete_transition_route_group.rb deleted file mode 100644 index 0623c5d39044..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/delete_transition_route_group.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_v3_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the delete_transition_route_group call in the TransitionRouteGroups service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#delete_transition_route_group. -# -def delete_transition_route_group - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest.new - - # Call the delete_transition_route_group method. - result = client.delete_transition_route_group request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dialogflow_v3_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/get_transition_route_group.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/get_transition_route_group.rb deleted file mode 100644 index 535a842acdff..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/get_transition_route_group.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_v3_generated_TransitionRouteGroups_GetTransitionRouteGroup_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the get_transition_route_group call in the TransitionRouteGroups service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#get_transition_route_group. -# -def get_transition_route_group - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest.new - - # Call the get_transition_route_group method. - result = client.get_transition_route_group request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. - p result -end -# [END dialogflow_v3_generated_TransitionRouteGroups_GetTransitionRouteGroup_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/list_transition_route_groups.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/list_transition_route_groups.rb deleted file mode 100644 index e92fc6dab4ff..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/list_transition_route_groups.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_v3_generated_TransitionRouteGroups_ListTransitionRouteGroups_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the list_transition_route_groups call in the TransitionRouteGroups service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#list_transition_route_groups. -# -def list_transition_route_groups - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest.new - - # Call the list_transition_route_groups method. - result = client.list_transition_route_groups request - - # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::TransitionRouteGroup. - p item - end -end -# [END dialogflow_v3_generated_TransitionRouteGroups_ListTransitionRouteGroups_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/update_transition_route_group.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/update_transition_route_group.rb deleted file mode 100644 index 84c365777432..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/update_transition_route_group.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_v3_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the update_transition_route_group call in the TransitionRouteGroups service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#update_transition_route_group. -# -def update_transition_route_group - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest.new - - # Call the update_transition_route_group method. - result = client.update_transition_route_group request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. - p result -end -# [END dialogflow_v3_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/compare_versions.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/compare_versions.rb deleted file mode 100644 index b4776aa4fb1c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/compare_versions.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_v3_generated_Versions_CompareVersions_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the compare_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::CX::V3::Versions::Client#compare_versions. -# -def compare_versions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest.new - - # Call the compare_versions method. - result = client.compare_versions request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse. - p result -end -# [END dialogflow_v3_generated_Versions_CompareVersions_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/create_version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/create_version.rb deleted file mode 100644 index 3b879fec4fd2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/create_version.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_v3_generated_Versions_CreateVersion_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Versions::Client#create_version. -# -def create_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest.new - - # Call the create_version method. - result = client.create_version request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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_v3_generated_Versions_CreateVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/delete_version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/delete_version.rb deleted file mode 100644 index 9ceb18ec01c5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Versions_DeleteVersion_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Versions::Client#delete_version. -# -def delete_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::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_v3_generated_Versions_DeleteVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/get_version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/get_version.rb deleted file mode 100644 index 7594bfefe782..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Versions_GetVersion_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Versions::Client#get_version. -# -def get_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::GetVersionRequest.new - - # Call the get_version method. - result = client.get_version request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Version. - p result -end -# [END dialogflow_v3_generated_Versions_GetVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/list_versions.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/list_versions.rb deleted file mode 100644 index 7d69d147a6a7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Versions_ListVersions_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Versions::Client#list_versions. -# -def list_versions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Version. - p item - end -end -# [END dialogflow_v3_generated_Versions_ListVersions_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/load_version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/load_version.rb deleted file mode 100644 index 5dfc8e147940..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/load_version.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_v3_generated_Versions_LoadVersion_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the load_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::CX::V3::Versions::Client#load_version. -# -def load_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest.new - - # Call the load_version method. - result = client.load_version request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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_v3_generated_Versions_LoadVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/update_version.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/versions/update_version.rb deleted file mode 100644 index 0ebc2eac6e1d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/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_v3_generated_Versions_UpdateVersion_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# 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::CX::V3::Versions::Client#update_version. -# -def update_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest.new - - # Call the update_version method. - result = client.update_version request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Version. - p result -end -# [END dialogflow_v3_generated_Versions_UpdateVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/create_webhook.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/create_webhook.rb deleted file mode 100644 index 916dd1ad0734..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/create_webhook.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_v3_generated_Webhooks_CreateWebhook_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the create_webhook call in the Webhooks service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#create_webhook. -# -def create_webhook - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest.new - - # Call the create_webhook method. - result = client.create_webhook request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. - p result -end -# [END dialogflow_v3_generated_Webhooks_CreateWebhook_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/delete_webhook.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/delete_webhook.rb deleted file mode 100644 index b3962ea0f04c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/delete_webhook.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_v3_generated_Webhooks_DeleteWebhook_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the delete_webhook call in the Webhooks service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#delete_webhook. -# -def delete_webhook - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest.new - - # Call the delete_webhook method. - result = client.delete_webhook request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dialogflow_v3_generated_Webhooks_DeleteWebhook_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/get_webhook.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/get_webhook.rb deleted file mode 100644 index 5edd566a55b7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/get_webhook.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_v3_generated_Webhooks_GetWebhook_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the get_webhook call in the Webhooks service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#get_webhook. -# -def get_webhook - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest.new - - # Call the get_webhook method. - result = client.get_webhook request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. - p result -end -# [END dialogflow_v3_generated_Webhooks_GetWebhook_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/list_webhooks.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/list_webhooks.rb deleted file mode 100644 index de6b6e996130..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/list_webhooks.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_v3_generated_Webhooks_ListWebhooks_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the list_webhooks call in the Webhooks service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#list_webhooks. -# -def list_webhooks - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest.new - - # Call the list_webhooks method. - result = client.list_webhooks request - - # The returned object is of type Gapic::PagedEnumerable. You can 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::CX::V3::Webhook. - p item - end -end -# [END dialogflow_v3_generated_Webhooks_ListWebhooks_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/update_webhook.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/update_webhook.rb deleted file mode 100644 index 124a63b7ff86..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/snippets/webhooks/update_webhook.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_v3_generated_Webhooks_UpdateWebhook_sync] -require "google/cloud/dialogflow/cx/v3" - -## -# Snippet for the update_webhook call in the Webhooks service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#update_webhook. -# -def update_webhook - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest.new - - # Call the update_webhook method. - result = client.update_webhook request - - # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. - p result -end -# [END dialogflow_v3_generated_Webhooks_UpdateWebhook_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_operations_test.rb deleted file mode 100644 index bebb6af87dfc..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/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/cx/v3/agent_pb" -require "google/cloud/dialogflow/cx/v3/agent_services_pb" -require "google/cloud/dialogflow/cx/v3/agents" - -class ::Google::Cloud::Dialogflow::CX::V3::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 - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Agents::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_paths_test.rb deleted file mode 100644 index 1df2b5edcb7f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_paths_test.rb +++ /dev/null @@ -1,151 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dialogflow/cx/v3/agents" - -class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.agent_path project: "value0", location: "value1", agent: "value2" - assert_equal "projects/value0/locations/value1/agents/value2", path - end - end - - def test_agent_generative_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::CX::V3::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.agent_generative_settings_path project: "value0", location: "value1", agent: "value2" - assert_equal "projects/value0/locations/value1/agents/value2/generativeSettings", path - end - end - - def test_agent_validation_result_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::CX::V3::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.agent_validation_result_path project: "value0", location: "value1", agent: "value2" - assert_equal "projects/value0/locations/value1/agents/value2/validationResult", 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::CX::V3::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.environment_path project: "value0", location: "value1", agent: "value2", environment: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/environments/value3", path - end - end - - def test_flow_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::CX::V3::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.flow_path project: "value0", location: "value1", agent: "value2", flow: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/flows/value3", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::CX::V3::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_playbook_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::CX::V3::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.playbook_path project: "value0", location: "value1", agent: "value2", playbook: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/playbooks/value3", 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::CX::V3::Agents::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_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::CX::V3::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.security_settings_path project: "value0", location: "value1", security_settings: "value2" - assert_equal "projects/value0/locations/value1/securitySettings/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_rest_test.rb deleted file mode 100644 index 7c78df96064e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_rest_test.rb +++ /dev/null @@ -1,708 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/agent_pb" -require "google/cloud/dialogflow/cx/v3/agents/rest" - - -class ::Google::Cloud::Dialogflow::CX::V3::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_list_agents - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::ListAgentsResponse.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_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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_list_agents_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_agents_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_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 - client.list_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 - client.list_agents ::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_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 - client.list_agents(::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest.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_agents_client_stub.call_count - end - end - end - - def test_get_agent - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Agent.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_get_agent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_agent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_agent({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_agent name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_agent ::Google::Cloud::Dialogflow::CX::V3::GetAgentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_agent({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_agent(::Google::Cloud::Dialogflow::CX::V3::GetAgentRequest.new(name: name), 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_create_agent - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Agent.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - agent = {} - - create_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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_create_agent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_agent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_agent({ parent: parent, agent: agent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_agent parent: parent, agent: agent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_agent ::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest.new(parent: parent, agent: agent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_agent({ parent: parent, agent: agent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_agent(::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest.new(parent: parent, agent: agent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_agent_client_stub.call_count - end - end - end - - def test_update_agent - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Agent.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - agent = {} - update_mask = {} - - update_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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_update_agent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_agent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_agent({ agent: agent, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_agent agent: agent, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_agent ::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest.new(agent: agent, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_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 - client.update_agent(::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest.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, update_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. - name = "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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_delete_agent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_agent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_agent({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_agent name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_agent ::Google::Cloud::Dialogflow::CX::V3::DeleteAgentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_agent({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_agent(::Google::Cloud::Dialogflow::CX::V3::DeleteAgentRequest.new(name: name), 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_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. - name = "hello world" - agent_uri = "hello world" - data_format = :DATA_FORMAT_UNSPECIFIED - environment = "hello world" - git_destination = {} - include_bigquery_export_settings = true - - 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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_export_agent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, export_agent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.export_agent({ name: name, agent_uri: agent_uri, data_format: data_format, environment: environment, git_destination: git_destination, include_bigquery_export_settings: include_bigquery_export_settings }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.export_agent name: name, agent_uri: agent_uri, data_format: data_format, environment: environment, git_destination: git_destination, include_bigquery_export_settings: include_bigquery_export_settings do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.export_agent ::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest.new(name: name, agent_uri: agent_uri, data_format: data_format, environment: environment, git_destination: git_destination, include_bigquery_export_settings: include_bigquery_export_settings) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.export_agent({ name: name, agent_uri: agent_uri, data_format: data_format, environment: environment, git_destination: git_destination, include_bigquery_export_settings: include_bigquery_export_settings }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.export_agent(::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest.new(name: name, agent_uri: agent_uri, data_format: data_format, environment: environment, git_destination: git_destination, include_bigquery_export_settings: include_bigquery_export_settings), 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_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. - name = "hello world" - agent_uri = "hello world" - restore_option = :RESTORE_OPTION_UNSPECIFIED - - 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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_restore_agent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, restore_agent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.restore_agent({ name: name, agent_uri: agent_uri, restore_option: restore_option }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.restore_agent name: name, agent_uri: agent_uri, restore_option: restore_option do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.restore_agent ::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest.new(name: name, agent_uri: agent_uri, restore_option: restore_option) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.restore_agent({ name: name, agent_uri: agent_uri, restore_option: restore_option }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.restore_agent(::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest.new(name: name, agent_uri: agent_uri, restore_option: restore_option), 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_validate_agent - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult.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" - - validate_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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_validate_agent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, validate_agent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.validate_agent({ name: name, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.validate_agent name: name, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.validate_agent ::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest.new(name: name, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.validate_agent({ name: name, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.validate_agent(::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest.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, validate_agent_client_stub.call_count - end - end - end - - def test_get_agent_validation_result - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult.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_agent_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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_get_agent_validation_result_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_agent_validation_result_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_agent_validation_result({ name: name, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_agent_validation_result name: name, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_agent_validation_result ::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest.new(name: name, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_agent_validation_result({ name: name, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_agent_validation_result(::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest.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_agent_validation_result_client_stub.call_count - end - end - end - - def test_get_generative_settings - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings.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_generative_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_get_generative_settings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_generative_settings_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_generative_settings({ name: name, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_generative_settings name: name, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_generative_settings ::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest.new(name: name, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_generative_settings({ name: name, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_generative_settings(::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest.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_generative_settings_client_stub.call_count - end - end - end - - def test_update_generative_settings - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - generative_settings = {} - update_mask = {} - - update_generative_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Agents::Rest::ServiceStub.stub :transcode_update_generative_settings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_generative_settings_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_generative_settings({ generative_settings: generative_settings, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_generative_settings generative_settings: generative_settings, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_generative_settings ::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest.new(generative_settings: generative_settings, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_generative_settings({ generative_settings: generative_settings, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_generative_settings(::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest.new(generative_settings: generative_settings, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_generative_settings_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::CX::V3::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::CX::V3::Agents::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_test.rb deleted file mode 100644 index 908380277d16..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_test.rb +++ /dev/null @@ -1,802 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/agent_pb" -require "google/cloud/dialogflow/cx/v3/agents" - -class ::Google::Cloud::Dialogflow::CX::V3::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_list_agents - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListAgentsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_agents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_agents, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest, 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_agents_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_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 - client.list_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 - client.list_agents ::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_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 - client.list_agents(::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest.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_agents_client_stub.call_rpc_count - end - end - - def test_get_agent - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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. - name = "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::CX::V3::GetAgentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_agent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_agent({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_agent name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_agent ::Google::Cloud::Dialogflow::CX::V3::GetAgentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_agent({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_agent(::Google::Cloud::Dialogflow::CX::V3::GetAgentRequest.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_agent_client_stub.call_rpc_count - end - end - - def test_create_agent - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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" - agent = {} - - create_agent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_agent, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Agent), request["agent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_agent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_agent({ parent: parent, agent: agent }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_agent parent: parent, agent: agent do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_agent ::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest.new(parent: parent, agent: agent) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_agent({ parent: parent, agent: agent }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_agent(::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest.new(parent: parent, agent: agent), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_agent_client_stub.call_rpc_count - end - end - - def test_update_agent - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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 = {} - - update_agent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_agent, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Agent), request["agent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_agent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_agent({ agent: agent, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_agent agent: agent, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_agent ::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest.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 - client.update_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 - client.update_agent(::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest.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, update_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. - name = "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::CX::V3::DeleteAgentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_agent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_agent({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_agent name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_agent ::Google::Cloud::Dialogflow::CX::V3::DeleteAgentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_agent({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_agent(::Google::Cloud::Dialogflow::CX::V3::DeleteAgentRequest.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_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. - name = "hello world" - agent_uri = "hello world" - data_format = :DATA_FORMAT_UNSPECIFIED - environment = "hello world" - git_destination = {} - include_bigquery_export_settings = true - - 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::CX::V3::ExportAgentRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["agent_uri"] - assert_equal :DATA_FORMAT_UNSPECIFIED, request["data_format"] - assert_equal "hello world", request["environment"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest::GitDestination), request["git_destination"] - assert_equal true, request["include_bigquery_export_settings"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, export_agent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.export_agent({ name: name, agent_uri: agent_uri, data_format: data_format, environment: environment, git_destination: git_destination, include_bigquery_export_settings: include_bigquery_export_settings }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.export_agent name: name, agent_uri: agent_uri, data_format: data_format, environment: environment, git_destination: git_destination, include_bigquery_export_settings: include_bigquery_export_settings do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.export_agent ::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest.new(name: name, agent_uri: agent_uri, data_format: data_format, environment: environment, git_destination: git_destination, include_bigquery_export_settings: include_bigquery_export_settings) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.export_agent({ name: name, agent_uri: agent_uri, data_format: data_format, environment: environment, git_destination: git_destination, include_bigquery_export_settings: include_bigquery_export_settings }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.export_agent(::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest.new(name: name, agent_uri: agent_uri, data_format: data_format, environment: environment, git_destination: git_destination, include_bigquery_export_settings: include_bigquery_export_settings), 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_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. - name = "hello world" - agent_uri = "hello world" - restore_option = :RESTORE_OPTION_UNSPECIFIED - - 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::CX::V3::RestoreAgentRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["agent_uri"] - assert_equal :agent_uri, request.agent - assert_equal :RESTORE_OPTION_UNSPECIFIED, request["restore_option"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, restore_agent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.restore_agent({ name: name, agent_uri: agent_uri, restore_option: restore_option }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.restore_agent name: name, agent_uri: agent_uri, restore_option: restore_option do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.restore_agent ::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest.new(name: name, agent_uri: agent_uri, restore_option: restore_option) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.restore_agent({ name: name, agent_uri: agent_uri, restore_option: restore_option }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.restore_agent(::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest.new(name: name, agent_uri: agent_uri, restore_option: restore_option), 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_validate_agent - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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" - - validate_agent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :validate_agent, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, validate_agent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.validate_agent({ name: name, language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.validate_agent name: name, language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.validate_agent ::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest.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 - client.validate_agent({ 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 - client.validate_agent(::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest.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, validate_agent_client_stub.call_rpc_count - end - end - - def test_get_agent_validation_result - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_agent_validation_result_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_agent_validation_result, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_agent_validation_result_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_agent_validation_result({ name: name, language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_agent_validation_result name: name, language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_agent_validation_result ::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest.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 - client.get_agent_validation_result({ 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 - client.get_agent_validation_result(::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest.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_agent_validation_result_client_stub.call_rpc_count - end - end - - def test_get_generative_settings - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_generative_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_generative_settings, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_generative_settings_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_generative_settings({ name: name, language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_generative_settings name: name, language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_generative_settings ::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest.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 - client.get_generative_settings({ 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 - client.get_generative_settings(::Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest.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_generative_settings_client_stub.call_rpc_count - end - end - - def test_update_generative_settings - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - generative_settings = {} - update_mask = {} - - update_generative_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_generative_settings, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings), request["generative_settings"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_generative_settings_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_generative_settings({ generative_settings: generative_settings, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_generative_settings generative_settings: generative_settings, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_generative_settings ::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest.new(generative_settings: generative_settings, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_generative_settings({ generative_settings: generative_settings, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_generative_settings(::Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest.new(generative_settings: generative_settings, 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_generative_settings_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::CX::V3::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::CX::V3::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::CX::V3::Agents::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Agents::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Agents::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_paths_test.rb deleted file mode 100644 index afbd35c855fd..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_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/cx/v3/changelogs" - -class ::Google::Cloud::Dialogflow::CX::V3::Changelogs::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::CX::V3::Changelogs::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.agent_path project: "value0", location: "value1", agent: "value2" - assert_equal "projects/value0/locations/value1/agents/value2", path - end - end - - def test_changelog_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::CX::V3::Changelogs::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.changelog_path project: "value0", location: "value1", agent: "value2", changelog: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/changelogs/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_rest_test.rb deleted file mode 100644 index afd2a3614056..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_rest_test.rb +++ /dev/null @@ -1,210 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/changelog_pb" -require "google/cloud/dialogflow/cx/v3/changelogs/rest" - - -class ::Google::Cloud::Dialogflow::CX::V3::Changelogs::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_changelogs - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::ListChangelogsResponse.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_changelogs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Changelogs::Rest::ServiceStub.stub :transcode_list_changelogs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_changelogs_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_changelogs({ 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 - client.list_changelogs 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 - client.list_changelogs ::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest.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 - client.list_changelogs({ 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 - client.list_changelogs(::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest.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_changelogs_client_stub.call_count - end - end - end - - def test_get_changelog - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Changelog.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_changelog_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Changelogs::Rest::ServiceStub.stub :transcode_get_changelog_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_changelog_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_changelog({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_changelog name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_changelog ::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_changelog({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_changelog(::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_changelog_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::CX::V3::Changelogs::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::CX::V3::Changelogs::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_test.rb deleted file mode 100644 index 8243cf43d622..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_test.rb +++ /dev/null @@ -1,231 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/changelog_pb" -require "google/cloud/dialogflow/cx/v3/changelogs" - -class ::Google::Cloud::Dialogflow::CX::V3::Changelogs::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_changelogs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListChangelogsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_changelogs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_changelogs, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest, 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_changelogs_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_changelogs({ 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 - client.list_changelogs 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 - client.list_changelogs ::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest.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 - client.list_changelogs({ 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 - client.list_changelogs(::Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest.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_changelogs_client_stub.call_rpc_count - end - end - - def test_get_changelog - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Changelog.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_changelog_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_changelog, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_changelog_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_changelog({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_changelog name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_changelog ::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_changelog({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_changelog(::Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest.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_changelog_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::CX::V3::Changelogs::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::CX::V3::Changelogs::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::CX::V3::Changelogs::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_paths_test.rb deleted file mode 100644 index dbd82986cc76..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_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/cx/v3/deployments" - -class ::Google::Cloud::Dialogflow::CX::V3::Deployments::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_deployment_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::CX::V3::Deployments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.deployment_path project: "value0", location: "value1", agent: "value2", environment: "value3", deployment: "value4" - assert_equal "projects/value0/locations/value1/agents/value2/environments/value3/deployments/value4", 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::CX::V3::Deployments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.environment_path project: "value0", location: "value1", agent: "value2", environment: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/environments/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_rest_test.rb deleted file mode 100644 index 2443ea06669a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_rest_test.rb +++ /dev/null @@ -1,209 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/deployment_pb" -require "google/cloud/dialogflow/cx/v3/deployments/rest" - - -class ::Google::Cloud::Dialogflow::CX::V3::Deployments::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_deployments - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsResponse.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_deployments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Deployments::Rest::ServiceStub.stub :transcode_list_deployments_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_deployments_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_deployments({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_deployments parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_deployments ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_deployments({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_deployments(::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest.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_deployments_client_stub.call_count - end - end - end - - def test_get_deployment - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Deployment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_deployment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Deployments::Rest::ServiceStub.stub :transcode_get_deployment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_deployment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_deployment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_deployment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_deployment ::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_deployment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_deployment(::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_deployment_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::CX::V3::Deployments::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::CX::V3::Deployments::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_test.rb deleted file mode 100644 index 8d05716cdf43..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_test.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! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dialogflow/cx/v3/deployment_pb" -require "google/cloud/dialogflow/cx/v3/deployments" - -class ::Google::Cloud::Dialogflow::CX::V3::Deployments::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_deployments - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_deployments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_deployments, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest, 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_deployments_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_deployments({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_deployments parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_deployments ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_deployments({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_deployments(::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest.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_deployments_client_stub.call_rpc_count - end - end - - def test_get_deployment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Deployment.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_deployment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_deployment, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_deployment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_deployment({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_deployment name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_deployment ::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_deployment({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_deployment(::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest.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_deployment_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::CX::V3::Deployments::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::CX::V3::Deployments::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::CX::V3::Deployments::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_operations_test.rb deleted file mode 100644 index 6cc99005f842..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/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/cx/v3/entity_type_pb" -require "google/cloud/dialogflow/cx/v3/entity_type_services_pb" -require "google/cloud/dialogflow/cx/v3/entity_types" - -class ::Google::Cloud::Dialogflow::CX::V3::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 - client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityTypes::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_paths_test.rb deleted file mode 100644 index ed16cb2ce004..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_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/cx/v3/entity_types" - -class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.agent_path project: "value0", location: "value1", agent: "value2" - assert_equal "projects/value0/locations/value1/agents/value2", 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::CX::V3::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.entity_type_path project: "value0", location: "value1", agent: "value2", entity_type: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/entityTypes/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_rest_test.rb deleted file mode 100644 index f68ce5edff2b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_rest_test.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 "helper" -require "gapic/rest" -require "google/cloud/dialogflow/cx/v3/entity_type_pb" -require "google/cloud/dialogflow/cx/v3/entity_types/rest" - - -class ::Google::Cloud::Dialogflow::CX::V3::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_get_entity_type - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityTypes::Rest::ServiceStub.stub :transcode_get_entity_type_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_entity_type_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_entity_type({ name: name, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_entity_type name: name, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_entity_type ::Google::Cloud::Dialogflow::CX::V3::GetEntityTypeRequest.new(name: name, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.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 - client.get_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::EntityTypes::Rest::ServiceStub.stub :transcode_create_entity_type_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_entity_type_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.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 - client.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 - client.create_entity_type ::Google::Cloud::Dialogflow::CX::V3::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 - client.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 - client.create_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::EntityTypes::Rest::ServiceStub.stub :transcode_update_entity_type_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_entity_type_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.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 - client.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 - client.update_entity_type ::Google::Cloud::Dialogflow::CX::V3::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 - client.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 - client.update_entity_type(::Google::Cloud::Dialogflow::CX::V3::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" - force = true - - 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::CX::V3::EntityTypes::Rest::ServiceStub.stub :transcode_delete_entity_type_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_entity_type_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_entity_type({ name: name, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_entity_type name: name, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_entity_type ::Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest.new(name: name, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_entity_type({ name: name, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_entity_type(::Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest.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_entity_type_client_stub.call_count - end - end - end - - def test_list_entity_types - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityTypes::Rest::ServiceStub.stub :transcode_list_entity_types_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_entity_types_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.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 - client.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 - client.list_entity_types ::Google::Cloud::Dialogflow::CX::V3::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 - client.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 - client.list_entity_types(::Google::Cloud::Dialogflow::CX::V3::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_export_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_types = ["hello world"] - entity_types_uri = "hello world" - data_format = :DATA_FORMAT_UNSPECIFIED - language_code = "hello world" - - export_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::CX::V3::EntityTypes::Rest::ServiceStub.stub :transcode_export_entity_types_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, export_entity_types_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.export_entity_types({ parent: parent, entity_types: entity_types, entity_types_uri: entity_types_uri, data_format: data_format, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.export_entity_types parent: parent, entity_types: entity_types, entity_types_uri: entity_types_uri, data_format: data_format, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.export_entity_types ::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest.new(parent: parent, entity_types: entity_types, entity_types_uri: entity_types_uri, data_format: data_format, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.export_entity_types({ parent: parent, entity_types: entity_types, entity_types_uri: entity_types_uri, data_format: data_format, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.export_entity_types(::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest.new(parent: parent, entity_types: entity_types, entity_types_uri: entity_types_uri, data_format: data_format, language_code: language_code), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, export_entity_types_client_stub.call_count - end - end - end - - def test_import_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_types_uri = "hello world" - merge_option = :MERGE_OPTION_UNSPECIFIED - target_entity_type = "hello world" - - import_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::CX::V3::EntityTypes::Rest::ServiceStub.stub :transcode_import_entity_types_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_entity_types_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_entity_types({ parent: parent, entity_types_uri: entity_types_uri, merge_option: merge_option, target_entity_type: target_entity_type }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_entity_types parent: parent, entity_types_uri: entity_types_uri, merge_option: merge_option, target_entity_type: target_entity_type do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_entity_types ::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest.new(parent: parent, entity_types_uri: entity_types_uri, merge_option: merge_option, target_entity_type: target_entity_type) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_entity_types({ parent: parent, entity_types_uri: entity_types_uri, merge_option: merge_option, target_entity_type: target_entity_type }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_entity_types(::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest.new(parent: parent, entity_types_uri: entity_types_uri, merge_option: merge_option, target_entity_type: target_entity_type), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_entity_types_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::CX::V3::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::CX::V3::EntityTypes::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_test.rb deleted file mode 100644 index 4086676ce92e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_test.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! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dialogflow/cx/v3/entity_type_pb" -require "google/cloud/dialogflow/cx/v3/entity_types" - -class ::Google::Cloud::Dialogflow::CX::V3::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_get_entity_type - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 - client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.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 - client.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 - client.get_entity_type ::Google::Cloud::Dialogflow::CX::V3::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 - client.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 - client.get_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::CreateEntityTypeRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::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 - client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.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 - client.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 - client.create_entity_type ::Google::Cloud::Dialogflow::CX::V3::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 - client.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 - client.create_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::UpdateEntityTypeRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::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 - client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.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 - client.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 - client.update_entity_type ::Google::Cloud::Dialogflow::CX::V3::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 - client.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 - client.update_entity_type(::Google::Cloud::Dialogflow::CX::V3::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" - force = true - - 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::CX::V3::DeleteEntityTypeRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_entity_type_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_entity_type({ name: name, force: force }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_entity_type name: name, force: force do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_entity_type ::Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest.new(name: name, force: force) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_entity_type({ 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 - client.delete_entity_type(::Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest.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_entity_type_client_stub.call_rpc_count - end - end - - def test_list_entity_types - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 - client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.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 - client.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 - client.list_entity_types ::Google::Cloud::Dialogflow::CX::V3::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 - client.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 - client.list_entity_types(::Google::Cloud::Dialogflow::CX::V3::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_export_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_types = ["hello world"] - entity_types_uri = "hello world" - data_format = :DATA_FORMAT_UNSPECIFIED - language_code = "hello world" - - export_entity_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :export_entity_types, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest, request - assert_equal "hello world", request["parent"] - assert_equal ["hello world"], request["entity_types"] - assert_equal "hello world", request["entity_types_uri"] - assert_equal :entity_types_uri, request.destination - assert_equal :DATA_FORMAT_UNSPECIFIED, request["data_format"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, export_entity_types_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.export_entity_types({ parent: parent, entity_types: entity_types, entity_types_uri: entity_types_uri, data_format: data_format, 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 - client.export_entity_types parent: parent, entity_types: entity_types, entity_types_uri: entity_types_uri, data_format: data_format, 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 - client.export_entity_types ::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest.new(parent: parent, entity_types: entity_types, entity_types_uri: entity_types_uri, data_format: data_format, 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 - client.export_entity_types({ parent: parent, entity_types: entity_types, entity_types_uri: entity_types_uri, data_format: data_format, 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 - client.export_entity_types(::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest.new(parent: parent, entity_types: entity_types, entity_types_uri: entity_types_uri, data_format: data_format, 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, export_entity_types_client_stub.call_rpc_count - end - end - - def test_import_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_types_uri = "hello world" - merge_option = :MERGE_OPTION_UNSPECIFIED - target_entity_type = "hello world" - - import_entity_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_entity_types, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["entity_types_uri"] - assert_equal :entity_types_uri, request.entity_types - assert_equal :MERGE_OPTION_UNSPECIFIED, request["merge_option"] - assert_equal "hello world", request["target_entity_type"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_entity_types_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_entity_types({ parent: parent, entity_types_uri: entity_types_uri, merge_option: merge_option, target_entity_type: target_entity_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 - client.import_entity_types parent: parent, entity_types_uri: entity_types_uri, merge_option: merge_option, target_entity_type: target_entity_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 - client.import_entity_types ::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest.new(parent: parent, entity_types_uri: entity_types_uri, merge_option: merge_option, target_entity_type: target_entity_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 - client.import_entity_types({ parent: parent, entity_types_uri: entity_types_uri, merge_option: merge_option, target_entity_type: target_entity_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 - client.import_entity_types(::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest.new(parent: parent, entity_types_uri: entity_types_uri, merge_option: merge_option, target_entity_type: target_entity_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, import_entity_types_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::CX::V3::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::CX::V3::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::CX::V3::EntityTypes::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_operations_test.rb deleted file mode 100644 index bad755976c13..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_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/cx/v3/environment_pb" -require "google/cloud/dialogflow/cx/v3/environment_services_pb" -require "google/cloud/dialogflow/cx/v3/environments" - -class ::Google::Cloud::Dialogflow::CX::V3::Environments::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::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::CX::V3::Environments::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_paths_test.rb deleted file mode 100644 index 584f57acdda4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_paths_test.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! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dialogflow/cx/v3/environments" - -class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.agent_path project: "value0", location: "value1", agent: "value2" - assert_equal "projects/value0/locations/value1/agents/value2", 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::CX::V3::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.environment_path project: "value0", location: "value1", agent: "value2", environment: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/environments/value3", 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::CX::V3::Environments::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::CX::V3::Environments::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_test_case_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::CX::V3::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.test_case_path project: "value0", location: "value1", agent: "value2", test_case: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/testCases/value3", 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::CX::V3::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.version_path project: "value0", location: "value1", agent: "value2", flow: "value3", version: "value4" - assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/versions/value4", path - end - end - - def test_webhook_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::CX::V3::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.webhook_path project: "value0", location: "value1", agent: "value2", webhook: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/webhooks/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_rest_test.rb deleted file mode 100644 index 558d9b8bd405..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_rest_test.rb +++ /dev/null @@ -1,594 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/environment_pb" -require "google/cloud/dialogflow/cx/v3/environments/rest" - - -class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::Environments::Rest::ServiceStub.stub :transcode_list_environments_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_environments_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.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 - client.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 - client.list_environments ::Google::Cloud::Dialogflow::CX::V3::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 - client.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 - client.list_environments(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::Environments::Rest::ServiceStub.stub :transcode_get_environment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_environment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_environment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_environment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_environment ::Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_environment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_environment(::Google::Cloud::Dialogflow::CX::V3::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::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - environment = {} - - 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::CX::V3::Environments::Rest::ServiceStub.stub :transcode_create_environment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_environment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_environment({ parent: parent, environment: environment }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_environment parent: parent, environment: environment do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_environment ::Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest.new(parent: parent, environment: environment) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_environment({ parent: parent, environment: environment }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_environment(::Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest.new(parent: parent, environment: environment), 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::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - environment = {} - update_mask = {} - - 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::CX::V3::Environments::Rest::ServiceStub.stub :transcode_update_environment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_environment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_environment({ environment: environment, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_environment environment: environment, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_environment ::Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest.new(environment: environment, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_environment({ environment: environment, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_environment(::Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest.new(environment: environment, update_mask: update_mask), 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::CX::V3::Environments::Rest::ServiceStub.stub :transcode_delete_environment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_environment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_environment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_environment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_environment ::Google::Cloud::Dialogflow::CX::V3::DeleteEnvironmentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_environment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_environment(::Google::Cloud::Dialogflow::CX::V3::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_lookup_environment_history - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - page_size = 42 - page_token = "hello world" - - lookup_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::CX::V3::Environments::Rest::ServiceStub.stub :transcode_lookup_environment_history_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, lookup_environment_history_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.lookup_environment_history({ name: name, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.lookup_environment_history name: name, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.lookup_environment_history ::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest.new(name: name, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.lookup_environment_history({ name: name, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.lookup_environment_history(::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest.new(name: name, 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, lookup_environment_history_client_stub.call_count - end - end - end - - def test_run_continuous_test - # 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. - environment = "hello world" - - run_continuous_test_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Environments::Rest::ServiceStub.stub :transcode_run_continuous_test_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, run_continuous_test_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.run_continuous_test({ environment: environment }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.run_continuous_test environment: environment do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.run_continuous_test ::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest.new(environment: environment) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.run_continuous_test({ environment: environment }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.run_continuous_test(::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest.new(environment: environment), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, run_continuous_test_client_stub.call_count - end - end - end - - def test_list_continuous_test_results - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsResponse.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_continuous_test_results_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Environments::Rest::ServiceStub.stub :transcode_list_continuous_test_results_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_continuous_test_results_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_continuous_test_results({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_continuous_test_results parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_continuous_test_results ::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_continuous_test_results({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_continuous_test_results(::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest.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_continuous_test_results_client_stub.call_count - end - end - end - - def test_deploy_flow - # 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. - environment = "hello world" - flow_version = "hello world" - - deploy_flow_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Environments::Rest::ServiceStub.stub :transcode_deploy_flow_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, deploy_flow_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.deploy_flow({ environment: environment, flow_version: flow_version }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.deploy_flow environment: environment, flow_version: flow_version do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.deploy_flow ::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest.new(environment: environment, flow_version: flow_version) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.deploy_flow({ environment: environment, flow_version: flow_version }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.deploy_flow(::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest.new(environment: environment, flow_version: flow_version), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, deploy_flow_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::CX::V3::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::CX::V3::Environments::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_test.rb deleted file mode 100644 index 279fe032e558..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dialogflow/cx/v3/environment_pb" -require "google/cloud/dialogflow/cx/v3/environments" - -class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.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 - client.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 - client.list_environments ::Google::Cloud::Dialogflow::CX::V3::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 - client.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 - client.list_environments(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::GetEnvironmentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_environment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_environment({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_environment name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_environment ::Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.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 - client.get_environment(::Google::Cloud::Dialogflow::CX::V3::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::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" - environment = {} - - 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::CX::V3::CreateEnvironmentRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Environment), request["environment"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_environment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_environment({ parent: parent, environment: environment }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_environment parent: parent, environment: environment do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_environment ::Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest.new(parent: parent, environment: environment) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_environment({ parent: parent, environment: environment }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_environment(::Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest.new(parent: parent, environment: environment), 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_environment_client_stub.call_rpc_count - end - end - - def test_update_environment - # 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. - environment = {} - update_mask = {} - - 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::CX::V3::UpdateEnvironmentRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Environment), request["environment"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_environment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_environment({ environment: environment, 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 - client.update_environment environment: environment, 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 - client.update_environment ::Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest.new(environment: environment, 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 - client.update_environment({ environment: environment, 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 - client.update_environment(::Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest.new(environment: environment, 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_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::CX::V3::DeleteEnvironmentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_environment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_environment({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_environment name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_environment ::Google::Cloud::Dialogflow::CX::V3::DeleteEnvironmentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.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 - client.delete_environment(::Google::Cloud::Dialogflow::CX::V3::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_lookup_environment_history - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - page_size = 42 - page_token = "hello world" - - lookup_environment_history_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :lookup_environment_history, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, lookup_environment_history_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.lookup_environment_history({ name: name, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.lookup_environment_history name: name, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.lookup_environment_history ::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest.new(name: name, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.lookup_environment_history({ name: name, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.lookup_environment_history(::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest.new(name: name, 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, lookup_environment_history_client_stub.call_rpc_count - end - end - - def test_run_continuous_test - # 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. - environment = "hello world" - - run_continuous_test_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :run_continuous_test, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest, request - assert_equal "hello world", request["environment"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, run_continuous_test_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.run_continuous_test({ environment: environment }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.run_continuous_test environment: environment do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.run_continuous_test ::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest.new(environment: environment) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.run_continuous_test({ environment: environment }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.run_continuous_test(::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest.new(environment: environment), 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, run_continuous_test_client_stub.call_rpc_count - end - end - - def test_list_continuous_test_results - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_continuous_test_results_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_continuous_test_results, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest, 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_continuous_test_results_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_continuous_test_results({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_continuous_test_results parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_continuous_test_results ::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_continuous_test_results({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_continuous_test_results(::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest.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_continuous_test_results_client_stub.call_rpc_count - end - end - - def test_deploy_flow - # 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. - environment = "hello world" - flow_version = "hello world" - - deploy_flow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :deploy_flow, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest, request - assert_equal "hello world", request["environment"] - assert_equal "hello world", request["flow_version"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, deploy_flow_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.deploy_flow({ environment: environment, flow_version: flow_version }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.deploy_flow environment: environment, flow_version: flow_version do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.deploy_flow ::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest.new(environment: environment, flow_version: flow_version) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.deploy_flow({ environment: environment, flow_version: flow_version }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.deploy_flow(::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest.new(environment: environment, flow_version: flow_version), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, deploy_flow_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::CX::V3::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::CX::V3::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::CX::V3::Environments::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Environments::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::CX::V3::Environments::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Environments::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_paths_test.rb deleted file mode 100644 index 1b93ab32075a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_paths_test.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/experiments" - -class ::Google::Cloud::Dialogflow::CX::V3::Experiments::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_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::CX::V3::Experiments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.environment_path project: "value0", location: "value1", agent: "value2", environment: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/environments/value3", path - end - end - - def test_experiment_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::CX::V3::Experiments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.experiment_path project: "value0", location: "value1", agent: "value2", environment: "value3", experiment: "value4" - assert_equal "projects/value0/locations/value1/agents/value2/environments/value3/experiments/value4", 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::CX::V3::Experiments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.version_path project: "value0", location: "value1", agent: "value2", flow: "value3", version: "value4" - assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/versions/value4", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_rest_test.rb deleted file mode 100644 index 210c059980dc..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_rest_test.rb +++ /dev/null @@ -1,481 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/dialogflow/cx/v3/experiment_pb" -require "google/cloud/dialogflow/cx/v3/experiments/rest" - - -class ::Google::Cloud::Dialogflow::CX::V3::Experiments::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_experiments - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::ListExperimentsResponse.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_experiments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Experiments::Rest::ServiceStub.stub :transcode_list_experiments_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_experiments_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_experiments({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_experiments parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_experiments ::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_experiments({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_experiments(::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest.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_experiments_client_stub.call_count - end - end - end - - def test_get_experiment - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Experiment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_experiment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Experiments::Rest::ServiceStub.stub :transcode_get_experiment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_experiment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_experiment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_experiment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_experiment ::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_experiment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_experiment(::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_experiment_client_stub.call_count - end - end - end - - def test_create_experiment - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Experiment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - experiment = {} - - create_experiment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Experiments::Rest::ServiceStub.stub :transcode_create_experiment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_experiment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_experiment({ parent: parent, experiment: experiment }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_experiment parent: parent, experiment: experiment do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_experiment ::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest.new(parent: parent, experiment: experiment) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_experiment({ parent: parent, experiment: experiment }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_experiment(::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest.new(parent: parent, experiment: experiment), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_experiment_client_stub.call_count - end - end - end - - def test_update_experiment - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Experiment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - experiment = {} - update_mask = {} - - update_experiment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Experiments::Rest::ServiceStub.stub :transcode_update_experiment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_experiment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_experiment({ experiment: experiment, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_experiment experiment: experiment, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_experiment ::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest.new(experiment: experiment, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_experiment({ experiment: experiment, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_experiment(::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest.new(experiment: experiment, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_experiment_client_stub.call_count - end - end - end - - def test_delete_experiment - # 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_experiment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Experiments::Rest::ServiceStub.stub :transcode_delete_experiment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_experiment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_experiment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_experiment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_experiment ::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_experiment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_experiment(::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_experiment_client_stub.call_count - end - end - end - - def test_start_experiment - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Experiment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - start_experiment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Experiments::Rest::ServiceStub.stub :transcode_start_experiment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, start_experiment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.start_experiment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.start_experiment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.start_experiment ::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.start_experiment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.start_experiment(::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, start_experiment_client_stub.call_count - end - end - end - - def test_stop_experiment - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Experiment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - stop_experiment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Experiments::Rest::ServiceStub.stub :transcode_stop_experiment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, stop_experiment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.stop_experiment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.stop_experiment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.stop_experiment ::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.stop_experiment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.stop_experiment(::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, stop_experiment_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::CX::V3::Experiments::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::CX::V3::Experiments::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_test.rb deleted file mode 100644 index 16825f2a6403..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_test.rb +++ /dev/null @@ -1,523 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/experiment_pb" -require "google/cloud/dialogflow/cx/v3/experiments" - -class ::Google::Cloud::Dialogflow::CX::V3::Experiments::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_experiments - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListExperimentsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_experiments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_experiments, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest, 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_experiments_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_experiments({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_experiments parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_experiments ::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_experiments({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_experiments(::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest.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_experiments_client_stub.call_rpc_count - end - end - - def test_get_experiment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Experiment.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_experiment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_experiment, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_experiment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_experiment({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_experiment name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_experiment ::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_experiment({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_experiment(::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest.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_experiment_client_stub.call_rpc_count - end - end - - def test_create_experiment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Experiment.new - grpc_operation = GRPC::ActiveCall::Operation.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" - experiment = {} - - create_experiment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_experiment, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Experiment), request["experiment"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_experiment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_experiment({ parent: parent, experiment: experiment }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_experiment parent: parent, experiment: experiment do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_experiment ::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest.new(parent: parent, experiment: experiment) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_experiment({ parent: parent, experiment: experiment }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_experiment(::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest.new(parent: parent, experiment: experiment), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_experiment_client_stub.call_rpc_count - end - end - - def test_update_experiment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Experiment.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - experiment = {} - update_mask = {} - - update_experiment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_experiment, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Experiment), request["experiment"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_experiment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_experiment({ experiment: experiment, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_experiment experiment: experiment, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_experiment ::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest.new(experiment: experiment, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_experiment({ experiment: experiment, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_experiment(::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest.new(experiment: experiment, 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_experiment_client_stub.call_rpc_count - end - end - - def test_delete_experiment - # 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_experiment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_experiment, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_experiment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_experiment({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_experiment name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_experiment ::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_experiment({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_experiment(::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest.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_experiment_client_stub.call_rpc_count - end - end - - def test_start_experiment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Experiment.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - start_experiment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :start_experiment, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, start_experiment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.start_experiment({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.start_experiment name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.start_experiment ::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.start_experiment({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.start_experiment(::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest.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, start_experiment_client_stub.call_rpc_count - end - end - - def test_stop_experiment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Experiment.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - stop_experiment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :stop_experiment, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, stop_experiment_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.stop_experiment({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.stop_experiment name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.stop_experiment ::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.stop_experiment({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.stop_experiment(::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest.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, stop_experiment_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::CX::V3::Experiments::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::CX::V3::Experiments::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::CX::V3::Experiments::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_operations_test.rb deleted file mode 100644 index fc4cdc34a141..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_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/cx/v3/flow_pb" -require "google/cloud/dialogflow/cx/v3/flow_services_pb" -require "google/cloud/dialogflow/cx/v3/flows" - -class ::Google::Cloud::Dialogflow::CX::V3::Flows::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::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::CX::V3::Flows::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_paths_test.rb deleted file mode 100644 index 100f203f923c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_paths_test.rb +++ /dev/null @@ -1,166 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/flows" - -class ::Google::Cloud::Dialogflow::CX::V3::Flows::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::CX::V3::Flows::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.agent_path project: "value0", location: "value1", agent: "value2" - assert_equal "projects/value0/locations/value1/agents/value2", path - end - end - - def test_flow_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::CX::V3::Flows::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.flow_path project: "value0", location: "value1", agent: "value2", flow: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/flows/value3", path - end - end - - def test_flow_validation_result_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::CX::V3::Flows::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.flow_validation_result_path project: "value0", location: "value1", agent: "value2", flow: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/validationResult", 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::CX::V3::Flows::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.generator_path project: "value0", location: "value1", agent: "value2", generator: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/generators/value3", 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::CX::V3::Flows::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.intent_path project: "value0", location: "value1", agent: "value2", intent: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/intents/value3", path - end - end - - def test_page_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::CX::V3::Flows::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.page_path project: "value0", location: "value1", agent: "value2", flow: "value3", page: "value4" - assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/pages/value4", path - end - end - - def test_playbook_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::CX::V3::Flows::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.playbook_path project: "value0", location: "value1", agent: "value2", playbook: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/playbooks/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::CX::V3::Flows::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tool_path project: "value0", location: "value1", agent: "value2", tool: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/tools/value3", path - end - end - - def test_transition_route_group_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::CX::V3::Flows::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.transition_route_group_path project: "value0", location: "value1", agent: "value2", flow: "value3", transition_route_group: "value4" - assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/transitionRouteGroups/value4", path - - path = client.transition_route_group_path project: "value0", location: "value1", agent: "value2", transition_route_group: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/transitionRouteGroups/value3", path - end - end - - def test_webhook_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::CX::V3::Flows::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.webhook_path project: "value0", location: "value1", agent: "value2", webhook: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/webhooks/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_rest_test.rb deleted file mode 100644 index ef662ba89df1..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_rest_test.rb +++ /dev/null @@ -1,655 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/flow_pb" -require "google/cloud/dialogflow/cx/v3/flows/rest" - - -class ::Google::Cloud::Dialogflow::CX::V3::Flows::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_flow - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Flow.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - flow = {} - language_code = "hello world" - - create_flow_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Flows::Rest::ServiceStub.stub :transcode_create_flow_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_flow_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_flow({ parent: parent, flow: flow, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_flow parent: parent, flow: flow, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_flow ::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest.new(parent: parent, flow: flow, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_flow({ parent: parent, flow: flow, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_flow(::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest.new(parent: parent, flow: flow, language_code: language_code), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_flow_client_stub.call_count - end - end - end - - def test_delete_flow - # 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_flow_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Flows::Rest::ServiceStub.stub :transcode_delete_flow_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_flow_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_flow({ name: name, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_flow name: name, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_flow ::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest.new(name: name, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_flow({ name: name, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_flow(::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest.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_flow_client_stub.call_count - end - end - end - - def test_list_flows - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::ListFlowsResponse.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" - language_code = "hello world" - - list_flows_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Flows::Rest::ServiceStub.stub :transcode_list_flows_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_flows_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_flows({ parent: parent, page_size: page_size, page_token: page_token, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_flows parent: parent, page_size: page_size, page_token: page_token, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_flows ::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest.new(parent: parent, page_size: page_size, page_token: page_token, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_flows({ parent: parent, page_size: page_size, page_token: page_token, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_flows(::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest.new(parent: parent, page_size: page_size, page_token: page_token, language_code: language_code), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_flows_client_stub.call_count - end - end - end - - def test_get_flow - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Flow.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_flow_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Flows::Rest::ServiceStub.stub :transcode_get_flow_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_flow_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_flow({ name: name, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_flow name: name, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_flow ::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest.new(name: name, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_flow({ name: name, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_flow(::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest.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_flow_client_stub.call_count - end - end - end - - def test_update_flow - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Flow.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - flow = {} - update_mask = {} - language_code = "hello world" - - update_flow_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Flows::Rest::ServiceStub.stub :transcode_update_flow_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_flow_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_flow({ flow: flow, update_mask: update_mask, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_flow flow: flow, update_mask: update_mask, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_flow ::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest.new(flow: flow, update_mask: update_mask, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_flow({ flow: flow, update_mask: update_mask, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_flow(::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest.new(flow: flow, update_mask: update_mask, language_code: language_code), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_flow_client_stub.call_count - end - end - end - - def test_train_flow - # 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" - - train_flow_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Flows::Rest::ServiceStub.stub :transcode_train_flow_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, train_flow_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.train_flow({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.train_flow name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.train_flow ::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.train_flow({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.train_flow(::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, train_flow_client_stub.call_count - end - end - end - - def test_validate_flow - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult.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" - - validate_flow_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Flows::Rest::ServiceStub.stub :transcode_validate_flow_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, validate_flow_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.validate_flow({ name: name, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.validate_flow name: name, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.validate_flow ::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest.new(name: name, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.validate_flow({ name: name, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.validate_flow(::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest.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, validate_flow_client_stub.call_count - end - end - end - - def test_get_flow_validation_result - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult.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_flow_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::CX::V3::Flows::Rest::ServiceStub.stub :transcode_get_flow_validation_result_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_flow_validation_result_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_flow_validation_result({ name: name, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_flow_validation_result name: name, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_flow_validation_result ::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest.new(name: name, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_flow_validation_result({ name: name, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_flow_validation_result(::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest.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_flow_validation_result_client_stub.call_count - end - end - end - - def test_import_flow - # 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" - flow_uri = "hello world" - import_option = :IMPORT_OPTION_UNSPECIFIED - flow_import_strategy = {} - - import_flow_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Flows::Rest::ServiceStub.stub :transcode_import_flow_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_flow_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_flow({ parent: parent, flow_uri: flow_uri, import_option: import_option, flow_import_strategy: flow_import_strategy }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_flow parent: parent, flow_uri: flow_uri, import_option: import_option, flow_import_strategy: flow_import_strategy do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_flow ::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest.new(parent: parent, flow_uri: flow_uri, import_option: import_option, flow_import_strategy: flow_import_strategy) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_flow({ parent: parent, flow_uri: flow_uri, import_option: import_option, flow_import_strategy: flow_import_strategy }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_flow(::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest.new(parent: parent, flow_uri: flow_uri, import_option: import_option, flow_import_strategy: flow_import_strategy), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_flow_client_stub.call_count - end - end - end - - def test_export_flow - # 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" - flow_uri = "hello world" - include_referenced_flows = true - - export_flow_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Flows::Rest::ServiceStub.stub :transcode_export_flow_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, export_flow_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.export_flow({ name: name, flow_uri: flow_uri, include_referenced_flows: include_referenced_flows }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.export_flow name: name, flow_uri: flow_uri, include_referenced_flows: include_referenced_flows do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.export_flow ::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest.new(name: name, flow_uri: flow_uri, include_referenced_flows: include_referenced_flows) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.export_flow({ name: name, flow_uri: flow_uri, include_referenced_flows: include_referenced_flows }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.export_flow(::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest.new(name: name, flow_uri: flow_uri, include_referenced_flows: include_referenced_flows), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, export_flow_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::CX::V3::Flows::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::CX::V3::Flows::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_test.rb deleted file mode 100644 index 964b1a547032..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_test.rb +++ /dev/null @@ -1,751 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/flow_pb" -require "google/cloud/dialogflow/cx/v3/flows" - -class ::Google::Cloud::Dialogflow::CX::V3::Flows::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_flow - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Flow.new - grpc_operation = GRPC::ActiveCall::Operation.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" - flow = {} - language_code = "hello world" - - create_flow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_flow, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Flow), request["flow"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_flow_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_flow({ parent: parent, flow: flow, language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_flow parent: parent, flow: flow, language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_flow ::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest.new(parent: parent, flow: flow, language_code: language_code) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_flow({ parent: parent, flow: flow, 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 - client.create_flow(::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest.new(parent: parent, flow: flow, 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_flow_client_stub.call_rpc_count - end - end - - def test_delete_flow - # 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_flow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_flow, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_flow_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_flow({ name: name, force: force }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_flow name: name, force: force do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_flow ::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest.new(name: name, force: force) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_flow({ 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 - client.delete_flow(::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest.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_flow_client_stub.call_rpc_count - end - end - - def test_list_flows - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListFlowsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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" - language_code = "hello world" - - list_flows_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_flows, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest, 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["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_flows_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_flows({ parent: parent, page_size: page_size, page_token: page_token, language_code: language_code }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_flows parent: parent, page_size: page_size, page_token: page_token, language_code: language_code do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_flows ::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest.new(parent: parent, page_size: page_size, page_token: page_token, language_code: language_code) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_flows({ parent: parent, page_size: page_size, page_token: page_token, language_code: language_code }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_flows(::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest.new(parent: parent, page_size: page_size, page_token: page_token, language_code: language_code), 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_flows_client_stub.call_rpc_count - end - end - - def test_get_flow - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Flow.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_flow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_flow, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_flow_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_flow({ name: name, language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_flow name: name, language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_flow ::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest.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 - client.get_flow({ 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 - client.get_flow(::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest.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_flow_client_stub.call_rpc_count - end - end - - def test_update_flow - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Flow.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - flow = {} - update_mask = {} - language_code = "hello world" - - update_flow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_flow, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Flow), request["flow"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_flow_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_flow({ flow: flow, update_mask: update_mask, language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_flow flow: flow, update_mask: update_mask, language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_flow ::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest.new(flow: flow, update_mask: update_mask, language_code: language_code) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_flow({ flow: flow, update_mask: update_mask, 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 - client.update_flow(::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest.new(flow: flow, update_mask: update_mask, 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, update_flow_client_stub.call_rpc_count - end - end - - def test_train_flow - # 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" - - train_flow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :train_flow, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, train_flow_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.train_flow({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.train_flow name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.train_flow ::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.train_flow({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.train_flow(::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest.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, train_flow_client_stub.call_rpc_count - end - end - - def test_validate_flow - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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" - - validate_flow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :validate_flow, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, validate_flow_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.validate_flow({ name: name, language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.validate_flow name: name, language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.validate_flow ::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest.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 - client.validate_flow({ 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 - client.validate_flow(::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest.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, validate_flow_client_stub.call_rpc_count - end - end - - def test_get_flow_validation_result - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_flow_validation_result_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_flow_validation_result, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_flow_validation_result_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_flow_validation_result({ name: name, language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_flow_validation_result name: name, language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_flow_validation_result ::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest.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 - client.get_flow_validation_result({ 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 - client.get_flow_validation_result(::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest.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_flow_validation_result_client_stub.call_rpc_count - end - end - - def test_import_flow - # 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" - flow_uri = "hello world" - import_option = :IMPORT_OPTION_UNSPECIFIED - flow_import_strategy = {} - - import_flow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_flow, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["flow_uri"] - assert_equal :flow_uri, request.flow - assert_equal :IMPORT_OPTION_UNSPECIFIED, request["import_option"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::FlowImportStrategy), request["flow_import_strategy"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_flow_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_flow({ parent: parent, flow_uri: flow_uri, import_option: import_option, flow_import_strategy: flow_import_strategy }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.import_flow parent: parent, flow_uri: flow_uri, import_option: import_option, flow_import_strategy: flow_import_strategy do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.import_flow ::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest.new(parent: parent, flow_uri: flow_uri, import_option: import_option, flow_import_strategy: flow_import_strategy) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.import_flow({ parent: parent, flow_uri: flow_uri, import_option: import_option, flow_import_strategy: flow_import_strategy }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.import_flow(::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest.new(parent: parent, flow_uri: flow_uri, import_option: import_option, flow_import_strategy: flow_import_strategy), 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_flow_client_stub.call_rpc_count - end - end - - def test_export_flow - # 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" - flow_uri = "hello world" - include_referenced_flows = true - - export_flow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :export_flow, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["flow_uri"] - assert_equal true, request["include_referenced_flows"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, export_flow_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.export_flow({ name: name, flow_uri: flow_uri, include_referenced_flows: include_referenced_flows }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.export_flow name: name, flow_uri: flow_uri, include_referenced_flows: include_referenced_flows do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.export_flow ::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest.new(name: name, flow_uri: flow_uri, include_referenced_flows: include_referenced_flows) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.export_flow({ name: name, flow_uri: flow_uri, include_referenced_flows: include_referenced_flows }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.export_flow(::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest.new(name: name, flow_uri: flow_uri, include_referenced_flows: include_referenced_flows), 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_flow_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::CX::V3::Flows::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::CX::V3::Flows::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::CX::V3::Flows::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Flows::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::CX::V3::Flows::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Flows::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_paths_test.rb deleted file mode 100644 index 8e20a34e9d12..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_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/cx/v3/generators" - -class ::Google::Cloud::Dialogflow::CX::V3::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_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::CX::V3::Generators::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.agent_path project: "value0", location: "value1", agent: "value2" - assert_equal "projects/value0/locations/value1/agents/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::CX::V3::Generators::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.generator_path project: "value0", location: "value1", agent: "value2", generator: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/generators/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_rest_test.rb deleted file mode 100644 index f72fe54fbe3e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_rest_test.rb +++ /dev/null @@ -1,378 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/dialogflow/cx/v3/generator_pb" -require "google/cloud/dialogflow/cx/v3/generators/rest" - - -class ::Google::Cloud::Dialogflow::CX::V3::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_list_generators - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsResponse.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_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::CX::V3::Generators::Rest::ServiceStub.stub :transcode_list_generators_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_generators_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_generators({ 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 - client.list_generators 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 - client.list_generators ::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsRequest.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 - client.list_generators({ 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 - client.list_generators(::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsRequest.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_generators_client_stub.call_count - end - end - end - - def test_get_generator - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Generator.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_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::CX::V3::Generators::Rest::ServiceStub.stub :transcode_get_generator_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_generator_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_generator({ name: name, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_generator name: name, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_generator ::Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest.new(name: name, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_generator({ name: name, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_generator(::Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest.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_generator_client_stub.call_count - end - end - end - - def test_create_generator - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Generator.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - generator = {} - language_code = "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::CX::V3::Generators::Rest::ServiceStub.stub :transcode_create_generator_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_generator_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_generator({ parent: parent, generator: generator, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_generator parent: parent, generator: generator, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_generator ::Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest.new(parent: parent, generator: generator, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_generator({ parent: parent, generator: generator, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_generator(::Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest.new(parent: parent, generator: generator, language_code: language_code), 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_update_generator - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Generator.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - generator = {} - language_code = "hello world" - 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::CX::V3::Generators::Rest::ServiceStub.stub :transcode_update_generator_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_generator_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_generator({ generator: generator, language_code: language_code, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_generator generator: generator, language_code: language_code, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_generator ::Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest.new(generator: generator, language_code: language_code, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_generator({ generator: generator, 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 - client.update_generator(::Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest.new(generator: generator, 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_generator_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" - force = true - - 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::CX::V3::Generators::Rest::ServiceStub.stub :transcode_delete_generator_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_generator_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_generator({ name: name, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_generator name: name, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_generator ::Google::Cloud::Dialogflow::CX::V3::DeleteGeneratorRequest.new(name: name, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_generator({ name: name, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_generator(::Google::Cloud::Dialogflow::CX::V3::DeleteGeneratorRequest.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_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::CX::V3::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::CX::V3::Generators::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_test.rb deleted file mode 100644 index b341ddc20e28..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_test.rb +++ /dev/null @@ -1,417 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/generator_pb" -require "google/cloud/dialogflow/cx/v3/generators" - -class ::Google::Cloud::Dialogflow::CX::V3::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_list_generators - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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" - language_code = "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::CX::V3::ListGeneratorsRequest, 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_generators_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_generators({ 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 - client.list_generators 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 - client.list_generators ::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsRequest.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 - client.list_generators({ 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 - client.list_generators(::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsRequest.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_generators_client_stub.call_rpc_count - end - end - - def test_get_generator - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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" - language_code = "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::CX::V3::GetGeneratorRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_generator_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_generator({ name: name, language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_generator name: name, language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_generator ::Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest.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 - client.get_generator({ 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 - client.get_generator(::Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest.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_generator_client_stub.call_rpc_count - end - end - - def test_create_generator - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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 = {} - language_code = "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::CX::V3::CreateGeneratorRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Generator), request["generator"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_generator_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_generator({ parent: parent, generator: generator, language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_generator parent: parent, generator: generator, language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_generator ::Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest.new(parent: parent, generator: generator, language_code: language_code) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_generator({ parent: parent, generator: generator, 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 - client.create_generator(::Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest.new(parent: parent, generator: generator, 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_generator_client_stub.call_rpc_count - end - end - - def test_update_generator - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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 = {} - language_code = "hello world" - 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::CX::V3::UpdateGeneratorRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Generator), request["generator"] - 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_generator_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_generator({ generator: generator, 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 - client.update_generator generator: generator, 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 - client.update_generator ::Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest.new(generator: generator, 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 - client.update_generator({ generator: generator, 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 - client.update_generator(::Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest.new(generator: generator, 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_generator_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" - force = true - - 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::CX::V3::DeleteGeneratorRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_generator_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_generator({ name: name, force: force }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_generator name: name, force: force do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_generator ::Google::Cloud::Dialogflow::CX::V3::DeleteGeneratorRequest.new(name: name, force: force) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_generator({ 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 - client.delete_generator(::Google::Cloud::Dialogflow::CX::V3::DeleteGeneratorRequest.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_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::CX::V3::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::CX::V3::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::CX::V3::Generators::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Generators::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_operations_test.rb deleted file mode 100644 index 5f46f9cb2c65..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/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/cx/v3/intent_pb" -require "google/cloud/dialogflow/cx/v3/intent_services_pb" -require "google/cloud/dialogflow/cx/v3/intents" - -class ::Google::Cloud::Dialogflow::CX::V3::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 - client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Intents::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_paths_test.rb deleted file mode 100644 index a6e65114668f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_paths_test.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/intents" - -class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Intents::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.agent_path project: "value0", location: "value1", agent: "value2" - assert_equal "projects/value0/locations/value1/agents/value2", 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::CX::V3::Intents::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.entity_type_path project: "value0", location: "value1", agent: "value2", entity_type: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/entityTypes/value3", 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::CX::V3::Intents::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.intent_path project: "value0", location: "value1", agent: "value2", intent: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/intents/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_rest_test.rb deleted file mode 100644 index dd1268ac557e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_rest_test.rb +++ /dev/null @@ -1,491 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/dialogflow/cx/v3/intent_pb" -require "google/cloud/dialogflow/cx/v3/intents/rest" - - -class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::Intents::Rest::ServiceStub.stub :transcode_list_intents_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_intents_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.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 - client.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 - client.list_intents ::Google::Cloud::Dialogflow::CX::V3::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 - client.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 - client.list_intents(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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" - - 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::CX::V3::Intents::Rest::ServiceStub.stub :transcode_get_intent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_intent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_intent({ name: name, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_intent name: name, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_intent ::Google::Cloud::Dialogflow::CX::V3::GetIntentRequest.new(name: name, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_intent({ name: name, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_intent(::Google::Cloud::Dialogflow::CX::V3::GetIntentRequest.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_intent_client_stub.call_count - end - end - end - - def test_create_intent - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::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" - - 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::CX::V3::Intents::Rest::ServiceStub.stub :transcode_create_intent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_intent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_intent({ parent: parent, intent: intent, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_intent parent: parent, intent: intent, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_intent ::Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest.new(parent: parent, intent: intent, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_intent({ parent: parent, intent: intent, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_intent(::Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest.new(parent: parent, intent: intent, language_code: language_code), 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::CX::V3::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 = {} - - 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::CX::V3::Intents::Rest::ServiceStub.stub :transcode_update_intent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_intent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_intent({ intent: intent, language_code: language_code, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_intent intent: intent, language_code: language_code, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_intent ::Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest.new(intent: intent, language_code: language_code, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_intent({ intent: intent, 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 - client.update_intent(::Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest.new(intent: intent, 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_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::CX::V3::Intents::Rest::ServiceStub.stub :transcode_delete_intent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_intent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_intent({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_intent name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_intent ::Google::Cloud::Dialogflow::CX::V3::DeleteIntentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_intent({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_intent(::Google::Cloud::Dialogflow::CX::V3::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_import_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_uri = "hello world" - merge_option = :MERGE_OPTION_UNSPECIFIED - - import_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::CX::V3::Intents::Rest::ServiceStub.stub :transcode_import_intents_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_intents_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_intents({ parent: parent, intents_uri: intents_uri, merge_option: merge_option }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_intents parent: parent, intents_uri: intents_uri, merge_option: merge_option do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_intents ::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest.new(parent: parent, intents_uri: intents_uri, merge_option: merge_option) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_intents({ parent: parent, intents_uri: intents_uri, merge_option: merge_option }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_intents(::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest.new(parent: parent, intents_uri: intents_uri, merge_option: merge_option), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_intents_client_stub.call_count - end - end - end - - def test_export_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 = ["hello world"] - intents_uri = "hello world" - data_format = :DATA_FORMAT_UNSPECIFIED - - export_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::CX::V3::Intents::Rest::ServiceStub.stub :transcode_export_intents_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, export_intents_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.export_intents({ parent: parent, intents: intents, intents_uri: intents_uri, data_format: data_format }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.export_intents parent: parent, intents: intents, intents_uri: intents_uri, data_format: data_format do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.export_intents ::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest.new(parent: parent, intents: intents, intents_uri: intents_uri, data_format: data_format) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.export_intents({ parent: parent, intents: intents, intents_uri: intents_uri, data_format: data_format }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.export_intents(::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest.new(parent: parent, intents: intents, intents_uri: intents_uri, data_format: data_format), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, export_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::CX::V3::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::CX::V3::Intents::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_test.rb deleted file mode 100644 index fe39e65efc7f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_test.rb +++ /dev/null @@ -1,569 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/intent_pb" -require "google/cloud/dialogflow/cx/v3/intents" - -class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 - client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.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 - client.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 - client.list_intents ::Google::Cloud::Dialogflow::CX::V3::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 - client.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 - client.list_intents(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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" - - 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::CX::V3::GetIntentRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_intent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_intent({ name: name, language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_intent name: name, language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_intent ::Google::Cloud::Dialogflow::CX::V3::GetIntentRequest.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 - client.get_intent({ 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 - client.get_intent(::Google::Cloud::Dialogflow::CX::V3::GetIntentRequest.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_intent_client_stub.call_rpc_count - end - end - - def test_create_intent - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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" - - 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::CX::V3::CreateIntentRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Intent), request["intent"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_intent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_intent({ parent: parent, intent: intent, language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_intent parent: parent, intent: intent, language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_intent ::Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest.new(parent: parent, intent: intent, language_code: language_code) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_intent({ parent: parent, intent: intent, 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 - client.create_intent(::Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest.new(parent: parent, intent: intent, 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_intent_client_stub.call_rpc_count - end - end - - def test_update_intent - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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 = {} - - 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::CX::V3::UpdateIntentRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Intent), request["intent"] - 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_intent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_intent({ intent: intent, 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 - client.update_intent intent: intent, 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 - client.update_intent ::Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest.new(intent: intent, 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 - client.update_intent({ intent: intent, 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 - client.update_intent(::Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest.new(intent: intent, 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_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::CX::V3::DeleteIntentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_intent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_intent({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_intent name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_intent ::Google::Cloud::Dialogflow::CX::V3::DeleteIntentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.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 - client.delete_intent(::Google::Cloud::Dialogflow::CX::V3::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_import_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_uri = "hello world" - merge_option = :MERGE_OPTION_UNSPECIFIED - - import_intents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_intents, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["intents_uri"] - assert_equal :intents_uri, request.intents - assert_equal :MERGE_OPTION_UNSPECIFIED, request["merge_option"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_intents_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_intents({ parent: parent, intents_uri: intents_uri, merge_option: merge_option }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.import_intents parent: parent, intents_uri: intents_uri, merge_option: merge_option do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.import_intents ::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest.new(parent: parent, intents_uri: intents_uri, merge_option: merge_option) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.import_intents({ parent: parent, intents_uri: intents_uri, merge_option: merge_option }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.import_intents(::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest.new(parent: parent, intents_uri: intents_uri, merge_option: merge_option), 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_intents_client_stub.call_rpc_count - end - end - - def test_export_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 = ["hello world"] - intents_uri = "hello world" - data_format = :DATA_FORMAT_UNSPECIFIED - - export_intents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :export_intents, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest, request - assert_equal "hello world", request["parent"] - assert_equal ["hello world"], request["intents"] - assert_equal "hello world", request["intents_uri"] - assert_equal :intents_uri, request.destination - assert_equal :DATA_FORMAT_UNSPECIFIED, request["data_format"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, export_intents_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.export_intents({ parent: parent, intents: intents, intents_uri: intents_uri, data_format: data_format }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.export_intents parent: parent, intents: intents, intents_uri: intents_uri, data_format: data_format do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.export_intents ::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest.new(parent: parent, intents: intents, intents_uri: intents_uri, data_format: data_format) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.export_intents({ parent: parent, intents: intents, intents_uri: intents_uri, data_format: data_format }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.export_intents(::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest.new(parent: parent, intents: intents, intents_uri: intents_uri, data_format: data_format), 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_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::CX::V3::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::CX::V3::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::CX::V3::Intents::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Intents::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Intents::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_paths_test.rb deleted file mode 100644 index 0d213594ae2a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_paths_test.rb +++ /dev/null @@ -1,154 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dialogflow/cx/v3/pages" - -class ::Google::Cloud::Dialogflow::CX::V3::Pages::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_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::CX::V3::Pages::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.entity_type_path project: "value0", location: "value1", agent: "value2", entity_type: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/entityTypes/value3", path - end - end - - def test_flow_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::CX::V3::Pages::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.flow_path project: "value0", location: "value1", agent: "value2", flow: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/flows/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::CX::V3::Pages::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.generator_path project: "value0", location: "value1", agent: "value2", generator: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/generators/value3", 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::CX::V3::Pages::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.intent_path project: "value0", location: "value1", agent: "value2", intent: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/intents/value3", path - end - end - - def test_page_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::CX::V3::Pages::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.page_path project: "value0", location: "value1", agent: "value2", flow: "value3", page: "value4" - assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/pages/value4", path - end - end - - def test_playbook_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::CX::V3::Pages::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.playbook_path project: "value0", location: "value1", agent: "value2", playbook: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/playbooks/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::CX::V3::Pages::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tool_path project: "value0", location: "value1", agent: "value2", tool: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/tools/value3", path - end - end - - def test_transition_route_group_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::CX::V3::Pages::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.transition_route_group_path project: "value0", location: "value1", agent: "value2", flow: "value3", transition_route_group: "value4" - assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/transitionRouteGroups/value4", path - - path = client.transition_route_group_path project: "value0", location: "value1", agent: "value2", transition_route_group: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/transitionRouteGroups/value3", path - end - end - - def test_webhook_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::CX::V3::Pages::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.webhook_path project: "value0", location: "value1", agent: "value2", webhook: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/webhooks/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_rest_test.rb deleted file mode 100644 index c0174b41d517..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_rest_test.rb +++ /dev/null @@ -1,378 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/dialogflow/cx/v3/page_pb" -require "google/cloud/dialogflow/cx/v3/pages/rest" - - -class ::Google::Cloud::Dialogflow::CX::V3::Pages::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_pages - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::ListPagesResponse.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_pages_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Pages::Rest::ServiceStub.stub :transcode_list_pages_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_pages_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_pages({ 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 - client.list_pages 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 - client.list_pages ::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest.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 - client.list_pages({ 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 - client.list_pages(::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest.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_pages_client_stub.call_count - end - end - end - - def test_get_page - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Page.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_page_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Pages::Rest::ServiceStub.stub :transcode_get_page_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_page_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_page({ name: name, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_page name: name, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_page ::Google::Cloud::Dialogflow::CX::V3::GetPageRequest.new(name: name, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_page({ name: name, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_page(::Google::Cloud::Dialogflow::CX::V3::GetPageRequest.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_page_client_stub.call_count - end - end - end - - def test_create_page - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Page.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page = {} - language_code = "hello world" - - create_page_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Pages::Rest::ServiceStub.stub :transcode_create_page_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_page_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_page({ parent: parent, page: page, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_page parent: parent, page: page, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_page ::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest.new(parent: parent, page: page, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_page({ parent: parent, page: page, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_page(::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest.new(parent: parent, page: page, language_code: language_code), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_page_client_stub.call_count - end - end - end - - def test_update_page - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Page.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - page = {} - language_code = "hello world" - update_mask = {} - - update_page_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Pages::Rest::ServiceStub.stub :transcode_update_page_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_page_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_page({ page: page, language_code: language_code, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_page page: page, language_code: language_code, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_page ::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest.new(page: page, language_code: language_code, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_page({ page: page, 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 - client.update_page(::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest.new(page: page, 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_page_client_stub.call_count - end - end - end - - def test_delete_page - # 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_page_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Pages::Rest::ServiceStub.stub :transcode_delete_page_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_page_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_page({ name: name, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_page name: name, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_page ::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest.new(name: name, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_page({ name: name, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_page(::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest.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_page_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::CX::V3::Pages::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::CX::V3::Pages::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_test.rb deleted file mode 100644 index 735b9697c228..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_test.rb +++ /dev/null @@ -1,417 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/page_pb" -require "google/cloud/dialogflow/cx/v3/pages" - -class ::Google::Cloud::Dialogflow::CX::V3::Pages::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_pages - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListPagesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_pages_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_pages, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest, 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_pages_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_pages({ 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 - client.list_pages 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 - client.list_pages ::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest.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 - client.list_pages({ 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 - client.list_pages(::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest.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_pages_client_stub.call_rpc_count - end - end - - def test_get_page - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Page.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_page_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_page, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetPageRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_page_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_page({ name: name, language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_page name: name, language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_page ::Google::Cloud::Dialogflow::CX::V3::GetPageRequest.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 - client.get_page({ 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 - client.get_page(::Google::Cloud::Dialogflow::CX::V3::GetPageRequest.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_page_client_stub.call_rpc_count - end - end - - def test_create_page - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Page.new - grpc_operation = GRPC::ActiveCall::Operation.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 = {} - language_code = "hello world" - - create_page_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_page, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Page), request["page"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_page_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_page({ parent: parent, page: page, language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_page parent: parent, page: page, language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_page ::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest.new(parent: parent, page: page, language_code: language_code) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_page({ parent: parent, page: page, 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 - client.create_page(::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest.new(parent: parent, page: page, 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_page_client_stub.call_rpc_count - end - end - - def test_update_page - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Page.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - page = {} - language_code = "hello world" - update_mask = {} - - update_page_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_page, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Page), request["page"] - 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_page_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_page({ page: page, 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 - client.update_page page: page, 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 - client.update_page ::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest.new(page: page, 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 - client.update_page({ page: page, 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 - client.update_page(::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest.new(page: page, 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_page_client_stub.call_rpc_count - end - end - - def test_delete_page - # 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_page_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_page, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_page_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_page({ name: name, force: force }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_page name: name, force: force do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_page ::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest.new(name: name, force: force) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_page({ 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 - client.delete_page(::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest.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_page_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::CX::V3::Pages::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::CX::V3::Pages::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::CX::V3::Pages::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Pages::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_paths_test.rb deleted file mode 100644 index aa904f3a8c23..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_paths_test.rb +++ /dev/null @@ -1,97 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dialogflow/cx/v3/security_settings_service" - -class ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::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_deidentify_template_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::CX::V3::SecuritySettingsService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.deidentify_template_path organization: "value0", location: "value1", deidentify_template: "value2" - assert_equal "organizations/value0/locations/value1/deidentifyTemplates/value2", path - - path = client.deidentify_template_path project: "value0", location: "value1", deidentify_template: "value2" - assert_equal "projects/value0/locations/value1/deidentifyTemplates/value2", path - end - end - - def test_inspect_template_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::CX::V3::SecuritySettingsService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.inspect_template_path organization: "value0", location: "value1", inspect_template: "value2" - assert_equal "organizations/value0/locations/value1/inspectTemplates/value2", path - - path = client.inspect_template_path project: "value0", location: "value1", inspect_template: "value2" - assert_equal "projects/value0/locations/value1/inspectTemplates/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::CX::V3::SecuritySettingsService::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_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::CX::V3::SecuritySettingsService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.security_settings_path project: "value0", location: "value1", security_settings: "value2" - assert_equal "projects/value0/locations/value1/securitySettings/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_rest_test.rb deleted file mode 100644 index f0979a176e23..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_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/cx/v3/security_settings_pb" -require "google/cloud/dialogflow/cx/v3/security_settings_service/rest" - - -class ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::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_security_settings - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - security_settings = {} - - create_security_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::SecuritySettingsService::Rest::ServiceStub.stub :transcode_create_security_settings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_security_settings_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_security_settings({ parent: parent, security_settings: security_settings }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_security_settings parent: parent, security_settings: security_settings do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_security_settings ::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest.new(parent: parent, security_settings: security_settings) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_security_settings({ parent: parent, security_settings: security_settings }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_security_settings(::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest.new(parent: parent, security_settings: security_settings), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_security_settings_client_stub.call_count - end - end - end - - def test_get_security_settings - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_security_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::SecuritySettingsService::Rest::ServiceStub.stub :transcode_get_security_settings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_security_settings_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_security_settings({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_security_settings name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_security_settings ::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_security_settings({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_security_settings(::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_security_settings_client_stub.call_count - end - end - end - - def test_update_security_settings - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - security_settings = {} - update_mask = {} - - update_security_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::SecuritySettingsService::Rest::ServiceStub.stub :transcode_update_security_settings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_security_settings_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_security_settings({ security_settings: security_settings, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_security_settings security_settings: security_settings, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_security_settings ::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest.new(security_settings: security_settings, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_security_settings({ security_settings: security_settings, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_security_settings(::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest.new(security_settings: security_settings, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_security_settings_client_stub.call_count - end - end - end - - def test_list_security_settings - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsResponse.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_security_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::SecuritySettingsService::Rest::ServiceStub.stub :transcode_list_security_settings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_security_settings_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_security_settings({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_security_settings parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_security_settings ::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_security_settings({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_security_settings(::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest.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_security_settings_client_stub.call_count - end - end - end - - def test_delete_security_settings - # 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_security_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::SecuritySettingsService::Rest::ServiceStub.stub :transcode_delete_security_settings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_security_settings_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_security_settings({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_security_settings name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_security_settings ::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_security_settings({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_security_settings(::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_security_settings_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::CX::V3::SecuritySettingsService::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::CX::V3::SecuritySettingsService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_test.rb deleted file mode 100644 index 23082a638ec0..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_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/cx/v3/security_settings_pb" -require "google/cloud/dialogflow/cx/v3/security_settings_service" - -class ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::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_security_settings - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings.new - grpc_operation = GRPC::ActiveCall::Operation.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" - security_settings = {} - - create_security_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_security_settings, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings), request["security_settings"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_security_settings_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_security_settings({ parent: parent, security_settings: security_settings }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_security_settings parent: parent, security_settings: security_settings do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_security_settings ::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest.new(parent: parent, security_settings: security_settings) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_security_settings({ parent: parent, 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 - client.create_security_settings(::Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest.new(parent: parent, 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, create_security_settings_client_stub.call_rpc_count - end - end - - def test_get_security_settings - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_security_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_security_settings, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_security_settings_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_security_settings({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_security_settings name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_security_settings ::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_security_settings({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_security_settings(::Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest.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_security_settings_client_stub.call_rpc_count - end - end - - def test_update_security_settings - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - security_settings = {} - update_mask = {} - - update_security_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_security_settings, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings), request["security_settings"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_security_settings_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_security_settings({ security_settings: security_settings, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_security_settings security_settings: security_settings, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_security_settings ::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest.new(security_settings: security_settings, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_security_settings({ security_settings: security_settings, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_security_settings(::Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest.new(security_settings: security_settings, 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_security_settings_client_stub.call_rpc_count - end - end - - def test_list_security_settings - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_security_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_security_settings, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest, 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_security_settings_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_security_settings({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_security_settings parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_security_settings ::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_security_settings({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_security_settings(::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest.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_security_settings_client_stub.call_rpc_count - end - end - - def test_delete_security_settings - # 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_security_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_security_settings, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_security_settings_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_security_settings({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_security_settings name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_security_settings ::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_security_settings({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_security_settings(::Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest.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_security_settings_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::CX::V3::SecuritySettingsService::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::CX::V3::SecuritySettingsService::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::CX::V3::SecuritySettingsService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_paths_test.rb deleted file mode 100644 index 776f37f37876..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_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/cx/v3/session_entity_types" - -class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::SessionEntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.session_path project: "value0", location: "value1", agent: "value2", session: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/sessions/value3", path - - path = client.session_path project: "value0", location: "value1", agent: "value2", environment: "value3", session: "value4" - assert_equal "projects/value0/locations/value1/agents/value2/environments/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::CX::V3::SessionEntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.session_entity_type_path project: "value0", location: "value1", agent: "value2", session: "value3", entity_type: "value4" - assert_equal "projects/value0/locations/value1/agents/value2/sessions/value3/entityTypes/value4", path - - path = client.session_entity_type_path project: "value0", location: "value1", agent: "value2", environment: "value3", session: "value4", entity_type: "value5" - assert_equal "projects/value0/locations/value1/agents/value2/environments/value3/sessions/value4/entityTypes/value5", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_rest_test.rb deleted file mode 100644 index a6d8e6ae5cca..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/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/cx/v3/session_entity_type_pb" -require "google/cloud/dialogflow/cx/v3/session_entity_types/rest" - - -class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 - client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.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 - client.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 - client.list_session_entity_types ::Google::Cloud::Dialogflow::CX::V3::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 - client.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 - client.list_session_entity_types(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 - client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_session_entity_type({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_session_entity_type name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_session_entity_type ::Google::Cloud::Dialogflow::CX::V3::GetSessionEntityTypeRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_session_entity_type({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_session_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 - client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.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 - client.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 - client.create_session_entity_type ::Google::Cloud::Dialogflow::CX::V3::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 - client.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 - client.create_session_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 - client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.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 - client.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 - client.update_session_entity_type ::Google::Cloud::Dialogflow::CX::V3::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 - client.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 - client.update_session_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 - client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_session_entity_type({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_session_entity_type name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_session_entity_type ::Google::Cloud::Dialogflow::CX::V3::DeleteSessionEntityTypeRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_session_entity_type({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_session_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::SessionEntityTypes::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_test.rb deleted file mode 100644 index 3104391ae51e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/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/cx/v3/session_entity_type_pb" -require "google/cloud/dialogflow/cx/v3/session_entity_types" - -class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 - client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.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 - client.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 - client.list_session_entity_types ::Google::Cloud::Dialogflow::CX::V3::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 - client.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 - client.list_session_entity_types(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 - client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_session_entity_type({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_session_entity_type name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_session_entity_type ::Google::Cloud::Dialogflow::CX::V3::GetSessionEntityTypeRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.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 - client.get_session_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::CreateSessionEntityTypeRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::SessionEntityType), request["session_entity_type"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_session_entity_type_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.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 - client.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 - client.create_session_entity_type ::Google::Cloud::Dialogflow::CX::V3::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 - client.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 - client.create_session_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::UpdateSessionEntityTypeRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::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 - client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.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 - client.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 - client.update_session_entity_type ::Google::Cloud::Dialogflow::CX::V3::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 - client.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 - client.update_session_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 - client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_session_entity_type({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_session_entity_type name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_session_entity_type ::Google::Cloud::Dialogflow::CX::V3::DeleteSessionEntityTypeRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_session_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 - client.delete_session_entity_type(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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::CX::V3::SessionEntityTypes::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_paths_test.rb deleted file mode 100644 index d053c221f0ad..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_paths_test.rb +++ /dev/null @@ -1,160 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/sessions" - -class ::Google::Cloud::Dialogflow::CX::V3::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_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::CX::V3::Sessions::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.data_store_path project: "value0", location: "value1", data_store: "value2" - assert_equal "projects/value0/locations/value1/dataStores/value2", path - - path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path - end - end - - def test_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::CX::V3::Sessions::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.entity_type_path project: "value0", location: "value1", agent: "value2", entity_type: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/entityTypes/value3", 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::CX::V3::Sessions::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.intent_path project: "value0", location: "value1", agent: "value2", intent: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/intents/value3", path - end - end - - def test_page_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::CX::V3::Sessions::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.page_path project: "value0", location: "value1", agent: "value2", flow: "value3", page: "value4" - assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/pages/value4", path - end - end - - def test_playbook_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::CX::V3::Sessions::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.playbook_path project: "value0", location: "value1", agent: "value2", playbook: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/playbooks/value3", path - end - end - - def test_session_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.session_path project: "value0", location: "value1", agent: "value2", session: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/sessions/value3", path - - path = client.session_path project: "value0", location: "value1", agent: "value2", environment: "value3", session: "value4" - assert_equal "projects/value0/locations/value1/agents/value2/environments/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::CX::V3::Sessions::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.session_entity_type_path project: "value0", location: "value1", agent: "value2", session: "value3", entity_type: "value4" - assert_equal "projects/value0/locations/value1/agents/value2/sessions/value3/entityTypes/value4", path - - path = client.session_entity_type_path project: "value0", location: "value1", agent: "value2", environment: "value3", session: "value4", entity_type: "value5" - assert_equal "projects/value0/locations/value1/agents/value2/environments/value3/sessions/value4/entityTypes/value5", 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::CX::V3::Sessions::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tool_path project: "value0", location: "value1", agent: "value2", tool: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/tools/value3", 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::CX::V3::Sessions::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.version_path project: "value0", location: "value1", agent: "value2", flow: "value3", version: "value4" - assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/versions/value4", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_rest_test.rb deleted file mode 100644 index e3fae9be0f2a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_rest_test.rb +++ /dev/null @@ -1,385 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/session_pb" -require "google/cloud/dialogflow/cx/v3/sessions/rest" - - -class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 = {} - response_view = :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED - - 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::CX::V3::Sessions::Rest::ServiceStub.stub :transcode_detect_intent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, detect_intent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.detect_intent session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.detect_intent ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.detect_intent(::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view), 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_server_streaming_detect_intent - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::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 = {} - response_view = :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED - - server_streaming_detect_intent_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, is_server_streaming:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::ServiceStub.stub :transcode_server_streaming_detect_intent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, server_streaming_detect_intent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.server_streaming_detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use named arguments - client.server_streaming_detect_intent session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use protobuf object - client.server_streaming_detect_intent ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use hash object with options - client.server_streaming_detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use protobuf object with options - client.server_streaming_detect_intent(::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Verify method calls - assert_equal 5, server_streaming_detect_intent_client_stub.call_count - end - end - end - - def test_match_intent - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse.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 = {} - persist_parameter_changes = true - - match_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::CX::V3::Sessions::Rest::ServiceStub.stub :transcode_match_intent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, match_intent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.match_intent({ session: session, query_params: query_params, query_input: query_input, persist_parameter_changes: persist_parameter_changes }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.match_intent session: session, query_params: query_params, query_input: query_input, persist_parameter_changes: persist_parameter_changes do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.match_intent ::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest.new(session: session, query_params: query_params, query_input: query_input, persist_parameter_changes: persist_parameter_changes) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.match_intent({ session: session, query_params: query_params, query_input: query_input, persist_parameter_changes: persist_parameter_changes }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.match_intent(::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest.new(session: session, query_params: query_params, query_input: query_input, persist_parameter_changes: persist_parameter_changes), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, match_intent_client_stub.call_count - end - end - end - - def test_fulfill_intent - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - match_intent_request = {} - match = {} - output_audio_config = {} - - fulfill_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::CX::V3::Sessions::Rest::ServiceStub.stub :transcode_fulfill_intent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, fulfill_intent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.fulfill_intent({ match_intent_request: match_intent_request, match: match, output_audio_config: output_audio_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.fulfill_intent match_intent_request: match_intent_request, match: match, output_audio_config: output_audio_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.fulfill_intent ::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest.new(match_intent_request: match_intent_request, match: match, output_audio_config: output_audio_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.fulfill_intent({ match_intent_request: match_intent_request, match: match, output_audio_config: output_audio_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.fulfill_intent(::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest.new(match_intent_request: match_intent_request, match: match, output_audio_config: output_audio_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, fulfill_intent_client_stub.call_count - end - end - end - - def test_submit_answer_feedback - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - session = "hello world" - response_id = "hello world" - answer_feedback = {} - update_mask = {} - - submit_answer_feedback_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Sessions::Rest::ServiceStub.stub :transcode_submit_answer_feedback_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, submit_answer_feedback_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.submit_answer_feedback({ session: session, response_id: response_id, answer_feedback: answer_feedback, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.submit_answer_feedback session: session, response_id: response_id, answer_feedback: answer_feedback, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.submit_answer_feedback ::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest.new(session: session, response_id: response_id, answer_feedback: answer_feedback, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.submit_answer_feedback({ session: session, response_id: response_id, answer_feedback: answer_feedback, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.submit_answer_feedback(::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest.new(session: session, response_id: response_id, answer_feedback: answer_feedback, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, submit_answer_feedback_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::CX::V3::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::CX::V3::Sessions::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_test.rb deleted file mode 100644 index 8a960b6dec3c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_test.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! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dialogflow/cx/v3/session_pb" -require "google/cloud/dialogflow/cx/v3/sessions" - -class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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 = {} - response_view = :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED - - 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::CX::V3::DetectIntentRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::QueryParameters), request["query_params"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::QueryInput), request["query_input"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig), request["output_audio_config"] - assert_equal :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED, request["response_view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, detect_intent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.detect_intent session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.detect_intent ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.detect_intent(::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view), 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_server_streaming_detect_intent - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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 server streaming method. - session = "hello world" - query_params = {} - query_input = {} - output_audio_config = {} - response_view = :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED - - server_streaming_detect_intent_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :server_streaming_detect_intent, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::QueryParameters), request["query_params"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::QueryInput), request["query_input"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig), request["output_audio_config"] - assert_equal :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED, request["response_view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, server_streaming_detect_intent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.server_streaming_detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse, r - end - assert_equal grpc_operation, operation - end - - # Use named arguments - client.server_streaming_detect_intent session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.server_streaming_detect_intent ::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse, r - end - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.server_streaming_detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view }, grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.server_streaming_detect_intent(::Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, response_view: response_view), grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse, r - end - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, server_streaming_detect_intent_client_stub.call_rpc_count - end - end - - def test_streaming_detect_intent - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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 = {} - output_audio_config = {} - enable_partial_response = true - enable_debugging_info = true - response_view = :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED - - 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 - client = ::Google::Cloud::Dialogflow::CX::V3::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, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view } - request_proto = ::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view - enum_input = [request_hash, request_proto].to_enum - client.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::CX::V3::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, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view } - request_proto = ::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view - stream_input = Gapic::StreamInput.new - client.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::CX::V3::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, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view } - request_proto = ::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view - enum_input = [request_hash, request_proto].to_enum - client.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::CX::V3::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, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view } - request_proto = ::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, enable_partial_response: enable_partial_response, enable_debugging_info: enable_debugging_info, response_view: response_view - stream_input = Gapic::StreamInput.new - client.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::CX::V3::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::CX::V3::StreamingDetectIntentRequest, r - assert_equal "hello world", r["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::QueryParameters), r["query_params"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::QueryInput), r["query_input"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig), r["output_audio_config"] - assert_equal true, r["enable_partial_response"] - assert_equal true, r["enable_debugging_info"] - assert_equal :DETECT_INTENT_RESPONSE_VIEW_UNSPECIFIED, r["response_view"] - end - end - end - end - - def test_match_intent - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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 = {} - persist_parameter_changes = true - - match_intent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :match_intent, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::QueryParameters), request["query_params"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::QueryInput), request["query_input"] - assert_equal true, request["persist_parameter_changes"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, match_intent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.match_intent({ session: session, query_params: query_params, query_input: query_input, persist_parameter_changes: persist_parameter_changes }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.match_intent session: session, query_params: query_params, query_input: query_input, persist_parameter_changes: persist_parameter_changes do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.match_intent ::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest.new(session: session, query_params: query_params, query_input: query_input, persist_parameter_changes: persist_parameter_changes) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.match_intent({ session: session, query_params: query_params, query_input: query_input, persist_parameter_changes: persist_parameter_changes }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.match_intent(::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest.new(session: session, query_params: query_params, query_input: query_input, persist_parameter_changes: persist_parameter_changes), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, match_intent_client_stub.call_rpc_count - end - end - - def test_fulfill_intent - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - match_intent_request = {} - match = {} - output_audio_config = {} - - fulfill_intent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :fulfill_intent, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest), request["match_intent_request"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Match), request["match"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::OutputAudioConfig), request["output_audio_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, fulfill_intent_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.fulfill_intent({ match_intent_request: match_intent_request, match: match, output_audio_config: output_audio_config }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.fulfill_intent match_intent_request: match_intent_request, match: match, output_audio_config: output_audio_config do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.fulfill_intent ::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest.new(match_intent_request: match_intent_request, match: match, output_audio_config: output_audio_config) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.fulfill_intent({ match_intent_request: match_intent_request, match: match, output_audio_config: output_audio_config }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.fulfill_intent(::Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest.new(match_intent_request: match_intent_request, match: match, output_audio_config: output_audio_config), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, fulfill_intent_client_stub.call_rpc_count - end - end - - def test_submit_answer_feedback - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback.new - grpc_operation = GRPC::ActiveCall::Operation.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" - response_id = "hello world" - answer_feedback = {} - update_mask = {} - - submit_answer_feedback_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :submit_answer_feedback, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest, request - assert_equal "hello world", request["session"] - assert_equal "hello world", request["response_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::AnswerFeedback), request["answer_feedback"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, submit_answer_feedback_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.submit_answer_feedback({ session: session, response_id: response_id, answer_feedback: answer_feedback, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.submit_answer_feedback session: session, response_id: response_id, answer_feedback: answer_feedback, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.submit_answer_feedback ::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest.new(session: session, response_id: response_id, answer_feedback: answer_feedback, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.submit_answer_feedback({ session: session, response_id: response_id, answer_feedback: answer_feedback, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.submit_answer_feedback(::Google::Cloud::Dialogflow::CX::V3::SubmitAnswerFeedbackRequest.new(session: session, response_id: response_id, answer_feedback: answer_feedback, 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, submit_answer_feedback_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::CX::V3::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::CX::V3::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::CX::V3::Sessions::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_operations_test.rb deleted file mode 100644 index e7c36e52bde3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_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/cx/v3/test_case_pb" -require "google/cloud/dialogflow/cx/v3/test_case_services_pb" -require "google/cloud/dialogflow/cx/v3/test_cases" - -class ::Google::Cloud::Dialogflow::CX::V3::TestCases::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::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::CX::V3::TestCases::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_paths_test.rb deleted file mode 100644 index 9ee606a95f37..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_paths_test.rb +++ /dev/null @@ -1,202 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/test_cases" - -class ::Google::Cloud::Dialogflow::CX::V3::TestCases::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::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.agent_path project: "value0", location: "value1", agent: "value2" - assert_equal "projects/value0/locations/value1/agents/value2", 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::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.entity_type_path project: "value0", location: "value1", agent: "value2", entity_type: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/entityTypes/value3", 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::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.environment_path project: "value0", location: "value1", agent: "value2", environment: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/environments/value3", path - end - end - - def test_flow_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::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.flow_path project: "value0", location: "value1", agent: "value2", flow: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/flows/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::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.generator_path project: "value0", location: "value1", agent: "value2", generator: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/generators/value3", 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::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.intent_path project: "value0", location: "value1", agent: "value2", intent: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/intents/value3", path - end - end - - def test_page_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::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.page_path project: "value0", location: "value1", agent: "value2", flow: "value3", page: "value4" - assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/pages/value4", path - end - end - - def test_playbook_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::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.playbook_path project: "value0", location: "value1", agent: "value2", playbook: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/playbooks/value3", path - end - end - - def test_test_case_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::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.test_case_path project: "value0", location: "value1", agent: "value2", test_case: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/testCases/value3", path - end - end - - def test_test_case_result_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::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.test_case_result_path project: "value0", location: "value1", agent: "value2", test_case: "value3", result: "value4" - assert_equal "projects/value0/locations/value1/agents/value2/testCases/value3/results/value4", 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::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tool_path project: "value0", location: "value1", agent: "value2", tool: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/tools/value3", path - end - end - - def test_transition_route_group_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::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.transition_route_group_path project: "value0", location: "value1", agent: "value2", flow: "value3", transition_route_group: "value4" - assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/transitionRouteGroups/value4", path - - path = client.transition_route_group_path project: "value0", location: "value1", agent: "value2", transition_route_group: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/transitionRouteGroups/value3", path - end - end - - def test_webhook_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::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.webhook_path project: "value0", location: "value1", agent: "value2", webhook: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/webhooks/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_rest_test.rb deleted file mode 100644 index 7ab4fb4beef7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_rest_test.rb +++ /dev/null @@ -1,764 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/test_case_pb" -require "google/cloud/dialogflow/cx/v3/test_cases/rest" - - -class ::Google::Cloud::Dialogflow::CX::V3::TestCases::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_test_cases - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::ListTestCasesResponse.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" - view = :TEST_CASE_VIEW_UNSPECIFIED - - list_test_cases_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_list_test_cases_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_test_cases_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_test_cases({ parent: parent, page_size: page_size, page_token: page_token, view: view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_test_cases parent: parent, page_size: page_size, page_token: page_token, view: view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_test_cases ::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_test_cases({ parent: parent, page_size: page_size, page_token: page_token, view: view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_test_cases(::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_test_cases_client_stub.call_count - end - end - end - - def test_batch_delete_test_cases - # 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" - names = ["hello world"] - - batch_delete_test_cases_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_batch_delete_test_cases_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_delete_test_cases_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_delete_test_cases({ parent: parent, names: names }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_delete_test_cases parent: parent, names: names do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_delete_test_cases ::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest.new(parent: parent, names: names) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_delete_test_cases({ parent: parent, names: names }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_delete_test_cases(::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest.new(parent: parent, names: names), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_delete_test_cases_client_stub.call_count - end - end - end - - def test_get_test_case - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::TestCase.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_test_case_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_get_test_case_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_test_case_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_test_case({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_test_case name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_test_case ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_test_case({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_test_case(::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_test_case_client_stub.call_count - end - end - end - - def test_create_test_case - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::TestCase.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - test_case = {} - - create_test_case_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_create_test_case_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_test_case_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_test_case({ parent: parent, test_case: test_case }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_test_case parent: parent, test_case: test_case do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_test_case ::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest.new(parent: parent, test_case: test_case) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_test_case({ parent: parent, test_case: test_case }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_test_case(::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest.new(parent: parent, test_case: test_case), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_test_case_client_stub.call_count - end - end - end - - def test_update_test_case - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::TestCase.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - test_case = {} - update_mask = {} - - update_test_case_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_update_test_case_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_test_case_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_test_case({ test_case: test_case, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_test_case test_case: test_case, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_test_case ::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest.new(test_case: test_case, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_test_case({ test_case: test_case, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_test_case(::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest.new(test_case: test_case, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_test_case_client_stub.call_count - end - end - end - - def test_run_test_case - # 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" - environment = "hello world" - - run_test_case_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_run_test_case_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, run_test_case_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.run_test_case({ name: name, environment: environment }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.run_test_case name: name, environment: environment do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.run_test_case ::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest.new(name: name, environment: environment) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.run_test_case({ name: name, environment: environment }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.run_test_case(::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest.new(name: name, environment: environment), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, run_test_case_client_stub.call_count - end - end - end - - def test_batch_run_test_cases - # 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" - environment = "hello world" - test_cases = ["hello world"] - - batch_run_test_cases_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_batch_run_test_cases_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_run_test_cases_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_run_test_cases({ parent: parent, environment: environment, test_cases: test_cases }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_run_test_cases parent: parent, environment: environment, test_cases: test_cases do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_run_test_cases ::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest.new(parent: parent, environment: environment, test_cases: test_cases) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_run_test_cases({ parent: parent, environment: environment, test_cases: test_cases }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_run_test_cases(::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest.new(parent: parent, environment: environment, test_cases: test_cases), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_run_test_cases_client_stub.call_count - end - end - end - - def test_calculate_coverage - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - agent = "hello world" - type = :COVERAGE_TYPE_UNSPECIFIED - - calculate_coverage_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_calculate_coverage_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, calculate_coverage_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.calculate_coverage({ agent: agent, type: type }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.calculate_coverage agent: agent, type: type do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.calculate_coverage ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest.new(agent: agent, type: type) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.calculate_coverage({ agent: agent, type: type }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.calculate_coverage(::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest.new(agent: agent, type: type), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, calculate_coverage_client_stub.call_count - end - end - end - - def test_import_test_cases - # 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_uri = "hello world" - - import_test_cases_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_import_test_cases_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_test_cases_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_test_cases({ parent: parent, gcs_uri: gcs_uri }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_test_cases parent: parent, gcs_uri: gcs_uri do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_test_cases ::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest.new(parent: parent, gcs_uri: gcs_uri) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_test_cases({ parent: parent, gcs_uri: gcs_uri }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_test_cases(::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest.new(parent: parent, gcs_uri: gcs_uri), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_test_cases_client_stub.call_count - end - end - end - - def test_export_test_cases - # 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_uri = "hello world" - data_format = :DATA_FORMAT_UNSPECIFIED - filter = "hello world" - - export_test_cases_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_export_test_cases_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, export_test_cases_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.export_test_cases({ parent: parent, gcs_uri: gcs_uri, data_format: data_format, filter: filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.export_test_cases parent: parent, gcs_uri: gcs_uri, data_format: data_format, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.export_test_cases ::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest.new(parent: parent, gcs_uri: gcs_uri, data_format: data_format, filter: filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.export_test_cases({ parent: parent, gcs_uri: gcs_uri, data_format: data_format, filter: filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.export_test_cases(::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest.new(parent: parent, gcs_uri: gcs_uri, data_format: data_format, filter: filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, export_test_cases_client_stub.call_count - end - end - end - - def test_list_test_case_results - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsResponse.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_test_case_results_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_list_test_case_results_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_test_case_results_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_test_case_results({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_test_case_results parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_test_case_results ::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_test_case_results({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_test_case_results(::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest.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_test_case_results_client_stub.call_count - end - end - end - - def test_get_test_case_result - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::TestCaseResult.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_test_case_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::CX::V3::TestCases::Rest::ServiceStub.stub :transcode_get_test_case_result_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_test_case_result_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_test_case_result({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_test_case_result name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_test_case_result ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_test_case_result({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_test_case_result(::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_test_case_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::CX::V3::TestCases::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::CX::V3::TestCases::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_test.rb deleted file mode 100644 index 2fbe45e67d18..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_test.rb +++ /dev/null @@ -1,880 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/test_case_pb" -require "google/cloud/dialogflow/cx/v3/test_cases" - -class ::Google::Cloud::Dialogflow::CX::V3::TestCases::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_test_cases - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListTestCasesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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" - view = :TEST_CASE_VIEW_UNSPECIFIED - - list_test_cases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_test_cases, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal :TEST_CASE_VIEW_UNSPECIFIED, request["view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_test_cases_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_test_cases({ parent: parent, page_size: page_size, page_token: page_token, view: view }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_test_cases parent: parent, page_size: page_size, page_token: page_token, view: view do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_test_cases ::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_test_cases({ parent: parent, page_size: page_size, page_token: page_token, view: view }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_test_cases(::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view), 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_test_cases_client_stub.call_rpc_count - end - end - - def test_batch_delete_test_cases - # 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" - names = ["hello world"] - - batch_delete_test_cases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_delete_test_cases, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest, request - assert_equal "hello world", request["parent"] - assert_equal ["hello world"], request["names"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_delete_test_cases_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_delete_test_cases({ parent: parent, names: names }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_delete_test_cases parent: parent, names: names do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_delete_test_cases ::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest.new(parent: parent, names: names) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_delete_test_cases({ parent: parent, names: names }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_delete_test_cases(::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest.new(parent: parent, names: names), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_delete_test_cases_client_stub.call_rpc_count - end - end - - def test_get_test_case - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::TestCase.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_test_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_test_case, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_test_case_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_test_case({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_test_case name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_test_case ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_test_case({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_test_case(::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest.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_test_case_client_stub.call_rpc_count - end - end - - def test_create_test_case - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::TestCase.new - grpc_operation = GRPC::ActiveCall::Operation.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" - test_case = {} - - create_test_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_test_case, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::TestCase), request["test_case"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_test_case_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_test_case({ parent: parent, test_case: test_case }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_test_case parent: parent, test_case: test_case do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_test_case ::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest.new(parent: parent, test_case: test_case) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_test_case({ parent: parent, test_case: test_case }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_test_case(::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest.new(parent: parent, test_case: test_case), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_test_case_client_stub.call_rpc_count - end - end - - def test_update_test_case - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::TestCase.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - test_case = {} - update_mask = {} - - update_test_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_test_case, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::TestCase), request["test_case"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_test_case_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_test_case({ test_case: test_case, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_test_case test_case: test_case, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_test_case ::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest.new(test_case: test_case, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_test_case({ test_case: test_case, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_test_case(::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest.new(test_case: test_case, 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_test_case_client_stub.call_rpc_count - end - end - - def test_run_test_case - # 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" - environment = "hello world" - - run_test_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :run_test_case, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["environment"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, run_test_case_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.run_test_case({ name: name, environment: environment }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.run_test_case name: name, environment: environment do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.run_test_case ::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest.new(name: name, environment: environment) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.run_test_case({ name: name, environment: environment }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.run_test_case(::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest.new(name: name, environment: environment), 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, run_test_case_client_stub.call_rpc_count - end - end - - def test_batch_run_test_cases - # 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" - environment = "hello world" - test_cases = ["hello world"] - - batch_run_test_cases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_run_test_cases, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["environment"] - assert_equal ["hello world"], request["test_cases"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_run_test_cases_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_run_test_cases({ parent: parent, environment: environment, test_cases: test_cases }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_run_test_cases parent: parent, environment: environment, test_cases: test_cases do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_run_test_cases ::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest.new(parent: parent, environment: environment, test_cases: test_cases) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_run_test_cases({ parent: parent, environment: environment, test_cases: test_cases }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_run_test_cases(::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest.new(parent: parent, environment: environment, test_cases: test_cases), 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_run_test_cases_client_stub.call_rpc_count - end - end - - def test_calculate_coverage - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" - type = :COVERAGE_TYPE_UNSPECIFIED - - calculate_coverage_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :calculate_coverage, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest, request - assert_equal "hello world", request["agent"] - assert_equal :COVERAGE_TYPE_UNSPECIFIED, request["type"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, calculate_coverage_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.calculate_coverage({ agent: agent, type: type }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.calculate_coverage agent: agent, type: type do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.calculate_coverage ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest.new(agent: agent, type: type) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.calculate_coverage({ agent: agent, type: type }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.calculate_coverage(::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest.new(agent: agent, type: type), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, calculate_coverage_client_stub.call_rpc_count - end - end - - def test_import_test_cases - # 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_uri = "hello world" - - import_test_cases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_test_cases, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["gcs_uri"] - assert_equal :gcs_uri, request.source - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_test_cases_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_test_cases({ parent: parent, gcs_uri: gcs_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 - client.import_test_cases parent: parent, gcs_uri: gcs_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 - client.import_test_cases ::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest.new(parent: parent, gcs_uri: gcs_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 - client.import_test_cases({ parent: parent, gcs_uri: gcs_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 - client.import_test_cases(::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest.new(parent: parent, gcs_uri: gcs_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_test_cases_client_stub.call_rpc_count - end - end - - def test_export_test_cases - # 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_uri = "hello world" - data_format = :DATA_FORMAT_UNSPECIFIED - filter = "hello world" - - export_test_cases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :export_test_cases, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["gcs_uri"] - assert_equal :gcs_uri, request.destination - assert_equal :DATA_FORMAT_UNSPECIFIED, request["data_format"] - assert_equal "hello world", request["filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, export_test_cases_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.export_test_cases({ parent: parent, gcs_uri: gcs_uri, data_format: data_format, filter: filter }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.export_test_cases parent: parent, gcs_uri: gcs_uri, data_format: data_format, filter: filter do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.export_test_cases ::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest.new(parent: parent, gcs_uri: gcs_uri, data_format: data_format, filter: filter) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.export_test_cases({ parent: parent, gcs_uri: gcs_uri, data_format: data_format, filter: filter }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.export_test_cases(::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest.new(parent: parent, gcs_uri: gcs_uri, data_format: data_format, filter: filter), 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_test_cases_client_stub.call_rpc_count - end - end - - def test_list_test_case_results - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_test_case_results_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_test_case_results, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest, 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_test_case_results_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_test_case_results({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_test_case_results parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_test_case_results ::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_test_case_results({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_test_case_results(::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest.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_test_case_results_client_stub.call_rpc_count - end - end - - def test_get_test_case_result - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::TestCaseResult.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_test_case_result_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_test_case_result, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_test_case_result_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_test_case_result({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_test_case_result name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_test_case_result ::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_test_case_result({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_test_case_result(::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest.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_test_case_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::CX::V3::TestCases::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::CX::V3::TestCases::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::CX::V3::TestCases::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::TestCases::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::CX::V3::TestCases::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::TestCases::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_paths_test.rb deleted file mode 100644 index 7017f577cace..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_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/cx/v3/transition_route_groups" - -class ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::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::CX::V3::TransitionRouteGroups::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.agent_path project: "value0", location: "value1", agent: "value2" - assert_equal "projects/value0/locations/value1/agents/value2", path - end - end - - def test_flow_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::CX::V3::TransitionRouteGroups::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.flow_path project: "value0", location: "value1", agent: "value2", flow: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/flows/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::CX::V3::TransitionRouteGroups::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.generator_path project: "value0", location: "value1", agent: "value2", generator: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/generators/value3", 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::CX::V3::TransitionRouteGroups::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.intent_path project: "value0", location: "value1", agent: "value2", intent: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/intents/value3", path - end - end - - def test_page_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::CX::V3::TransitionRouteGroups::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.page_path project: "value0", location: "value1", agent: "value2", flow: "value3", page: "value4" - assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/pages/value4", 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::CX::V3::TransitionRouteGroups::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tool_path project: "value0", location: "value1", agent: "value2", tool: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/tools/value3", path - end - end - - def test_transition_route_group_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::CX::V3::TransitionRouteGroups::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.transition_route_group_path project: "value0", location: "value1", agent: "value2", flow: "value3", transition_route_group: "value4" - assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/transitionRouteGroups/value4", path - - path = client.transition_route_group_path project: "value0", location: "value1", agent: "value2", transition_route_group: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/transitionRouteGroups/value3", path - end - end - - def test_webhook_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::CX::V3::TransitionRouteGroups::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.webhook_path project: "value0", location: "value1", agent: "value2", webhook: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/webhooks/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_rest_test.rb deleted file mode 100644 index d861c1a91df0..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_rest_test.rb +++ /dev/null @@ -1,378 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/dialogflow/cx/v3/transition_route_group_pb" -require "google/cloud/dialogflow/cx/v3/transition_route_groups/rest" - - -class ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::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_transition_route_groups - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsResponse.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" - language_code = "hello world" - - list_transition_route_groups_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::TransitionRouteGroups::Rest::ServiceStub.stub :transcode_list_transition_route_groups_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_transition_route_groups_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_transition_route_groups({ parent: parent, page_size: page_size, page_token: page_token, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_transition_route_groups parent: parent, page_size: page_size, page_token: page_token, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_transition_route_groups ::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest.new(parent: parent, page_size: page_size, page_token: page_token, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_transition_route_groups({ parent: parent, page_size: page_size, page_token: page_token, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_transition_route_groups(::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest.new(parent: parent, page_size: page_size, page_token: page_token, language_code: language_code), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_transition_route_groups_client_stub.call_count - end - end - end - - def test_get_transition_route_group - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.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_transition_route_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::TransitionRouteGroups::Rest::ServiceStub.stub :transcode_get_transition_route_group_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_transition_route_group_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_transition_route_group({ name: name, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_transition_route_group name: name, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_transition_route_group ::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest.new(name: name, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_transition_route_group({ name: name, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_transition_route_group(::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest.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_transition_route_group_client_stub.call_count - end - end - end - - def test_create_transition_route_group - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - transition_route_group = {} - language_code = "hello world" - - create_transition_route_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::TransitionRouteGroups::Rest::ServiceStub.stub :transcode_create_transition_route_group_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_transition_route_group_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_transition_route_group({ parent: parent, transition_route_group: transition_route_group, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_transition_route_group parent: parent, transition_route_group: transition_route_group, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_transition_route_group ::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest.new(parent: parent, transition_route_group: transition_route_group, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_transition_route_group({ parent: parent, transition_route_group: transition_route_group, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_transition_route_group(::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest.new(parent: parent, transition_route_group: transition_route_group, language_code: language_code), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_transition_route_group_client_stub.call_count - end - end - end - - def test_update_transition_route_group - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - transition_route_group = {} - update_mask = {} - language_code = "hello world" - - update_transition_route_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::TransitionRouteGroups::Rest::ServiceStub.stub :transcode_update_transition_route_group_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_transition_route_group_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_transition_route_group({ transition_route_group: transition_route_group, update_mask: update_mask, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_transition_route_group transition_route_group: transition_route_group, update_mask: update_mask, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_transition_route_group ::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest.new(transition_route_group: transition_route_group, update_mask: update_mask, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_transition_route_group({ transition_route_group: transition_route_group, update_mask: update_mask, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_transition_route_group(::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest.new(transition_route_group: transition_route_group, update_mask: update_mask, language_code: language_code), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_transition_route_group_client_stub.call_count - end - end - end - - def test_delete_transition_route_group - # 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_transition_route_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::TransitionRouteGroups::Rest::ServiceStub.stub :transcode_delete_transition_route_group_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_transition_route_group_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_transition_route_group({ name: name, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_transition_route_group name: name, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_transition_route_group ::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest.new(name: name, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_transition_route_group({ name: name, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_transition_route_group(::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest.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_transition_route_group_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::CX::V3::TransitionRouteGroups::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::CX::V3::TransitionRouteGroups::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_test.rb deleted file mode 100644 index 2ee5f6933c18..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_test.rb +++ /dev/null @@ -1,417 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/transition_route_group_pb" -require "google/cloud/dialogflow/cx/v3/transition_route_groups" - -class ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::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_transition_route_groups - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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" - language_code = "hello world" - - list_transition_route_groups_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_transition_route_groups, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest, 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["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_transition_route_groups_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_transition_route_groups({ parent: parent, page_size: page_size, page_token: page_token, language_code: language_code }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_transition_route_groups parent: parent, page_size: page_size, page_token: page_token, language_code: language_code do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_transition_route_groups ::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest.new(parent: parent, page_size: page_size, page_token: page_token, language_code: language_code) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_transition_route_groups({ parent: parent, page_size: page_size, page_token: page_token, language_code: language_code }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_transition_route_groups(::Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest.new(parent: parent, page_size: page_size, page_token: page_token, language_code: language_code), 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_transition_route_groups_client_stub.call_rpc_count - end - end - - def test_get_transition_route_group - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_transition_route_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_transition_route_group, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_transition_route_group_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_transition_route_group({ name: name, language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_transition_route_group name: name, language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_transition_route_group ::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest.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 - client.get_transition_route_group({ 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 - client.get_transition_route_group(::Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest.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_transition_route_group_client_stub.call_rpc_count - end - end - - def test_create_transition_route_group - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.new - grpc_operation = GRPC::ActiveCall::Operation.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" - transition_route_group = {} - language_code = "hello world" - - create_transition_route_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_transition_route_group, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup), request["transition_route_group"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_transition_route_group_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_transition_route_group({ parent: parent, transition_route_group: transition_route_group, language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_transition_route_group parent: parent, transition_route_group: transition_route_group, language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_transition_route_group ::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest.new(parent: parent, transition_route_group: transition_route_group, language_code: language_code) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_transition_route_group({ parent: parent, transition_route_group: transition_route_group, 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 - client.create_transition_route_group(::Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest.new(parent: parent, transition_route_group: transition_route_group, 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_transition_route_group_client_stub.call_rpc_count - end - end - - def test_update_transition_route_group - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - transition_route_group = {} - update_mask = {} - language_code = "hello world" - - update_transition_route_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_transition_route_group, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup), request["transition_route_group"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_transition_route_group_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_transition_route_group({ transition_route_group: transition_route_group, update_mask: update_mask, language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_transition_route_group transition_route_group: transition_route_group, update_mask: update_mask, language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_transition_route_group ::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest.new(transition_route_group: transition_route_group, update_mask: update_mask, language_code: language_code) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_transition_route_group({ transition_route_group: transition_route_group, update_mask: update_mask, 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 - client.update_transition_route_group(::Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest.new(transition_route_group: transition_route_group, update_mask: update_mask, 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, update_transition_route_group_client_stub.call_rpc_count - end - end - - def test_delete_transition_route_group - # 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_transition_route_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_transition_route_group, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_transition_route_group_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_transition_route_group({ name: name, force: force }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_transition_route_group name: name, force: force do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_transition_route_group ::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest.new(name: name, force: force) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_transition_route_group({ 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 - client.delete_transition_route_group(::Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest.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_transition_route_group_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::CX::V3::TransitionRouteGroups::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::CX::V3::TransitionRouteGroups::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::CX::V3::TransitionRouteGroups::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_operations_test.rb deleted file mode 100644 index 875805bb7255..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_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/cx/v3/version_pb" -require "google/cloud/dialogflow/cx/v3/version_services_pb" -require "google/cloud/dialogflow/cx/v3/versions" - -class ::Google::Cloud::Dialogflow::CX::V3::Versions::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dialogflow::CX::V3::Versions::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::CX::V3::Versions::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_paths_test.rb deleted file mode 100644 index 9846d8d6b929..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_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/cx/v3/versions" - -class ::Google::Cloud::Dialogflow::CX::V3::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_flow_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::CX::V3::Versions::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.flow_path project: "value0", location: "value1", agent: "value2", flow: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/flows/value3", 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::CX::V3::Versions::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.version_path project: "value0", location: "value1", agent: "value2", flow: "value3", version: "value4" - assert_equal "projects/value0/locations/value1/agents/value2/flows/value3/versions/value4", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_rest_test.rb deleted file mode 100644 index 4dfc0384c75d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_rest_test.rb +++ /dev/null @@ -1,484 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/version_pb" -require "google/cloud/dialogflow/cx/v3/versions/rest" - - -class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::Versions::Rest::ServiceStub.stub :transcode_list_versions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_versions_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.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 - client.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 - client.list_versions ::Google::Cloud::Dialogflow::CX::V3::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 - client.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 - client.list_versions(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::Versions::Rest::ServiceStub.stub :transcode_get_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_version_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_version ::Google::Cloud::Dialogflow::CX::V3::GetVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_version(::Google::Cloud::Dialogflow::CX::V3::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::Longrunning::Operation.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::CX::V3::Versions::Rest::ServiceStub.stub :transcode_create_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_version_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_version({ parent: parent, version: version }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_version parent: parent, version: version do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_version ::Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest.new(parent: parent, version: version) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_version({ parent: parent, version: version }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_version(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::Versions::Rest::ServiceStub.stub :transcode_update_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_version_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_version({ version: version, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_version version: version, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_version ::Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest.new(version: version, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.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 - client.update_version(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::Versions::Rest::ServiceStub.stub :transcode_delete_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_version_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_version ::Google::Cloud::Dialogflow::CX::V3::DeleteVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_version(::Google::Cloud::Dialogflow::CX::V3::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_load_version - # 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" - allow_override_agent_resources = true - - load_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::CX::V3::Versions::Rest::ServiceStub.stub :transcode_load_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, load_version_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.load_version({ name: name, allow_override_agent_resources: allow_override_agent_resources }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.load_version name: name, allow_override_agent_resources: allow_override_agent_resources do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.load_version ::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest.new(name: name, allow_override_agent_resources: allow_override_agent_resources) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.load_version({ name: name, allow_override_agent_resources: allow_override_agent_resources }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.load_version(::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest.new(name: name, allow_override_agent_resources: allow_override_agent_resources), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, load_version_client_stub.call_count - end - end - end - - def test_compare_versions - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - base_version = "hello world" - target_version = "hello world" - language_code = "hello world" - - compare_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::CX::V3::Versions::Rest::ServiceStub.stub :transcode_compare_versions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, compare_versions_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.compare_versions({ base_version: base_version, target_version: target_version, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.compare_versions base_version: base_version, target_version: target_version, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.compare_versions ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest.new(base_version: base_version, target_version: target_version, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.compare_versions({ base_version: base_version, target_version: target_version, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.compare_versions(::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest.new(base_version: base_version, target_version: target_version, language_code: language_code), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, compare_versions_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::CX::V3::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::CX::V3::Versions::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_test.rb deleted file mode 100644 index 2bdebe57deaf..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_test.rb +++ /dev/null @@ -1,553 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/cx/v3/version_pb" -require "google/cloud/dialogflow/cx/v3/versions" - -class ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::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 - client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.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 - client.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 - client.list_versions ::Google::Cloud::Dialogflow::CX::V3::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 - client.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 - client.list_versions(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::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::CX::V3::GetVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_version_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_version({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_version name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_version ::Google::Cloud::Dialogflow::CX::V3::GetVersionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.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 - client.get_version(::Google::Cloud::Dialogflow::CX::V3::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::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" - 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::CX::V3::CreateVersionRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Version), request["version"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_version_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_version({ parent: parent, version: version }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_version parent: parent, version: version do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_version ::Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest.new(parent: parent, version: version) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_version({ parent: parent, version: version }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_version(::Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest.new(parent: parent, version: version), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_version_client_stub.call_rpc_count - end - end - - def test_update_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::UpdateVersionRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::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 - client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.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 - client.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 - client.update_version ::Google::Cloud::Dialogflow::CX::V3::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 - client.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 - client.update_version(::Google::Cloud::Dialogflow::CX::V3::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::CX::V3::DeleteVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_version_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_version({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_version name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_version ::Google::Cloud::Dialogflow::CX::V3::DeleteVersionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.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 - client.delete_version(::Google::Cloud::Dialogflow::CX::V3::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_load_version - # 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" - allow_override_agent_resources = true - - load_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :load_version, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["allow_override_agent_resources"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, load_version_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.load_version({ name: name, allow_override_agent_resources: allow_override_agent_resources }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.load_version name: name, allow_override_agent_resources: allow_override_agent_resources do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.load_version ::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest.new(name: name, allow_override_agent_resources: allow_override_agent_resources) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.load_version({ name: name, allow_override_agent_resources: allow_override_agent_resources }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.load_version(::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest.new(name: name, allow_override_agent_resources: allow_override_agent_resources), 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, load_version_client_stub.call_rpc_count - end - end - - def test_compare_versions - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - base_version = "hello world" - target_version = "hello world" - language_code = "hello world" - - compare_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :compare_versions, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest, request - assert_equal "hello world", request["base_version"] - assert_equal "hello world", request["target_version"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, compare_versions_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.compare_versions({ base_version: base_version, target_version: target_version, language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.compare_versions base_version: base_version, target_version: target_version, language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.compare_versions ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest.new(base_version: base_version, target_version: target_version, language_code: language_code) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.compare_versions({ base_version: base_version, target_version: target_version, 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 - client.compare_versions(::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest.new(base_version: base_version, target_version: target_version, 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, compare_versions_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::CX::V3::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::CX::V3::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::CX::V3::Versions::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Versions::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::CX::V3::Versions::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Versions::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_paths_test.rb deleted file mode 100644 index 43aa78a52ba2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_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/cx/v3/webhooks" - -class ::Google::Cloud::Dialogflow::CX::V3::Webhooks::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::CX::V3::Webhooks::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.agent_path project: "value0", location: "value1", agent: "value2" - assert_equal "projects/value0/locations/value1/agents/value2", 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::CX::V3::Webhooks::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::CX::V3::Webhooks::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_webhook_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::CX::V3::Webhooks::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.webhook_path project: "value0", location: "value1", agent: "value2", webhook: "value3" - assert_equal "projects/value0/locations/value1/agents/value2/webhooks/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_rest_test.rb deleted file mode 100644 index b6b8b118ee20..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_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/cx/v3/webhook_pb" -require "google/cloud/dialogflow/cx/v3/webhooks/rest" - - -class ::Google::Cloud::Dialogflow::CX::V3::Webhooks::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_webhooks - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksResponse.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_webhooks_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Webhooks::Rest::ServiceStub.stub :transcode_list_webhooks_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_webhooks_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_webhooks({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_webhooks parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_webhooks ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_webhooks({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_webhooks(::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest.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_webhooks_client_stub.call_count - end - end - end - - def test_get_webhook - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Webhook.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_webhook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Webhooks::Rest::ServiceStub.stub :transcode_get_webhook_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_webhook_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_webhook({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_webhook name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_webhook ::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_webhook({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_webhook(::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_webhook_client_stub.call_count - end - end - end - - def test_create_webhook - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Webhook.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - webhook = {} - - create_webhook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Webhooks::Rest::ServiceStub.stub :transcode_create_webhook_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_webhook_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_webhook({ parent: parent, webhook: webhook }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_webhook parent: parent, webhook: webhook do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_webhook ::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest.new(parent: parent, webhook: webhook) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_webhook({ parent: parent, webhook: webhook }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_webhook(::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest.new(parent: parent, webhook: webhook), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_webhook_client_stub.call_count - end - end - end - - def test_update_webhook - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::CX::V3::Webhook.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - webhook = {} - update_mask = {} - - update_webhook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Webhooks::Rest::ServiceStub.stub :transcode_update_webhook_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_webhook_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_webhook({ webhook: webhook, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_webhook webhook: webhook, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_webhook ::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest.new(webhook: webhook, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_webhook({ webhook: webhook, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_webhook(::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest.new(webhook: webhook, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_webhook_client_stub.call_count - end - end - end - - def test_delete_webhook - # 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_webhook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-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::CX::V3::Webhooks::Rest::ServiceStub.stub :transcode_delete_webhook_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_webhook_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_webhook({ name: name, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_webhook name: name, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_webhook ::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest.new(name: name, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_webhook({ name: name, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_webhook(::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest.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_webhook_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::CX::V3::Webhooks::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::CX::V3::Webhooks::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_test.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_test.rb deleted file mode 100644 index 96f811b1f873..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_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/cx/v3/webhook_pb" -require "google/cloud/dialogflow/cx/v3/webhooks" - -class ::Google::Cloud::Dialogflow::CX::V3::Webhooks::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_webhooks - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_webhooks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_webhooks, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest, 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_webhooks_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_webhooks({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_webhooks parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_webhooks ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_webhooks({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_webhooks(::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest.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_webhooks_client_stub.call_rpc_count - end - end - - def test_get_webhook - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Webhook.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_webhook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_webhook, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_webhook_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_webhook({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_webhook name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_webhook ::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_webhook({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_webhook(::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest.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_webhook_client_stub.call_rpc_count - end - end - - def test_create_webhook - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Webhook.new - grpc_operation = GRPC::ActiveCall::Operation.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" - webhook = {} - - create_webhook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_webhook, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Webhook), request["webhook"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_webhook_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_webhook({ parent: parent, webhook: webhook }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_webhook parent: parent, webhook: webhook do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_webhook ::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest.new(parent: parent, webhook: webhook) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_webhook({ parent: parent, webhook: webhook }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_webhook(::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest.new(parent: parent, webhook: webhook), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_webhook_client_stub.call_rpc_count - end - end - - def test_update_webhook - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::CX::V3::Webhook.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - webhook = {} - update_mask = {} - - update_webhook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_webhook, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::CX::V3::Webhook), request["webhook"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_webhook_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_webhook({ webhook: webhook, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_webhook webhook: webhook, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_webhook ::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest.new(webhook: webhook, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_webhook({ webhook: webhook, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_webhook(::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest.new(webhook: webhook, 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_webhook_client_stub.call_rpc_count - end - end - - def test_delete_webhook - # 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_webhook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_webhook, name - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_webhook_client_stub do - # Create client - client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_webhook({ name: name, force: force }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_webhook name: name, force: force do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_webhook ::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest.new(name: name, force: force) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_webhook({ 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 - client.delete_webhook(::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest.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_webhook_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::CX::V3::Webhooks::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::CX::V3::Webhooks::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::CX::V3::Webhooks::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/helper.rb b/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-cx-v3/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct"