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/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 new file mode 100644 index 000000000000..c21e771fb37d --- /dev/null +++ b/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/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/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 new file mode 100644 index 000000000000..b7c38d8a8efd --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..2bc228d8a079 --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..008a57257146 --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..354e55c6b4f0 --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..9a75185471dc --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..7f61f0f24840 --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..c0868d850da3 --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..409fe40f81f3 --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..a8cc1d3e2fab --- /dev/null +++ b/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/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/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 new file mode 100644 index 000000000000..70ae138b1bfc --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..3caf3bc0659e --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..90adffd709ef --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..3bb6aa8d8a27 --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..eb5ab72299d4 --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..3a877d98d8d4 --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..bcdb5b674b80 --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..47b35437fa9e --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..4632a1d84395 --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..025e19a2255c --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..d36ff19056ca --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..5c8bf4ff480f --- /dev/null +++ b/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/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/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 new file mode 100644 index 000000000000..692b597333cd --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..ff4226bb7adc --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..f50565860bf9 --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..201ab7c13d57 --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..0fa7bc12f011 --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..202f2e6421f0 --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..44cab988663f --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..a36b62e2635e --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..6ce8f392e255 --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..7c649016d4e9 --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..c24fde5e5c41 --- /dev/null +++ b/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/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/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 new file mode 100644 index 000000000000..f2e75e43d0ec --- /dev/null +++ b/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/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/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 new file mode 100644 index 000000000000..4c8417fd1a9b --- /dev/null +++ b/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/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/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 new file mode 100644 index 000000000000..0cd62239c00a --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..19d12a0b8a57 --- /dev/null +++ b/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/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/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 new file mode 100644 index 000000000000..2b20fd673837 --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..51f5b690609c --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..29b4f224d4ab --- /dev/null +++ b/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/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/google-cloud-dialogflow-cx-v3/snippets/examples/create_example.rb b/google-cloud-dialogflow-cx-v3/snippets/examples/create_example.rb new file mode 100644 index 000000000000..42fa81f9d984 --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/examples/delete_example.rb b/google-cloud-dialogflow-cx-v3/snippets/examples/delete_example.rb new file mode 100644 index 000000000000..f6f65ed8991c --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/examples/get_example.rb b/google-cloud-dialogflow-cx-v3/snippets/examples/get_example.rb new file mode 100644 index 000000000000..a37afe022cbf --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/examples/list_examples.rb b/google-cloud-dialogflow-cx-v3/snippets/examples/list_examples.rb new file mode 100644 index 000000000000..1fe0ac039673 --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/examples/update_example.rb b/google-cloud-dialogflow-cx-v3/snippets/examples/update_example.rb new file mode 100644 index 000000000000..50319a0f39f6 --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/playbooks/create_playbook.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/create_playbook.rb new file mode 100644 index 000000000000..aadb5184a0f1 --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/playbooks/create_playbook_version.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/create_playbook_version.rb new file mode 100644 index 000000000000..6430bdf07c88 --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/playbooks/delete_playbook.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/delete_playbook.rb new file mode 100644 index 000000000000..5ec83e6ae296 --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/playbooks/delete_playbook_version.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/delete_playbook_version.rb new file mode 100644 index 000000000000..228e4c05eeea --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/playbooks/export_playbook.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/export_playbook.rb new file mode 100644 index 000000000000..665867a36b5c --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/playbooks/get_playbook.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/get_playbook.rb new file mode 100644 index 000000000000..12eeb274741a --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/playbooks/get_playbook_version.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/get_playbook_version.rb new file mode 100644 index 000000000000..3da23f039921 --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/playbooks/import_playbook.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/import_playbook.rb new file mode 100644 index 000000000000..97ae1400bd4d --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/playbooks/list_playbook_versions.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/list_playbook_versions.rb new file mode 100644 index 000000000000..711c1e65469c --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/playbooks/list_playbooks.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/list_playbooks.rb new file mode 100644 index 000000000000..c8c366bcfe13 --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/playbooks/restore_playbook_version.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/restore_playbook_version.rb new file mode 100644 index 000000000000..6d9c5e087447 --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/playbooks/update_playbook.rb b/google-cloud-dialogflow-cx-v3/snippets/playbooks/update_playbook.rb new file mode 100644 index 000000000000..1f93a5005b3f --- /dev/null +++ b/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/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/google-cloud-dialogflow-cx-v3/snippets/tools/create_tool.rb b/google-cloud-dialogflow-cx-v3/snippets/tools/create_tool.rb new file mode 100644 index 000000000000..fa7ccbadb63b --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/tools/create_tool_version.rb b/google-cloud-dialogflow-cx-v3/snippets/tools/create_tool_version.rb new file mode 100644 index 000000000000..5fd583366bb6 --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/tools/delete_tool.rb b/google-cloud-dialogflow-cx-v3/snippets/tools/delete_tool.rb new file mode 100644 index 000000000000..8bcf68a7c433 --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/tools/delete_tool_version.rb b/google-cloud-dialogflow-cx-v3/snippets/tools/delete_tool_version.rb new file mode 100644 index 000000000000..958195ad4745 --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/tools/get_tool.rb b/google-cloud-dialogflow-cx-v3/snippets/tools/get_tool.rb new file mode 100644 index 000000000000..c038726d55c0 --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/tools/get_tool_version.rb b/google-cloud-dialogflow-cx-v3/snippets/tools/get_tool_version.rb new file mode 100644 index 000000000000..11fcccadcaff --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/tools/list_tool_versions.rb b/google-cloud-dialogflow-cx-v3/snippets/tools/list_tool_versions.rb new file mode 100644 index 000000000000..a43065229215 --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/tools/list_tools.rb b/google-cloud-dialogflow-cx-v3/snippets/tools/list_tools.rb new file mode 100644 index 000000000000..192baf901165 --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/tools/restore_tool_version.rb b/google-cloud-dialogflow-cx-v3/snippets/tools/restore_tool_version.rb new file mode 100644 index 000000000000..90fadc8f6b7a --- /dev/null +++ b/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/google-cloud-dialogflow-cx-v3/snippets/tools/update_tool.rb b/google-cloud-dialogflow-cx-v3/snippets/tools/update_tool.rb new file mode 100644 index 000000000000..251f3a875626 --- /dev/null +++ b/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/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/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 new file mode 100644 index 000000000000..da9c68608eba --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..d443a3f19b54 --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..eaf559de2846 --- /dev/null +++ b/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/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/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 new file mode 100644 index 000000000000..a4429169f38e --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..49286c65109c --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..5de4f3e0b29e --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..fa3d0115204d --- /dev/null +++ b/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/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/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 new file mode 100644 index 000000000000..b0c5c231d3ec --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..e96f99e2ca24 --- /dev/null +++ b/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/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 new file mode 100644 index 000000000000..4e550c70186a --- /dev/null +++ b/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/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