From 9e787f26a1b00362ce92adbc15b73dd0860edc78 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 5 Oct 2021 16:56:12 +0000 Subject: [PATCH] docs(samples): add auto-generated samples for Node with api short name in region tag (#186) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 399287285 Source-Link: https://github.com/googleapis/googleapis/commit/15759865d1c54e3d46429010f7e472fe6c3d3715 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b27fff623a5d8d586b703b5e4919856abe7c2eb3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjI3ZmZmNjIzYTVkOGQ1ODZiNzAzYjVlNDkxOTg1NmFiZTdjMmViMyJ9 --- .../linkinator.config.json | 5 +- .../generated/v3/agents.create_agent.js | 58 +++++++++++ .../generated/v3/agents.delete_agent.js | 53 +++++++++++ .../generated/v3/agents.export_agent.js | 67 +++++++++++++ .../samples/generated/v3/agents.get_agent.js | 53 +++++++++++ .../v3/agents.get_agent_validation_result.js | 58 +++++++++++ .../generated/v3/agents.list_agents.js | 64 +++++++++++++ .../generated/v3/agents.restore_agent.js | 68 +++++++++++++ .../generated/v3/agents.update_agent.js | 57 +++++++++++ .../generated/v3/agents.validate_agent.js | 57 +++++++++++ .../v3/entity_types.create_entity_type.js | 70 ++++++++++++++ .../v3/entity_types.delete_entity_type.js | 66 +++++++++++++ .../v3/entity_types.get_entity_type.js | 67 +++++++++++++ .../v3/entity_types.list_entity_types.js | 77 +++++++++++++++ .../v3/entity_types.update_entity_type.js | 68 +++++++++++++ .../v3/environments.create_environment.js | 59 ++++++++++++ .../v3/environments.delete_environment.js | 54 +++++++++++ .../v3/environments.get_environment.js | 54 +++++++++++ ...vironments.list_continuous_test_results.js | 65 +++++++++++++ .../v3/environments.list_environments.js | 64 +++++++++++++ ...environments.lookup_environment_history.js | 65 +++++++++++++ .../v3/environments.run_continuous_test.js | 54 +++++++++++ .../v3/environments.update_environment.js | 58 +++++++++++ .../v3/experiments.create_experiment.js | 59 ++++++++++++ .../v3/experiments.delete_experiment.js | 54 +++++++++++ .../v3/experiments.get_experiment.js | 54 +++++++++++ .../v3/experiments.list_experiments.js | 65 +++++++++++++ .../v3/experiments.start_experiment.js | 54 +++++++++++ .../v3/experiments.stop_experiment.js | 54 +++++++++++ .../v3/experiments.update_experiment.js | 57 +++++++++++ .../samples/generated/v3/flows.create_flow.js | 71 ++++++++++++++ .../samples/generated/v3/flows.delete_flow.js | 66 +++++++++++++ .../samples/generated/v3/flows.export_flow.js | 66 +++++++++++++ .../samples/generated/v3/flows.get_flow.js | 68 +++++++++++++ .../v3/flows.get_flow_validation_result.js | 58 +++++++++++ .../samples/generated/v3/flows.import_flow.js | 68 +++++++++++++ .../samples/generated/v3/flows.list_flows.js | 78 +++++++++++++++ .../samples/generated/v3/flows.train_flow.js | 55 +++++++++++ .../samples/generated/v3/flows.update_flow.js | 70 ++++++++++++++ .../generated/v3/flows.validate_flow.js | 58 +++++++++++ .../generated/v3/intents.create_intent.js | 68 +++++++++++++ .../generated/v3/intents.delete_intent.js | 54 +++++++++++ .../generated/v3/intents.get_intent.js | 65 +++++++++++++ .../generated/v3/intents.list_intents.js | 79 +++++++++++++++ .../generated/v3/intents.update_intent.js | 67 +++++++++++++ .../samples/generated/v3/pages.create_page.js | 80 ++++++++++++++++ .../samples/generated/v3/pages.delete_page.js | 66 +++++++++++++ .../samples/generated/v3/pages.get_page.js | 76 +++++++++++++++ .../samples/generated/v3/pages.list_pages.js | 87 +++++++++++++++++ .../samples/generated/v3/pages.update_page.js | 78 +++++++++++++++ ...ttings_service.create_security_settings.js | 59 ++++++++++++ ...ttings_service.delete_security_settings.js | 55 +++++++++++ ..._settings_service.get_security_settings.js | 55 +++++++++++ ...settings_service.list_security_settings.js | 65 +++++++++++++ ...ttings_service.update_security_settings.js | 60 ++++++++++++ ...entity_types.create_session_entity_type.js | 62 ++++++++++++ ...entity_types.delete_session_entity_type.js | 58 +++++++++++ ...on_entity_types.get_session_entity_type.js | 58 +++++++++++ ..._entity_types.list_session_entity_types.js | 68 +++++++++++++ ...entity_types.update_session_entity_type.js | 62 ++++++++++++ .../generated/v3/sessions.detect_intent.js | 78 +++++++++++++++ .../generated/v3/sessions.fulfill_intent.js | 59 ++++++++++++ .../generated/v3/sessions.match_intent.js | 71 ++++++++++++++ .../v3/sessions.streaming_detect_intent.js | 95 +++++++++++++++++++ .../v3/test_cases.batch_delete_test_cases.js | 59 ++++++++++++ .../v3/test_cases.batch_run_test_cases.js | 66 +++++++++++++ .../v3/test_cases.calculate_coverage.js | 58 +++++++++++ .../v3/test_cases.create_test_case.js | 58 +++++++++++ .../v3/test_cases.export_test_cases.js | 76 +++++++++++++++ .../generated/v3/test_cases.get_test_case.js | 54 +++++++++++ .../v3/test_cases.get_test_case_result.js | 54 +++++++++++ .../v3/test_cases.import_test_cases.js | 64 +++++++++++++ .../v3/test_cases.list_test_case_results.js | 88 +++++++++++++++++ .../v3/test_cases.list_test_cases.js | 69 ++++++++++++++ .../generated/v3/test_cases.run_test_case.js | 60 ++++++++++++ .../v3/test_cases.update_test_case.js | 59 ++++++++++++ ...te_groups.create_transition_route_group.js | 72 ++++++++++++++ ...te_groups.delete_transition_route_group.js | 64 +++++++++++++ ...route_groups.get_transition_route_group.js | 68 +++++++++++++ ...ute_groups.list_transition_route_groups.js | 79 +++++++++++++++ ...te_groups.update_transition_route_group.js | 69 ++++++++++++++ .../generated/v3/versions.create_version.js | 60 ++++++++++++ .../generated/v3/versions.delete_version.js | 54 +++++++++++ .../generated/v3/versions.get_version.js | 54 +++++++++++ .../generated/v3/versions.list_versions.js | 65 +++++++++++++ .../generated/v3/versions.load_version.js | 62 ++++++++++++ .../generated/v3/versions.update_version.js | 58 +++++++++++ .../generated/v3/webhooks.create_webhook.js | 58 +++++++++++ .../generated/v3/webhooks.delete_webhook.js | 65 +++++++++++++ .../generated/v3/webhooks.get_webhook.js | 54 +++++++++++ .../generated/v3/webhooks.list_webhooks.js | 64 +++++++++++++ .../generated/v3/webhooks.update_webhook.js | 57 +++++++++++ .../generated/v3beta1/agents.create_agent.js | 58 +++++++++++ .../generated/v3beta1/agents.delete_agent.js | 53 +++++++++++ .../generated/v3beta1/agents.export_agent.js | 67 +++++++++++++ .../generated/v3beta1/agents.get_agent.js | 53 +++++++++++ .../agents.get_agent_validation_result.js | 58 +++++++++++ .../generated/v3beta1/agents.list_agents.js | 64 +++++++++++++ .../generated/v3beta1/agents.restore_agent.js | 68 +++++++++++++ .../generated/v3beta1/agents.update_agent.js | 57 +++++++++++ .../v3beta1/agents.validate_agent.js | 57 +++++++++++ .../entity_types.create_entity_type.js | 70 ++++++++++++++ .../entity_types.delete_entity_type.js | 66 +++++++++++++ .../v3beta1/entity_types.get_entity_type.js | 67 +++++++++++++ .../v3beta1/entity_types.list_entity_types.js | 77 +++++++++++++++ .../entity_types.update_entity_type.js | 68 +++++++++++++ .../environments.create_environment.js | 59 ++++++++++++ .../environments.delete_environment.js | 54 +++++++++++ .../v3beta1/environments.get_environment.js | 54 +++++++++++ ...vironments.list_continuous_test_results.js | 65 +++++++++++++ .../v3beta1/environments.list_environments.js | 64 +++++++++++++ ...environments.lookup_environment_history.js | 65 +++++++++++++ .../environments.run_continuous_test.js | 54 +++++++++++ .../environments.update_environment.js | 58 +++++++++++ .../v3beta1/experiments.create_experiment.js | 59 ++++++++++++ .../v3beta1/experiments.delete_experiment.js | 54 +++++++++++ .../v3beta1/experiments.get_experiment.js | 54 +++++++++++ .../v3beta1/experiments.list_experiments.js | 65 +++++++++++++ .../v3beta1/experiments.start_experiment.js | 54 +++++++++++ .../v3beta1/experiments.stop_experiment.js | 54 +++++++++++ .../v3beta1/experiments.update_experiment.js | 57 +++++++++++ .../generated/v3beta1/flows.create_flow.js | 71 ++++++++++++++ .../generated/v3beta1/flows.delete_flow.js | 66 +++++++++++++ .../generated/v3beta1/flows.export_flow.js | 66 +++++++++++++ .../generated/v3beta1/flows.get_flow.js | 68 +++++++++++++ .../flows.get_flow_validation_result.js | 58 +++++++++++ .../generated/v3beta1/flows.import_flow.js | 68 +++++++++++++ .../generated/v3beta1/flows.list_flows.js | 78 +++++++++++++++ .../generated/v3beta1/flows.train_flow.js | 55 +++++++++++ .../generated/v3beta1/flows.update_flow.js | 70 ++++++++++++++ .../generated/v3beta1/flows.validate_flow.js | 58 +++++++++++ .../v3beta1/intents.create_intent.js | 68 +++++++++++++ .../v3beta1/intents.delete_intent.js | 54 +++++++++++ .../generated/v3beta1/intents.get_intent.js | 65 +++++++++++++ .../generated/v3beta1/intents.list_intents.js | 79 +++++++++++++++ .../v3beta1/intents.update_intent.js | 67 +++++++++++++ .../generated/v3beta1/pages.create_page.js | 80 ++++++++++++++++ .../generated/v3beta1/pages.delete_page.js | 66 +++++++++++++ .../generated/v3beta1/pages.get_page.js | 76 +++++++++++++++ .../generated/v3beta1/pages.list_pages.js | 87 +++++++++++++++++ .../generated/v3beta1/pages.update_page.js | 78 +++++++++++++++ ...ttings_service.create_security_settings.js | 59 ++++++++++++ ...ttings_service.delete_security_settings.js | 55 +++++++++++ ..._settings_service.get_security_settings.js | 55 +++++++++++ ...settings_service.list_security_settings.js | 65 +++++++++++++ ...ttings_service.update_security_settings.js | 60 ++++++++++++ ...entity_types.create_session_entity_type.js | 63 ++++++++++++ ...entity_types.delete_session_entity_type.js | 59 ++++++++++++ ...on_entity_types.get_session_entity_type.js | 59 ++++++++++++ ..._entity_types.list_session_entity_types.js | 69 ++++++++++++++ ...entity_types.update_session_entity_type.js | 63 ++++++++++++ .../v3beta1/sessions.detect_intent.js | 78 +++++++++++++++ .../v3beta1/sessions.fulfill_intent.js | 59 ++++++++++++ .../v3beta1/sessions.match_intent.js | 71 ++++++++++++++ .../sessions.streaming_detect_intent.js | 95 +++++++++++++++++++ .../test_cases.batch_delete_test_cases.js | 59 ++++++++++++ .../test_cases.batch_run_test_cases.js | 66 +++++++++++++ .../v3beta1/test_cases.calculate_coverage.js | 58 +++++++++++ .../v3beta1/test_cases.create_test_case.js | 58 +++++++++++ .../v3beta1/test_cases.export_test_cases.js | 76 +++++++++++++++ .../v3beta1/test_cases.get_test_case.js | 54 +++++++++++ .../test_cases.get_test_case_result.js | 54 +++++++++++ .../v3beta1/test_cases.import_test_cases.js | 64 +++++++++++++ .../test_cases.list_test_case_results.js | 88 +++++++++++++++++ .../v3beta1/test_cases.list_test_cases.js | 69 ++++++++++++++ .../v3beta1/test_cases.run_test_case.js | 60 ++++++++++++ .../v3beta1/test_cases.update_test_case.js | 59 ++++++++++++ ...te_groups.create_transition_route_group.js | 72 ++++++++++++++ ...te_groups.delete_transition_route_group.js | 64 +++++++++++++ ...route_groups.get_transition_route_group.js | 68 +++++++++++++ ...ute_groups.list_transition_route_groups.js | 79 +++++++++++++++ ...te_groups.update_transition_route_group.js | 69 ++++++++++++++ .../v3beta1/versions.create_version.js | 60 ++++++++++++ .../v3beta1/versions.delete_version.js | 54 +++++++++++ .../generated/v3beta1/versions.get_version.js | 54 +++++++++++ .../v3beta1/versions.list_versions.js | 65 +++++++++++++ .../v3beta1/versions.load_version.js | 62 ++++++++++++ .../v3beta1/versions.update_version.js | 58 +++++++++++ .../v3beta1/webhooks.create_webhook.js | 58 +++++++++++ .../v3beta1/webhooks.delete_webhook.js | 65 +++++++++++++ .../generated/v3beta1/webhooks.get_webhook.js | 54 +++++++++++ .../v3beta1/webhooks.list_webhooks.js | 64 +++++++++++++ .../v3beta1/webhooks.update_webhook.js | 57 +++++++++++ .../src/v3/agents_client.ts | 6 +- .../src/v3/entity_types_client.ts | 6 +- .../src/v3/environments_client.ts | 18 ++-- .../src/v3/experiments_client.ts | 6 +- .../src/v3/flows_client.ts | 6 +- .../src/v3/intents_client.ts | 6 +- .../src/v3/pages_client.ts | 6 +- .../v3/security_settings_service_client.ts | 6 +- .../src/v3/session_entity_types_client.ts | 6 +- .../src/v3/test_cases_client.ts | 12 ++- .../src/v3/transition_route_groups_client.ts | 6 +- .../src/v3/versions_client.ts | 6 +- .../src/v3/webhooks_client.ts | 6 +- .../src/v3beta1/agents_client.ts | 6 +- .../src/v3beta1/entity_types_client.ts | 6 +- .../src/v3beta1/environments_client.ts | 18 ++-- .../src/v3beta1/experiments_client.ts | 6 +- .../src/v3beta1/flows_client.ts | 6 +- .../src/v3beta1/intents_client.ts | 6 +- .../src/v3beta1/pages_client.ts | 6 +- .../security_settings_service_client.ts | 6 +- .../v3beta1/session_entity_types_client.ts | 6 +- .../src/v3beta1/test_cases_client.ts | 12 ++- .../v3beta1/transition_route_groups_client.ts | 6 +- .../src/v3beta1/versions_client.ts | 6 +- .../src/v3beta1/webhooks_client.ts | 6 +- 209 files changed, 11742 insertions(+), 68 deletions(-) create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.create_agent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.delete_agent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.export_agent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.get_agent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.get_agent_validation_result.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.list_agents.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.restore_agent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.update_agent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.validate_agent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.create_entity_type.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.delete_entity_type.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.get_entity_type.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.list_entity_types.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.update_entity_type.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.create_environment.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.delete_environment.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.get_environment.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.list_continuous_test_results.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.list_environments.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.lookup_environment_history.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.run_continuous_test.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.update_environment.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.create_experiment.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.delete_experiment.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.get_experiment.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.list_experiments.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.start_experiment.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.stop_experiment.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.update_experiment.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.create_flow.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.delete_flow.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.export_flow.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.get_flow.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.get_flow_validation_result.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.import_flow.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.list_flows.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.train_flow.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.update_flow.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.validate_flow.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.create_intent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.delete_intent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.get_intent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.list_intents.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.update_intent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.create_page.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.delete_page.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.get_page.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.list_pages.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.update_page.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.create_security_settings.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.delete_security_settings.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.get_security_settings.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.list_security_settings.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.update_security_settings.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.create_session_entity_type.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.delete_session_entity_type.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.get_session_entity_type.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.list_session_entity_types.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.update_session_entity_type.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.detect_intent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.fulfill_intent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.match_intent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.streaming_detect_intent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.batch_delete_test_cases.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.batch_run_test_cases.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.calculate_coverage.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.create_test_case.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.export_test_cases.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.get_test_case.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.get_test_case_result.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.import_test_cases.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.list_test_case_results.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.list_test_cases.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.run_test_case.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.update_test_case.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.create_transition_route_group.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.delete_transition_route_group.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.get_transition_route_group.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.list_transition_route_groups.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.update_transition_route_group.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.create_version.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.delete_version.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.get_version.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.list_versions.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.load_version.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.update_version.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.create_webhook.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.delete_webhook.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.get_webhook.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.list_webhooks.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.update_webhook.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.create_agent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.delete_agent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.export_agent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.get_agent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.get_agent_validation_result.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.list_agents.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.restore_agent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.update_agent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.validate_agent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.create_entity_type.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.delete_entity_type.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.get_entity_type.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.list_entity_types.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.update_entity_type.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.create_environment.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.delete_environment.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.get_environment.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.list_continuous_test_results.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.list_environments.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.lookup_environment_history.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.run_continuous_test.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.update_environment.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.create_experiment.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.delete_experiment.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.get_experiment.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.list_experiments.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.start_experiment.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.stop_experiment.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.update_experiment.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.create_flow.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.delete_flow.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.export_flow.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.get_flow.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.get_flow_validation_result.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.import_flow.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.list_flows.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.train_flow.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.update_flow.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.validate_flow.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.create_intent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.delete_intent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.get_intent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.list_intents.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.update_intent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.create_page.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.delete_page.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.get_page.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.list_pages.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.update_page.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.create_security_settings.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.delete_security_settings.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.get_security_settings.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.list_security_settings.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.update_security_settings.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.create_session_entity_type.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.delete_session_entity_type.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.get_session_entity_type.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.list_session_entity_types.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.update_session_entity_type.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.detect_intent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.fulfill_intent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.match_intent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.streaming_detect_intent.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.batch_delete_test_cases.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.batch_run_test_cases.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.calculate_coverage.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.create_test_case.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.export_test_cases.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.get_test_case.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.get_test_case_result.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.import_test_cases.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.list_test_case_results.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.list_test_cases.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.run_test_case.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.update_test_case.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.create_transition_route_group.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.delete_transition_route_group.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.get_transition_route_group.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.list_transition_route_groups.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.update_transition_route_group.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.create_version.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.delete_version.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.get_version.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.list_versions.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.load_version.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.update_version.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.create_webhook.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.delete_webhook.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.get_webhook.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.list_webhooks.js create mode 100644 packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.update_webhook.js diff --git a/packages/google-cloud-dialogflow-cx/linkinator.config.json b/packages/google-cloud-dialogflow-cx/linkinator.config.json index 940f1e732a2..29a223b6db6 100644 --- a/packages/google-cloud-dialogflow-cx/linkinator.config.json +++ b/packages/google-cloud-dialogflow-cx/linkinator.config.json @@ -3,10 +3,7 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "img.shields.io", - "https://github.com/googleapis/nodejs-dialogflow-cx/blob/main/samples/create-page.js", - "https://github.com/googleapis/nodejs-dialogflow-cx/blob/main/samples/delete-page.js", - "https://github.com/googleapis/nodejs-dialogflow-cx/blob/main/samples/list-page.js" + "img.shields.io" ], "silent": true, "concurrency": 10 diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.create_agent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.create_agent.js new file mode 100644 index 00000000000..49800955183 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.create_agent.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, agent) { + // [START dialogflow_v3_generated_Agents_CreateAgent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location to create a agent for. + * Format: `projects//locations/`. + */ + // const parent = 'abc123' + /** + * Required. The agent to create. + */ + // const agent = '' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function createAgent() { + // Construct request + const request = { + parent, + agent, + }; + + // Run request + const response = await cxClient.createAgent(request); + console.log(response); + } + + createAgent(); + // [END dialogflow_v3_generated_Agents_CreateAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.delete_agent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.delete_agent.js new file mode 100644 index 00000000000..bf38905fafb --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.delete_agent.js @@ -0,0 +1,53 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Agents_DeleteAgent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the agent to delete. + * Format: `projects//locations//agents/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function deleteAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteAgent(request); + console.log(response); + } + + deleteAgent(); + // [END dialogflow_v3_generated_Agents_DeleteAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.export_agent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.export_agent.js new file mode 100644 index 00000000000..ae162409858 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.export_agent.js @@ -0,0 +1,67 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Agents_ExportAgent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the agent to export. + * Format: `projects//locations//agents/`. + */ + // const name = 'abc123' + /** + * Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to + * export the agent to. The format of this URI must be + * `gs:///`. + * If left unspecified, the serialized agent is returned inline. + */ + // const agentUri = 'abc123' + /** + * Optional. Environment name. If not set, draft environment is assumed. + * Format: `projects//locations//agents//environments/`. + */ + // const environment = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function exportAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.exportAgent(request); + const [response] = await operation.promise(); + console.log(response); + } + + exportAgent(); + // [END dialogflow_v3_generated_Agents_ExportAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.get_agent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.get_agent.js new file mode 100644 index 00000000000..b78bb6af7ac --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.get_agent.js @@ -0,0 +1,53 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Agents_GetAgent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the agent. + * Format: `projects//locations//agents/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function getAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getAgent(request); + console.log(response); + } + + getAgent(); + // [END dialogflow_v3_generated_Agents_GetAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.get_agent_validation_result.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.get_agent_validation_result.js new file mode 100644 index 00000000000..464a282b299 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.get_agent_validation_result.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Agents_GetAgentValidationResult_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent name. + * Format: `projects//locations//agents//validationResult`. + */ + // const name = 'abc123' + /** + * If not specified, the agent's default language is used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function getAgentValidationResult() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getAgentValidationResult(request); + console.log(response); + } + + getAgentValidationResult(); + // [END dialogflow_v3_generated_Agents_GetAgentValidationResult_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.list_agents.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.list_agents.js new file mode 100644 index 00000000000..c2cb5cd748c --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.list_agents.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3_generated_Agents_ListAgents_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location to list all agents for. + * Format: `projects//locations/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function listAgents() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listAgentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listAgents(); + // [END dialogflow_v3_generated_Agents_ListAgents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.restore_agent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.restore_agent.js new file mode 100644 index 00000000000..bbcdcc2b448 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.restore_agent.js @@ -0,0 +1,68 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Agents_RestoreAgent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the agent to restore into. + * Format: `projects//locations//agents/`. + */ + // const name = 'abc123' + /** + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + * to restore agent from. The format of this URI must be + * `gs:///`. + */ + // const agentUri = 'abc123' + /** + * Uncompressed raw byte content for agent. + */ + // const agentContent = 'Buffer.from('string')' + /** + * Agent restore mode. If not specified, `KEEP` is assumed. + */ + // const restoreOption = '' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function restoreAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.restoreAgent(request); + const [response] = await operation.promise(); + console.log(response); + } + + restoreAgent(); + // [END dialogflow_v3_generated_Agents_RestoreAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.update_agent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.update_agent.js new file mode 100644 index 00000000000..0eea5f94f6b --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.update_agent.js @@ -0,0 +1,57 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(agent) { + // [START dialogflow_v3_generated_Agents_UpdateAgent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to update. + */ + // const agent = '' + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function updateAgent() { + // Construct request + const request = { + agent, + }; + + // Run request + const response = await cxClient.updateAgent(request); + console.log(response); + } + + updateAgent(); + // [END dialogflow_v3_generated_Agents_UpdateAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.validate_agent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.validate_agent.js new file mode 100644 index 00000000000..48fb356f676 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/agents.validate_agent.js @@ -0,0 +1,57 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Agents_ValidateAgent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to validate. + * Format: `projects//locations//agents/`. + */ + // const name = 'abc123' + /** + * If not specified, the agent's default language is used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function validateAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.validateAgent(request); + console.log(response); + } + + validateAgent(); + // [END dialogflow_v3_generated_Agents_ValidateAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.create_entity_type.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.create_entity_type.js new file mode 100644 index 00000000000..69638c2586c --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.create_entity_type.js @@ -0,0 +1,70 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, entityType) { + // [START dialogflow_v3_generated_EntityTypes_CreateEntityType_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to create a entity type for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The entity type to create. + */ + // const entityType = '' + /** + * The language of the following fields in `entity_type`: + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function createEntityType() { + // Construct request + const request = { + parent, + entityType, + }; + + // Run request + const response = await cxClient.createEntityType(request); + console.log(response); + } + + createEntityType(); + // [END dialogflow_v3_generated_EntityTypes_CreateEntityType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.delete_entity_type.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.delete_entity_type.js new file mode 100644 index 00000000000..5f7434e4b4d --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.delete_entity_type.js @@ -0,0 +1,66 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_EntityTypes_DeleteEntityType_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the entity type to delete. + * Format: `projects//locations//agents//entityTypes/`. + */ + // const name = 'abc123' + /** + * This field has no effect for entity type not being used. + * For entity types that are used by intents or pages: + * * If `force` is set to false, an error will be returned with message + * indicating the referencing resources. + * * If `force` is set to true, Dialogflow will remove the entity type, as + * well as any references to the entity type (i.e. Page + * [parameter][google.cloud.dialogflow.cx.v3.Form.Parameter] of the entity type will be changed to + * '@sys.any' and intent [parameter][google.cloud.dialogflow.cx.v3.Intent.Parameter] of the entity type + * will be removed). + */ + // const force = true + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function deleteEntityType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteEntityType(request); + console.log(response); + } + + deleteEntityType(); + // [END dialogflow_v3_generated_EntityTypes_DeleteEntityType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.get_entity_type.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.get_entity_type.js new file mode 100644 index 00000000000..e70a3389ea4 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.get_entity_type.js @@ -0,0 +1,67 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_EntityTypes_GetEntityType_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the entity type. + * Format: `projects//locations//agents//entityTypes/`. + */ + // const name = 'abc123' + /** + * The language to retrieve the entity type for. The following fields are + * language dependent: + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function getEntityType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getEntityType(request); + console.log(response); + } + + getEntityType(); + // [END dialogflow_v3_generated_EntityTypes_GetEntityType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.list_entity_types.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.list_entity_types.js new file mode 100644 index 00000000000..7a383d81d51 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.list_entity_types.js @@ -0,0 +1,77 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3_generated_EntityTypes_ListEntityTypes_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to list all entity types for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The language to list entity types for. The following fields are language + * dependent: + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function listEntityTypes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listEntityTypesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listEntityTypes(); + // [END dialogflow_v3_generated_EntityTypes_ListEntityTypes_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.update_entity_type.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.update_entity_type.js new file mode 100644 index 00000000000..b242bfaad1e --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/entity_types.update_entity_type.js @@ -0,0 +1,68 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(entityType) { + // [START dialogflow_v3_generated_EntityTypes_UpdateEntityType_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The entity type to update. + */ + // const entityType = '' + /** + * The language of the following fields in `entity_type`: + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The mask to control which fields get updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function updateEntityType() { + // Construct request + const request = { + entityType, + }; + + // Run request + const response = await cxClient.updateEntityType(request); + console.log(response); + } + + updateEntityType(); + // [END dialogflow_v3_generated_EntityTypes_UpdateEntityType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.create_environment.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.create_environment.js new file mode 100644 index 00000000000..e58e2651d5e --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.create_environment.js @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, environment) { + // [START dialogflow_v3_generated_Environments_CreateEnvironment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The [Agent][google.cloud.dialogflow.cx.v3.Agent] to create an [Environment][google.cloud.dialogflow.cx.v3.Environment] for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The environment to create. + */ + // const environment = '' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function createEnvironment() { + // Construct request + const request = { + parent, + environment, + }; + + // Run request + const [operation] = await cxClient.createEnvironment(request); + const [response] = await operation.promise(); + console.log(response); + } + + createEnvironment(); + // [END dialogflow_v3_generated_Environments_CreateEnvironment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.delete_environment.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.delete_environment.js new file mode 100644 index 00000000000..a594318814b --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.delete_environment.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Environments_DeleteEnvironment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the [Environment][google.cloud.dialogflow.cx.v3.Environment] to delete. + * Format: `projects//locations//agents//environments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function deleteEnvironment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteEnvironment(request); + console.log(response); + } + + deleteEnvironment(); + // [END dialogflow_v3_generated_Environments_DeleteEnvironment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.get_environment.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.get_environment.js new file mode 100644 index 00000000000..3e97b2c33bc --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.get_environment.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Environments_GetEnvironment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the [Environment][google.cloud.dialogflow.cx.v3.Environment]. + * Format: `projects//locations//agents//environments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function getEnvironment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getEnvironment(request); + console.log(response); + } + + getEnvironment(); + // [END dialogflow_v3_generated_Environments_GetEnvironment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.list_continuous_test_results.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.list_continuous_test_results.js new file mode 100644 index 00000000000..9948e341d0a --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.list_continuous_test_results.js @@ -0,0 +1,65 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3_generated_Environments_ListContinuousTestResults_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The environment to list results for. + * Format: `projects//locations//agents// + * environments/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function listContinuousTestResults() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listContinuousTestResultsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listContinuousTestResults(); + // [END dialogflow_v3_generated_Environments_ListContinuousTestResults_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.list_environments.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.list_environments.js new file mode 100644 index 00000000000..25c538ab2c4 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.list_environments.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3_generated_Environments_ListEnvironments_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The [Agent][google.cloud.dialogflow.cx.v3.Agent] to list all environments for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function listEnvironments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listEnvironmentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listEnvironments(); + // [END dialogflow_v3_generated_Environments_ListEnvironments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.lookup_environment_history.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.lookup_environment_history.js new file mode 100644 index 00000000000..68ab96a9ebe --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.lookup_environment_history.js @@ -0,0 +1,65 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Environments_LookupEnvironmentHistory_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the environment to look up the history for. + * Format: `projects//locations//agents//environments/`. + */ + // const name = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function lookupEnvironmentHistory() { + // Construct request + const request = { + name, + }; + + // Run request + const iterable = await cxClient.lookupEnvironmentHistoryAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + lookupEnvironmentHistory(); + // [END dialogflow_v3_generated_Environments_LookupEnvironmentHistory_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.run_continuous_test.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.run_continuous_test.js new file mode 100644 index 00000000000..17933c5ee92 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.run_continuous_test.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(environment) { + // [START dialogflow_v3_generated_Environments_RunContinuousTest_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Format: `projects//locations//agents//environments/`. + */ + // const environment = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function runContinuousTest() { + // Construct request + const request = { + environment, + }; + + // Run request + const [operation] = await cxClient.runContinuousTest(request); + const [response] = await operation.promise(); + console.log(response); + } + + runContinuousTest(); + // [END dialogflow_v3_generated_Environments_RunContinuousTest_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.update_environment.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.update_environment.js new file mode 100644 index 00000000000..bc83ddd47b2 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/environments.update_environment.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(environment, updateMask) { + // [START dialogflow_v3_generated_Environments_UpdateEnvironment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The environment to update. + */ + // const environment = '' + /** + * Required. The mask to control which fields get updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function updateEnvironment() { + // Construct request + const request = { + environment, + updateMask, + }; + + // Run request + const [operation] = await cxClient.updateEnvironment(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateEnvironment(); + // [END dialogflow_v3_generated_Environments_UpdateEnvironment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.create_experiment.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.create_experiment.js new file mode 100644 index 00000000000..7bf229724a4 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.create_experiment.js @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, experiment) { + // [START dialogflow_v3_generated_Experiments_CreateExperiment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The [Agent][google.cloud.dialogflow.cx.v3.Agent] to create an [Environment][google.cloud.dialogflow.cx.v3.Environment] for. + * Format: `projects//locations//agents//environments/`. + */ + // const parent = 'abc123' + /** + * Required. The experiment to create. + */ + // const experiment = '' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function createExperiment() { + // Construct request + const request = { + parent, + experiment, + }; + + // Run request + const response = await cxClient.createExperiment(request); + console.log(response); + } + + createExperiment(); + // [END dialogflow_v3_generated_Experiments_CreateExperiment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.delete_experiment.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.delete_experiment.js new file mode 100644 index 00000000000..cd3c20d2f33 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.delete_experiment.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Experiments_DeleteExperiment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the [Environment][google.cloud.dialogflow.cx.v3.Environment] to delete. + * Format: `projects//locations//agents//environments//experiments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function deleteExperiment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteExperiment(request); + console.log(response); + } + + deleteExperiment(); + // [END dialogflow_v3_generated_Experiments_DeleteExperiment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.get_experiment.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.get_experiment.js new file mode 100644 index 00000000000..b927719e2d0 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.get_experiment.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Experiments_GetExperiment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the [Environment][google.cloud.dialogflow.cx.v3.Environment]. + * Format: `projects//locations//agents//environments//experiments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function getExperiment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getExperiment(request); + console.log(response); + } + + getExperiment(); + // [END dialogflow_v3_generated_Experiments_GetExperiment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.list_experiments.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.list_experiments.js new file mode 100644 index 00000000000..b3fee1c218e --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.list_experiments.js @@ -0,0 +1,65 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3_generated_Experiments_ListExperiments_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The [Environment][google.cloud.dialogflow.cx.v3.Environment] to list all environments for. + * Format: `projects//locations//agents//environments/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function listExperiments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listExperimentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listExperiments(); + // [END dialogflow_v3_generated_Experiments_ListExperiments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.start_experiment.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.start_experiment.js new file mode 100644 index 00000000000..abde533baa9 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.start_experiment.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Experiments_StartExperiment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the experiment to start. + * Format: `projects//locations//agents//environments//experiments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function startExperiment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.startExperiment(request); + console.log(response); + } + + startExperiment(); + // [END dialogflow_v3_generated_Experiments_StartExperiment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.stop_experiment.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.stop_experiment.js new file mode 100644 index 00000000000..b2f15719eb7 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.stop_experiment.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Experiments_StopExperiment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the experiment to stop. + * Format: `projects//locations//agents//environments//experiments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function stopExperiment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.stopExperiment(request); + console.log(response); + } + + stopExperiment(); + // [END dialogflow_v3_generated_Experiments_StopExperiment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.update_experiment.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.update_experiment.js new file mode 100644 index 00000000000..955ab8b3df2 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/experiments.update_experiment.js @@ -0,0 +1,57 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(experiment, updateMask) { + // [START dialogflow_v3_generated_Experiments_UpdateExperiment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The experiment to update. + */ + // const experiment = '' + /** + * Required. The mask to control which fields get updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function updateExperiment() { + // Construct request + const request = { + experiment, + updateMask, + }; + + // Run request + const response = await cxClient.updateExperiment(request); + console.log(response); + } + + updateExperiment(); + // [END dialogflow_v3_generated_Experiments_UpdateExperiment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.create_flow.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.create_flow.js new file mode 100644 index 00000000000..1e56d3cb713 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.create_flow.js @@ -0,0 +1,71 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, flow) { + // [START dialogflow_v3_generated_Flows_CreateFlow_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to create a flow for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The flow to create. + */ + // const flow = '' + /** + * The language of the following fields in `flow`: + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function createFlow() { + // Construct request + const request = { + parent, + flow, + }; + + // Run request + const response = await cxClient.createFlow(request); + console.log(response); + } + + createFlow(); + // [END dialogflow_v3_generated_Flows_CreateFlow_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.delete_flow.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.delete_flow.js new file mode 100644 index 00000000000..12024ef0332 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.delete_flow.js @@ -0,0 +1,66 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Flows_DeleteFlow_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the flow to delete. + * Format: `projects//locations//agents//flows/`. + */ + // const name = 'abc123' + /** + * This field has no effect for flows with no incoming transitions. + * For flows with incoming transitions: + * * If `force` is set to false, an error will be returned with message + * indicating the incoming transitions. + * * If `force` is set to true, Dialogflow will remove the flow, as well as + * any transitions to the flow (i.e. [Target + * flow][EventHandler.target_flow] in event handlers or [Target + * flow][TransitionRoute.target_flow] in transition routes that point to + * this flow will be cleared). + */ + // const force = true + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function deleteFlow() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteFlow(request); + console.log(response); + } + + deleteFlow(); + // [END dialogflow_v3_generated_Flows_DeleteFlow_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.export_flow.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.export_flow.js new file mode 100644 index 00000000000..8699a06029c --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.export_flow.js @@ -0,0 +1,66 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Flows_ExportFlow_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the flow to export. + * Format: `projects//locations//agents//flows/`. + */ + // const name = 'abc123' + /** + * Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to + * export the flow to. The format of this URI must be + * `gs:///`. + * If left unspecified, the serialized flow is returned inline. + */ + // const flowUri = 'abc123' + /** + * Optional. Whether to export flows referenced by the specified flow. + */ + // const includeReferencedFlows = true + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function exportFlow() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.exportFlow(request); + const [response] = await operation.promise(); + console.log(response); + } + + exportFlow(); + // [END dialogflow_v3_generated_Flows_ExportFlow_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.get_flow.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.get_flow.js new file mode 100644 index 00000000000..fef2af21428 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.get_flow.js @@ -0,0 +1,68 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Flows_GetFlow_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the flow to get. + * Format: `projects//locations//agents//flows/`. + */ + // const name = 'abc123' + /** + * The language to retrieve the flow for. The following fields are language + * dependent: + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function getFlow() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getFlow(request); + console.log(response); + } + + getFlow(); + // [END dialogflow_v3_generated_Flows_GetFlow_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.get_flow_validation_result.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.get_flow_validation_result.js new file mode 100644 index 00000000000..2acb0d1e83f --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.get_flow_validation_result.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Flows_GetFlowValidationResult_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The flow name. + * Format: `projects//locations//agents//flows//validationResult`. + */ + // const name = 'abc123' + /** + * If not specified, the agent's default language is used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function getFlowValidationResult() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getFlowValidationResult(request); + console.log(response); + } + + getFlowValidationResult(); + // [END dialogflow_v3_generated_Flows_GetFlowValidationResult_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.import_flow.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.import_flow.js new file mode 100644 index 00000000000..97c4c3b2fb4 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.import_flow.js @@ -0,0 +1,68 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3_generated_Flows_ImportFlow_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to import the flow into. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + * to import flow from. The format of this URI must be + * `gs:///`. + */ + // const flowUri = 'abc123' + /** + * Uncompressed raw byte content for flow. + */ + // const flowContent = 'Buffer.from('string')' + /** + * Flow import mode. If not specified, `KEEP` is assumed. + */ + // const importOption = '' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function importFlow() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await cxClient.importFlow(request); + const [response] = await operation.promise(); + console.log(response); + } + + importFlow(); + // [END dialogflow_v3_generated_Flows_ImportFlow_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.list_flows.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.list_flows.js new file mode 100644 index 00000000000..9111c886ebf --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.list_flows.js @@ -0,0 +1,78 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3_generated_Flows_ListFlows_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent containing the flows. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + /** + * The language to list flows for. The following fields are language + * dependent: + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function listFlows() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listFlowsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listFlows(); + // [END dialogflow_v3_generated_Flows_ListFlows_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.train_flow.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.train_flow.js new file mode 100644 index 00000000000..0ec0ee3d608 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.train_flow.js @@ -0,0 +1,55 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Flows_TrainFlow_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The flow to train. + * Format: `projects//locations//agents//flows/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function trainFlow() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.trainFlow(request); + const [response] = await operation.promise(); + console.log(response); + } + + trainFlow(); + // [END dialogflow_v3_generated_Flows_TrainFlow_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.update_flow.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.update_flow.js new file mode 100644 index 00000000000..381b8ccf47f --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.update_flow.js @@ -0,0 +1,70 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(flow) { + // [START dialogflow_v3_generated_Flows_UpdateFlow_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The flow to update. + */ + // const flow = '' + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = '' + /** + * The language of the following fields in `flow`: + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function updateFlow() { + // Construct request + const request = { + flow, + }; + + // Run request + const response = await cxClient.updateFlow(request); + console.log(response); + } + + updateFlow(); + // [END dialogflow_v3_generated_Flows_UpdateFlow_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.validate_flow.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.validate_flow.js new file mode 100644 index 00000000000..225a18dffe7 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/flows.validate_flow.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Flows_ValidateFlow_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The flow to validate. + * Format: `projects//locations//agents//flows/`. + */ + // const name = 'abc123' + /** + * If not specified, the agent's default language is used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function validateFlow() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.validateFlow(request); + console.log(response); + } + + validateFlow(); + // [END dialogflow_v3_generated_Flows_ValidateFlow_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.create_intent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.create_intent.js new file mode 100644 index 00000000000..1a7c8a667f9 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.create_intent.js @@ -0,0 +1,68 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, intent) { + // [START dialogflow_v3_generated_Intents_CreateIntent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to create an intent for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The intent to create. + */ + // const intent = '' + /** + * The language of the following fields in `intent`: + * * `Intent.training_phrases.parts.text` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function createIntent() { + // Construct request + const request = { + parent, + intent, + }; + + // Run request + const response = await cxClient.createIntent(request); + console.log(response); + } + + createIntent(); + // [END dialogflow_v3_generated_Intents_CreateIntent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.delete_intent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.delete_intent.js new file mode 100644 index 00000000000..079be814bd4 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.delete_intent.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Intents_DeleteIntent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the intent to delete. + * Format: `projects//locations//agents//intents/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function deleteIntent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteIntent(request); + console.log(response); + } + + deleteIntent(); + // [END dialogflow_v3_generated_Intents_DeleteIntent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.get_intent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.get_intent.js new file mode 100644 index 00000000000..5e2305c6000 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.get_intent.js @@ -0,0 +1,65 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Intents_GetIntent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the intent. + * Format: `projects//locations//agents//intents/`. + */ + // const name = 'abc123' + /** + * The language to retrieve the intent for. The following fields are language + * dependent: + * * `Intent.training_phrases.parts.text` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function getIntent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getIntent(request); + console.log(response); + } + + getIntent(); + // [END dialogflow_v3_generated_Intents_GetIntent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.list_intents.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.list_intents.js new file mode 100644 index 00000000000..b5b0f2c1bb4 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.list_intents.js @@ -0,0 +1,79 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3_generated_Intents_ListIntents_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to list all intents for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The language to list intents for. The following fields are language + * dependent: + * * `Intent.training_phrases.parts.text` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The resource view to apply to the returned intent. + */ + // const intentView = '' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function listIntents() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listIntentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listIntents(); + // [END dialogflow_v3_generated_Intents_ListIntents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.update_intent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.update_intent.js new file mode 100644 index 00000000000..30adaf238b7 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/intents.update_intent.js @@ -0,0 +1,67 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(intent) { + // [START dialogflow_v3_generated_Intents_UpdateIntent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The intent to update. + */ + // const intent = '' + /** + * The language of the following fields in `intent`: + * * `Intent.training_phrases.parts.text` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function updateIntent() { + // Construct request + const request = { + intent, + }; + + // Run request + const response = await cxClient.updateIntent(request); + console.log(response); + } + + updateIntent(); + // [END dialogflow_v3_generated_Intents_UpdateIntent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.create_page.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.create_page.js new file mode 100644 index 00000000000..4b1d280eb5b --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.create_page.js @@ -0,0 +1,80 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, page) { + // [START dialogflow_v3_generated_Pages_CreatePage_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The flow to create a page for. + * Format: `projects//locations//agents//flows/`. + */ + // const parent = 'abc123' + /** + * Required. The page to create. + */ + // const page = '' + /** + * The language of the following fields in `page`: + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {PagesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PagesClient(); + + async function createPage() { + // Construct request + const request = { + parent, + page, + }; + + // Run request + const response = await cxClient.createPage(request); + console.log(response); + } + + createPage(); + // [END dialogflow_v3_generated_Pages_CreatePage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.delete_page.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.delete_page.js new file mode 100644 index 00000000000..b802d96adb5 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.delete_page.js @@ -0,0 +1,66 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Pages_DeletePage_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the page to delete. + * Format: `projects//locations//agents//Flows//pages/`. + */ + // const name = 'abc123' + /** + * This field has no effect for pages with no incoming transitions. + * For pages with incoming transitions: + * * If `force` is set to false, an error will be returned with message + * indicating the incoming transitions. + * * If `force` is set to true, Dialogflow will remove the page, as well as + * any transitions to the page (i.e. [Target + * page][EventHandler.target_page] in event handlers or [Target + * page][TransitionRoute.target_page] in transition routes that point to + * this page will be cleared). + */ + // const force = true + + // Imports the Cx library + const {PagesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PagesClient(); + + async function deletePage() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deletePage(request); + console.log(response); + } + + deletePage(); + // [END dialogflow_v3_generated_Pages_DeletePage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.get_page.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.get_page.js new file mode 100644 index 00000000000..d031cefa90f --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.get_page.js @@ -0,0 +1,76 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Pages_GetPage_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the page. + * Format: `projects//locations//agents//flows//pages/`. + */ + // const name = 'abc123' + /** + * The language to retrieve the page for. The following fields are language + * dependent: + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {PagesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PagesClient(); + + async function getPage() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getPage(request); + console.log(response); + } + + getPage(); + // [END dialogflow_v3_generated_Pages_GetPage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.list_pages.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.list_pages.js new file mode 100644 index 00000000000..371f3a649c5 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.list_pages.js @@ -0,0 +1,87 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3_generated_Pages_ListPages_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The flow to list all pages for. + * Format: `projects//locations//agents//flows/`. + */ + // const parent = 'abc123' + /** + * The language to list pages for. The following fields are language + * dependent: + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {PagesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PagesClient(); + + async function listPages() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listPagesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listPages(); + // [END dialogflow_v3_generated_Pages_ListPages_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.update_page.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.update_page.js new file mode 100644 index 00000000000..d8e8b3faf61 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/pages.update_page.js @@ -0,0 +1,78 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(page) { + // [START dialogflow_v3_generated_Pages_UpdatePage_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The page to update. + */ + // const page = '' + /** + * The language of the following fields in `page`: + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {PagesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new PagesClient(); + + async function updatePage() { + // Construct request + const request = { + page, + }; + + // Run request + const response = await cxClient.updatePage(request); + console.log(response); + } + + updatePage(); + // [END dialogflow_v3_generated_Pages_UpdatePage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.create_security_settings.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.create_security_settings.js new file mode 100644 index 00000000000..1fd7f36bee5 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.create_security_settings.js @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, securitySettings) { + // [START dialogflow_v3_generated_SecuritySettingsService_CreateSecuritySettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location to create an [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings] for. + * Format: `projects//locations/`. + */ + // const parent = 'abc123' + /** + * Required. The security settings to create. + */ + // const securitySettings = '' + + // Imports the Cx library + const {SecuritySettingsServiceClient} = + require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SecuritySettingsServiceClient(); + + async function createSecuritySettings() { + // Construct request + const request = { + parent, + securitySettings, + }; + + // Run request + const response = await cxClient.createSecuritySettings(request); + console.log(response); + } + + createSecuritySettings(); + // [END dialogflow_v3_generated_SecuritySettingsService_CreateSecuritySettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.delete_security_settings.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.delete_security_settings.js new file mode 100644 index 00000000000..617296a164c --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.delete_security_settings.js @@ -0,0 +1,55 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_SecuritySettingsService_DeleteSecuritySettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings] to delete. + * Format: `projects//locations//securitySettings/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {SecuritySettingsServiceClient} = + require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SecuritySettingsServiceClient(); + + async function deleteSecuritySettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteSecuritySettings(request); + console.log(response); + } + + deleteSecuritySettings(); + // [END dialogflow_v3_generated_SecuritySettingsService_DeleteSecuritySettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.get_security_settings.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.get_security_settings.js new file mode 100644 index 00000000000..df24b4fdfb6 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.get_security_settings.js @@ -0,0 +1,55 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_SecuritySettingsService_GetSecuritySettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the settings. + * Format: `projects//locations//securitySettings/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {SecuritySettingsServiceClient} = + require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SecuritySettingsServiceClient(); + + async function getSecuritySettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getSecuritySettings(request); + console.log(response); + } + + getSecuritySettings(); + // [END dialogflow_v3_generated_SecuritySettingsService_GetSecuritySettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.list_security_settings.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.list_security_settings.js new file mode 100644 index 00000000000..01d8d7a8e41 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.list_security_settings.js @@ -0,0 +1,65 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3_generated_SecuritySettingsService_ListSecuritySettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location to list all security settings for. + * Format: `projects//locations/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {SecuritySettingsServiceClient} = + require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SecuritySettingsServiceClient(); + + async function listSecuritySettings() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listSecuritySettingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listSecuritySettings(); + // [END dialogflow_v3_generated_SecuritySettingsService_ListSecuritySettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.update_security_settings.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.update_security_settings.js new file mode 100644 index 00000000000..58f15cfd149 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/security_settings_service.update_security_settings.js @@ -0,0 +1,60 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(securitySettings, updateMask) { + // [START dialogflow_v3_generated_SecuritySettingsService_UpdateSecuritySettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. [SecuritySettings] object that contains values for each of the + * fields to update. + */ + // const securitySettings = '' + /** + * Required. The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {SecuritySettingsServiceClient} = + require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SecuritySettingsServiceClient(); + + async function updateSecuritySettings() { + // Construct request + const request = { + securitySettings, + updateMask, + }; + + // Run request + const response = await cxClient.updateSecuritySettings(request); + console.log(response); + } + + updateSecuritySettings(); + // [END dialogflow_v3_generated_SecuritySettingsService_UpdateSecuritySettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.create_session_entity_type.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.create_session_entity_type.js new file mode 100644 index 00000000000..7dcdd914718 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.create_session_entity_type.js @@ -0,0 +1,62 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, sessionEntityType) { + // [START dialogflow_v3_generated_SessionEntityTypes_CreateSessionEntityType_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The session to create a session entity type for. + * Format: `projects//locations//agents//sessions/` or `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + */ + // const parent = 'abc123' + /** + * Required. The session entity type to create. + */ + // const sessionEntityType = '' + + // Imports the Cx library + const {SessionEntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SessionEntityTypesClient(); + + async function createSessionEntityType() { + // Construct request + const request = { + parent, + sessionEntityType, + }; + + // Run request + const response = await cxClient.createSessionEntityType(request); + console.log(response); + } + + createSessionEntityType(); + // [END dialogflow_v3_generated_SessionEntityTypes_CreateSessionEntityType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.delete_session_entity_type.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.delete_session_entity_type.js new file mode 100644 index 00000000000..3ca267c5075 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.delete_session_entity_type.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_SessionEntityTypes_DeleteSessionEntityType_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the session entity type to delete. + * Format: `projects//locations//agents//sessions//entityTypes/` or + * `projects//locations//agents//environments//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + * environment. + */ + // const name = 'abc123' + + // Imports the Cx library + const {SessionEntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SessionEntityTypesClient(); + + async function deleteSessionEntityType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteSessionEntityType(request); + console.log(response); + } + + deleteSessionEntityType(); + // [END dialogflow_v3_generated_SessionEntityTypes_DeleteSessionEntityType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.get_session_entity_type.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.get_session_entity_type.js new file mode 100644 index 00000000000..8b9214f2edc --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.get_session_entity_type.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_SessionEntityTypes_GetSessionEntityType_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the session entity type. + * Format: `projects//locations//agents//sessions//entityTypes/` or + * `projects//locations//agents//environments//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + * environment. + */ + // const name = 'abc123' + + // Imports the Cx library + const {SessionEntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SessionEntityTypesClient(); + + async function getSessionEntityType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getSessionEntityType(request); + console.log(response); + } + + getSessionEntityType(); + // [END dialogflow_v3_generated_SessionEntityTypes_GetSessionEntityType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.list_session_entity_types.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.list_session_entity_types.js new file mode 100644 index 00000000000..116ade0e4cd --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.list_session_entity_types.js @@ -0,0 +1,68 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3_generated_SessionEntityTypes_ListSessionEntityTypes_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The session to list all session entity types from. + * Format: `projects//locations//agents//sessions/` or `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {SessionEntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SessionEntityTypesClient(); + + async function listSessionEntityTypes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listSessionEntityTypesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listSessionEntityTypes(); + // [END dialogflow_v3_generated_SessionEntityTypes_ListSessionEntityTypes_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.update_session_entity_type.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.update_session_entity_type.js new file mode 100644 index 00000000000..388acabb17f --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/session_entity_types.update_session_entity_type.js @@ -0,0 +1,62 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(sessionEntityType) { + // [START dialogflow_v3_generated_SessionEntityTypes_UpdateSessionEntityType_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The session entity type to update. + * Format: `projects//locations//agents//sessions//entityTypes/` or + * `projects//locations//agents//environments//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + * environment. + */ + // const sessionEntityType = '' + /** + * The mask to control which fields get updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {SessionEntityTypesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SessionEntityTypesClient(); + + async function updateSessionEntityType() { + // Construct request + const request = { + sessionEntityType, + }; + + // Run request + const response = await cxClient.updateSessionEntityType(request); + console.log(response); + } + + updateSessionEntityType(); + // [END dialogflow_v3_generated_SessionEntityTypes_UpdateSessionEntityType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.detect_intent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.detect_intent.js new file mode 100644 index 00000000000..8fafaa21342 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.detect_intent.js @@ -0,0 +1,78 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(session, queryInput) { + // [START dialogflow_v3_generated_Sessions_DetectIntent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the session this query is sent to. + * Format: `projects//locations//agents//sessions/` or `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * It's up to the API caller to choose an appropriate `Session ID`. It can be + * a random number or some type of session identifiers (preferably hashed). + * The length of the `Session ID` must not exceed 36 characters. + * For more information, see the [sessions + * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + */ + // const session = 'abc123' + /** + * The parameters of this query. + */ + // const queryParams = '' + /** + * Required. The input specification. + */ + // const queryInput = '' + /** + * Instructs the speech synthesizer how to generate the output audio. + */ + // const outputAudioConfig = '' + + // Imports the Cx library + const {SessionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SessionsClient(); + + async function detectIntent() { + // Construct request + const request = { + session, + queryInput, + }; + + // Run request + const response = await cxClient.detectIntent(request); + console.log(response); + } + + detectIntent(); + // [END dialogflow_v3_generated_Sessions_DetectIntent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.fulfill_intent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.fulfill_intent.js new file mode 100644 index 00000000000..5d6e42727f6 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.fulfill_intent.js @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main() { + // [START dialogflow_v3_generated_Sessions_FulfillIntent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Must be same as the corresponding MatchIntent request, otherwise the + * behavior is undefined. + */ + // const matchIntentRequest = '' + /** + * The matched intent/event to fulfill. + */ + // const match = '' + /** + * Instructs the speech synthesizer how to generate output audio. + */ + // const outputAudioConfig = '' + + // Imports the Cx library + const {SessionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SessionsClient(); + + async function fulfillIntent() { + // Construct request + const request = {}; + + // Run request + const response = await cxClient.fulfillIntent(request); + console.log(response); + } + + fulfillIntent(); + // [END dialogflow_v3_generated_Sessions_FulfillIntent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.match_intent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.match_intent.js new file mode 100644 index 00000000000..05580a4631e --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.match_intent.js @@ -0,0 +1,71 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(session, queryInput) { + // [START dialogflow_v3_generated_Sessions_MatchIntent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the session this query is sent to. + * Format: `projects//locations//agents//sessions/` or `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * It's up to the API caller to choose an appropriate `Session ID`. It can be + * a random number or some type of session identifiers (preferably hashed). + * The length of the `Session ID` must not exceed 36 characters. + * For more information, see the [sessions + * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + */ + // const session = 'abc123' + /** + * The parameters of this query. + */ + // const queryParams = '' + /** + * Required. The input specification. + */ + // const queryInput = '' + + // Imports the Cx library + const {SessionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SessionsClient(); + + async function matchIntent() { + // Construct request + const request = { + session, + queryInput, + }; + + // Run request + const response = await cxClient.matchIntent(request); + console.log(response); + } + + matchIntent(); + // [END dialogflow_v3_generated_Sessions_MatchIntent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.streaming_detect_intent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.streaming_detect_intent.js new file mode 100644 index 00000000000..3aa9a7ed5f4 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/sessions.streaming_detect_intent.js @@ -0,0 +1,95 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(queryInput) { + // [START dialogflow_v3_generated_Sessions_StreamingDetectIntent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name of the session this query is sent to. + * Format: `projects//locations//agents//sessions/` or `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * It's up to the API caller to choose an appropriate `Session ID`. It can be + * a random number or some type of session identifiers (preferably hashed). + * The length of the `Session ID` must not exceed 36 characters. + * Note: session must be set in the first request. + * For more information, see the [sessions + * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + */ + // const session = 'abc123' + /** + * The parameters of this query. + */ + // const queryParams = '' + /** + * Required. The input specification. + */ + // const queryInput = '' + /** + * Instructs the speech synthesizer how to generate the output audio. + */ + // const outputAudioConfig = '' + /** + * Enable partial detect intent response. If this flag is not enabled, + * response stream still contains only one final `DetectIntentResponse` even + * if some `Fulfillment`s in the agent have been configured to return partial + * responses. + */ + // const enablePartialResponse = true + + // Imports the Cx library + const {SessionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new SessionsClient(); + + async function streamingDetectIntent() { + // Construct request + const request = { + queryInput, + }; + + // Run request + const stream = await cxClient.streamingDetectIntent(); + stream.on('data', response => { + console.log(response); + }); + stream.on('error', err => { + throw err; + }); + stream.on('end', () => { + /* API call completed */ + }); + stream.write(request); + stream.end(); + } + + streamingDetectIntent(); + // [END dialogflow_v3_generated_Sessions_StreamingDetectIntent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.batch_delete_test_cases.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.batch_delete_test_cases.js new file mode 100644 index 00000000000..4e751fb3378 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.batch_delete_test_cases.js @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, names) { + // [START dialogflow_v3_generated_TestCases_BatchDeleteTestCases_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to delete test cases from. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. Format of test case names: `projects//locations/ + * /agents//testCases/`. + */ + // const names = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function batchDeleteTestCases() { + // Construct request + const request = { + parent, + names, + }; + + // Run request + const response = await cxClient.batchDeleteTestCases(request); + console.log(response); + } + + batchDeleteTestCases(); + // [END dialogflow_v3_generated_TestCases_BatchDeleteTestCases_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.batch_run_test_cases.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.batch_run_test_cases.js new file mode 100644 index 00000000000..e7d22785102 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.batch_run_test_cases.js @@ -0,0 +1,66 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, testCases) { + // [START dialogflow_v3_generated_TestCases_BatchRunTestCases_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Agent name. Format: `projects//locations//agents/ + * `. + */ + // const parent = 'abc123' + /** + * Optional. If not set, draft environment is assumed. Format: `projects//locations//agents//environments/`. + */ + // const environment = 'abc123' + /** + * Required. Format: `projects//locations//agents//testCases/`. + */ + // const testCases = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function batchRunTestCases() { + // Construct request + const request = { + parent, + testCases, + }; + + // Run request + const [operation] = await cxClient.batchRunTestCases(request); + const [response] = await operation.promise(); + console.log(response); + } + + batchRunTestCases(); + // [END dialogflow_v3_generated_TestCases_BatchRunTestCases_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.calculate_coverage.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.calculate_coverage.js new file mode 100644 index 00000000000..f1af45092a6 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.calculate_coverage.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(agent, type) { + // [START dialogflow_v3_generated_TestCases_CalculateCoverage_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to calculate coverage for. + * Format: `projects//locations//agents/`. + */ + // const agent = 'abc123' + /** + * Required. The type of coverage requested. + */ + // const type = '' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function calculateCoverage() { + // Construct request + const request = { + agent, + type, + }; + + // Run request + const response = await cxClient.calculateCoverage(request); + console.log(response); + } + + calculateCoverage(); + // [END dialogflow_v3_generated_TestCases_CalculateCoverage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.create_test_case.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.create_test_case.js new file mode 100644 index 00000000000..90b4b4f8eaf --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.create_test_case.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, testCase) { + // [START dialogflow_v3_generated_TestCases_CreateTestCase_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to create the test case for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The test case to create. + */ + // const testCase = '' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function createTestCase() { + // Construct request + const request = { + parent, + testCase, + }; + + // Run request + const response = await cxClient.createTestCase(request); + console.log(response); + } + + createTestCase(); + // [END dialogflow_v3_generated_TestCases_CreateTestCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.export_test_cases.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.export_test_cases.js new file mode 100644 index 00000000000..87de73a69f7 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.export_test_cases.js @@ -0,0 +1,76 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3_generated_TestCases_ExportTestCases_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent where to export test cases from. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to + * export the test cases to. The format of this URI must be + * `gs:///`. If unspecified, the serialized test + * cases is returned inline. + */ + // const gcsUri = 'abc123' + /** + * The data format of the exported test cases. If not specified, `BLOB` is + * assumed. + */ + // const dataFormat = '' + /** + * The filter expression used to filter exported test cases, see + * [API Filtering](https://aip.dev/160). The expression is case insensitive + * and supports the following syntax: + * name = [OR name = ] ... + * For example: + * * "name = t1 OR name = t2" matches the test case with the exact resource + * name "t1" or "t2". + */ + // const filter = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function exportTestCases() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await cxClient.exportTestCases(request); + const [response] = await operation.promise(); + console.log(response); + } + + exportTestCases(); + // [END dialogflow_v3_generated_TestCases_ExportTestCases_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.get_test_case.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.get_test_case.js new file mode 100644 index 00000000000..28bedad6f58 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.get_test_case.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_TestCases_GetTestCase_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the testcase. + * Format: `projects//locations//agents//testCases/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function getTestCase() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getTestCase(request); + console.log(response); + } + + getTestCase(); + // [END dialogflow_v3_generated_TestCases_GetTestCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.get_test_case_result.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.get_test_case_result.js new file mode 100644 index 00000000000..a4588dce0b5 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.get_test_case_result.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_TestCases_GetTestCaseResult_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the testcase. + * Format: `projects//locations//agents//testCases//results/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function getTestCaseResult() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getTestCaseResult(request); + console.log(response); + } + + getTestCaseResult(); + // [END dialogflow_v3_generated_TestCases_GetTestCaseResult_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.import_test_cases.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.import_test_cases.js new file mode 100644 index 00000000000..7c140391d2a --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.import_test_cases.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3_generated_TestCases_ImportTestCases_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to import test cases to. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + * to import test cases from. The format of this URI must be + * `gs:///`. + */ + // const gcsUri = 'abc123' + /** + * Uncompressed raw byte content for test cases. + */ + // const content = 'Buffer.from('string')' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function importTestCases() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await cxClient.importTestCases(request); + const [response] = await operation.promise(); + console.log(response); + } + + importTestCases(); + // [END dialogflow_v3_generated_TestCases_ImportTestCases_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.list_test_case_results.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.list_test_case_results.js new file mode 100644 index 00000000000..a0e9c155a33 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.list_test_case_results.js @@ -0,0 +1,88 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3_generated_TestCases_ListTestCaseResults_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The test case to list results for. + * Format: `projects//locations//agents// + * testCases/`. Specify a `-` as a wildcard for TestCase ID to + * list results across multiple test cases. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + /** + * The filter expression used to filter test case results. See + * [API Filtering](https://aip.dev/160). + * The expression is case insensitive. Only 'AND' is supported for logical + * operators. The supported syntax is listed below in detail: + * [AND ] ... + * [AND latest] + * The supported fields and operators are: + * field operator + * `environment` `=`, `IN` (Use value `draft` for draft environment) + * `test_time` `>`, `<` + * `latest` only returns the latest test result in all results for each test + * case. + * Examples: + * * "environment=draft AND latest" matches the latest test result for each + * test case in the draft environment. + * * "environment IN (e1,e2)" matches any test case results with an + * environment resource name of either "e1" or "e2". + * * "test_time > 1602540713" matches any test case results with test time + * later than a unix timestamp in seconds 1602540713. + */ + // const filter = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function listTestCaseResults() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listTestCaseResultsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listTestCaseResults(); + // [END dialogflow_v3_generated_TestCases_ListTestCaseResults_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.list_test_cases.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.list_test_cases.js new file mode 100644 index 00000000000..8f8e1707e66 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.list_test_cases.js @@ -0,0 +1,69 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3_generated_TestCases_ListTestCases_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to list all pages for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20. + * Note that when TestCaseView = FULL, the maximum page size allowed is 20. + * When TestCaseView = BASIC, the maximum page size allowed is 500. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + /** + * Specifies whether response should include all fields or just the metadata. + */ + // const view = '' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function listTestCases() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listTestCasesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listTestCases(); + // [END dialogflow_v3_generated_TestCases_ListTestCases_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.run_test_case.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.run_test_case.js new file mode 100644 index 00000000000..e63d028926b --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.run_test_case.js @@ -0,0 +1,60 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_TestCases_RunTestCase_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Format of test case name to run: `projects//locations/ + * /agents//testCases/`. + */ + // const name = 'abc123' + /** + * Optional. Environment name. If not set, draft environment is assumed. + * Format: `projects//locations//agents//environments/`. + */ + // const environment = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function runTestCase() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.runTestCase(request); + const [response] = await operation.promise(); + console.log(response); + } + + runTestCase(); + // [END dialogflow_v3_generated_TestCases_RunTestCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.update_test_case.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.update_test_case.js new file mode 100644 index 00000000000..e78b2059f2e --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/test_cases.update_test_case.js @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(testCase, updateMask) { + // [START dialogflow_v3_generated_TestCases_UpdateTestCase_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The test case to update. + */ + // const testCase = '' + /** + * Required. The mask to specify which fields should be updated. The + * [`creationTime`][google.cloud.dialogflow.cx.v3.TestCase.creation_time] and + * [`lastTestResult`][google.cloud.dialogflow.cx.v3.TestCase.last_test_result] cannot be updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function updateTestCase() { + // Construct request + const request = { + testCase, + updateMask, + }; + + // Run request + const response = await cxClient.updateTestCase(request); + console.log(response); + } + + updateTestCase(); + // [END dialogflow_v3_generated_TestCases_UpdateTestCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.create_transition_route_group.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.create_transition_route_group.js new file mode 100644 index 00000000000..ada27d139b7 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.create_transition_route_group.js @@ -0,0 +1,72 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, transitionRouteGroup) { + // [START dialogflow_v3_generated_TransitionRouteGroups_CreateTransitionRouteGroup_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The flow to create an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] for. + * Format: `projects//locations//agents//flows/`. + */ + // const parent = 'abc123' + /** + * Required. The transition route group to create. + */ + // const transitionRouteGroup = '' + /** + * The language of the following fields in `TransitionRouteGroup`: + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {TransitionRouteGroupsClient} = + require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TransitionRouteGroupsClient(); + + async function createTransitionRouteGroup() { + // Construct request + const request = { + parent, + transitionRouteGroup, + }; + + // Run request + const response = await cxClient.createTransitionRouteGroup(request); + console.log(response); + } + + createTransitionRouteGroup(); + // [END dialogflow_v3_generated_TransitionRouteGroups_CreateTransitionRouteGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.delete_transition_route_group.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.delete_transition_route_group.js new file mode 100644 index 00000000000..467a90c130d --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.delete_transition_route_group.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] to delete. + * Format: `projects//locations//agents//flows//transitionRouteGroups/`. + */ + // const name = 'abc123' + /** + * This field has no effect for transition route group that no page is using. + * If the transition route group is referenced by any page: + * * If `force` is set to false, an error will be returned with message + * indicating pages that reference the transition route group. + * * If `force` is set to true, Dialogflow will remove the transition route + * group, as well as any reference to it. + */ + // const force = true + + // Imports the Cx library + const {TransitionRouteGroupsClient} = + require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TransitionRouteGroupsClient(); + + async function deleteTransitionRouteGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteTransitionRouteGroup(request); + console.log(response); + } + + deleteTransitionRouteGroup(); + // [END dialogflow_v3_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.get_transition_route_group.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.get_transition_route_group.js new file mode 100644 index 00000000000..ad6e6263b3a --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.get_transition_route_group.js @@ -0,0 +1,68 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_TransitionRouteGroups_GetTransitionRouteGroup_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. + * Format: `projects//locations//agents//flows//transitionRouteGroups/`. + */ + // const name = 'abc123' + /** + * The language to retrieve the transition route group for. The following + * fields are language dependent: + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {TransitionRouteGroupsClient} = + require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TransitionRouteGroupsClient(); + + async function getTransitionRouteGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getTransitionRouteGroup(request); + console.log(response); + } + + getTransitionRouteGroup(); + // [END dialogflow_v3_generated_TransitionRouteGroups_GetTransitionRouteGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.list_transition_route_groups.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.list_transition_route_groups.js new file mode 100644 index 00000000000..8e6cb9deae0 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.list_transition_route_groups.js @@ -0,0 +1,79 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3_generated_TransitionRouteGroups_ListTransitionRouteGroups_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The flow to list all transition route groups for. + * Format: `projects//locations//agents//flows/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + /** + * The language to list transition route groups for. The following fields are + * language dependent: + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {TransitionRouteGroupsClient} = + require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TransitionRouteGroupsClient(); + + async function listTransitionRouteGroups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listTransitionRouteGroupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listTransitionRouteGroups(); + // [END dialogflow_v3_generated_TransitionRouteGroups_ListTransitionRouteGroups_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.update_transition_route_group.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.update_transition_route_group.js new file mode 100644 index 00000000000..5af6812895f --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/transition_route_groups.update_transition_route_group.js @@ -0,0 +1,69 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(transitionRouteGroup) { + // [START dialogflow_v3_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The transition route group to update. + */ + // const transitionRouteGroup = '' + /** + * The mask to control which fields get updated. + */ + // const updateMask = '' + /** + * The language of the following fields in `TransitionRouteGroup`: + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {TransitionRouteGroupsClient} = + require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new TransitionRouteGroupsClient(); + + async function updateTransitionRouteGroup() { + // Construct request + const request = { + transitionRouteGroup, + }; + + // Run request + const response = await cxClient.updateTransitionRouteGroup(request); + console.log(response); + } + + updateTransitionRouteGroup(); + // [END dialogflow_v3_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.create_version.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.create_version.js new file mode 100644 index 00000000000..60ac478aa2a --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.create_version.js @@ -0,0 +1,60 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, version) { + // [START dialogflow_v3_generated_Versions_CreateVersion_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow] to create an [Version][google.cloud.dialogflow.cx.v3.Version] for. + * Format: `projects//locations//agents//flows/`. + */ + // const parent = 'abc123' + /** + * Required. The version to create. + */ + // const version = '' + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function createVersion() { + // Construct request + const request = { + parent, + version, + }; + + // Run request + const [operation] = await cxClient.createVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + createVersion(); + // [END dialogflow_v3_generated_Versions_CreateVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.delete_version.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.delete_version.js new file mode 100644 index 00000000000..239e0675b24 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.delete_version.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Versions_DeleteVersion_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the [Version][google.cloud.dialogflow.cx.v3.Version] to delete. + * Format: `projects//locations//agents//flows//versions/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function deleteVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteVersion(request); + console.log(response); + } + + deleteVersion(); + // [END dialogflow_v3_generated_Versions_DeleteVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.get_version.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.get_version.js new file mode 100644 index 00000000000..f4087dbaf0f --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.get_version.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Versions_GetVersion_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the [Version][google.cloud.dialogflow.cx.v3.Version]. + * Format: `projects//locations//agents//flows//versions/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function getVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getVersion(request); + console.log(response); + } + + getVersion(); + // [END dialogflow_v3_generated_Versions_GetVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.list_versions.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.list_versions.js new file mode 100644 index 00000000000..b273dd0947c --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.list_versions.js @@ -0,0 +1,65 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3_generated_Versions_ListVersions_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow] to list all versions for. + * Format: `projects//locations//agents//flows/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function listVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listVersions(); + // [END dialogflow_v3_generated_Versions_ListVersions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.load_version.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.load_version.js new file mode 100644 index 00000000000..b56abbb42b5 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.load_version.js @@ -0,0 +1,62 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Versions_LoadVersion_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The [Version][google.cloud.dialogflow.cx.v3.Version] to be loaded to draft flow. + * Format: `projects//locations//agents//flows//versions/`. + */ + // const name = 'abc123' + /** + * This field is used to prevent accidental overwrite of other agent + * resources, which can potentially impact other flow's behavior. If + * `allow_override_agent_resources` is false, conflicted agent-level resources + * will not be overridden (i.e. intents, entities, webhooks). + */ + // const allowOverrideAgentResources = true + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function loadVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.loadVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + loadVersion(); + // [END dialogflow_v3_generated_Versions_LoadVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.update_version.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.update_version.js new file mode 100644 index 00000000000..09d135950d1 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/versions.update_version.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(version, updateMask) { + // [START dialogflow_v3_generated_Versions_UpdateVersion_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The version to update. + */ + // const version = '' + /** + * Required. The mask to control which fields get updated. Currently only `description` + * and `display_name` can be updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function updateVersion() { + // Construct request + const request = { + version, + updateMask, + }; + + // Run request + const response = await cxClient.updateVersion(request); + console.log(response); + } + + updateVersion(); + // [END dialogflow_v3_generated_Versions_UpdateVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.create_webhook.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.create_webhook.js new file mode 100644 index 00000000000..21dcabe7756 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.create_webhook.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, webhook) { + // [START dialogflow_v3_generated_Webhooks_CreateWebhook_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to create a webhook for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The webhook to create. + */ + // const webhook = '' + + // Imports the Cx library + const {WebhooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new WebhooksClient(); + + async function createWebhook() { + // Construct request + const request = { + parent, + webhook, + }; + + // Run request + const response = await cxClient.createWebhook(request); + console.log(response); + } + + createWebhook(); + // [END dialogflow_v3_generated_Webhooks_CreateWebhook_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.delete_webhook.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.delete_webhook.js new file mode 100644 index 00000000000..a2e09ad9724 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.delete_webhook.js @@ -0,0 +1,65 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Webhooks_DeleteWebhook_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the webhook to delete. + * Format: `projects//locations//agents//webhooks/`. + */ + // const name = 'abc123' + /** + * This field has no effect for webhook not being used. + * For webhooks that are used by pages/flows/transition route groups: + * * If `force` is set to false, an error will be returned with message + * indicating the referenced resources. + * * If `force` is set to true, Dialogflow will remove the webhook, as well + * as any references to the webhook (i.e. [Webhook][google.cloud.dialogflow.cx.v3.Fulfillment.webhook] + * and [tag][google.cloud.dialogflow.cx.v3.Fulfillment.tag]in fulfillments that point to this webhook + * will be removed). + */ + // const force = true + + // Imports the Cx library + const {WebhooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new WebhooksClient(); + + async function deleteWebhook() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteWebhook(request); + console.log(response); + } + + deleteWebhook(); + // [END dialogflow_v3_generated_Webhooks_DeleteWebhook_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.get_webhook.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.get_webhook.js new file mode 100644 index 00000000000..776fce73c29 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.get_webhook.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3_generated_Webhooks_GetWebhook_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the webhook. + * Format: `projects//locations//agents//webhooks/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {WebhooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new WebhooksClient(); + + async function getWebhook() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getWebhook(request); + console.log(response); + } + + getWebhook(); + // [END dialogflow_v3_generated_Webhooks_GetWebhook_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.list_webhooks.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.list_webhooks.js new file mode 100644 index 00000000000..3a309237bea --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.list_webhooks.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3_generated_Webhooks_ListWebhooks_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to list all webhooks for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {WebhooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new WebhooksClient(); + + async function listWebhooks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listWebhooksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listWebhooks(); + // [END dialogflow_v3_generated_Webhooks_ListWebhooks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.update_webhook.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.update_webhook.js new file mode 100644 index 00000000000..1be9149107e --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/webhooks.update_webhook.js @@ -0,0 +1,57 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(webhook) { + // [START dialogflow_v3_generated_Webhooks_UpdateWebhook_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The webhook to update. + */ + // const webhook = '' + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {WebhooksClient} = require('@google-cloud/dialogflow-cx').v3; + + // Instantiates a client + const cxClient = new WebhooksClient(); + + async function updateWebhook() { + // Construct request + const request = { + webhook, + }; + + // Run request + const response = await cxClient.updateWebhook(request); + console.log(response); + } + + updateWebhook(); + // [END dialogflow_v3_generated_Webhooks_UpdateWebhook_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.create_agent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.create_agent.js new file mode 100644 index 00000000000..3e3356a5f5c --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.create_agent.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, agent) { + // [START dialogflow_v3beta1_generated_Agents_CreateAgent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location to create a agent for. + * Format: `projects//locations/`. + */ + // const parent = 'abc123' + /** + * Required. The agent to create. + */ + // const agent = '' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function createAgent() { + // Construct request + const request = { + parent, + agent, + }; + + // Run request + const response = await cxClient.createAgent(request); + console.log(response); + } + + createAgent(); + // [END dialogflow_v3beta1_generated_Agents_CreateAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.delete_agent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.delete_agent.js new file mode 100644 index 00000000000..34ed2db7a61 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.delete_agent.js @@ -0,0 +1,53 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Agents_DeleteAgent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the agent to delete. + * Format: `projects//locations//agents/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function deleteAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteAgent(request); + console.log(response); + } + + deleteAgent(); + // [END dialogflow_v3beta1_generated_Agents_DeleteAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.export_agent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.export_agent.js new file mode 100644 index 00000000000..f962d1dcc25 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.export_agent.js @@ -0,0 +1,67 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Agents_ExportAgent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the agent to export. + * Format: `projects//locations//agents/`. + */ + // const name = 'abc123' + /** + * Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to + * export the agent to. The format of this URI must be + * `gs:///`. + * If left unspecified, the serialized agent is returned inline. + */ + // const agentUri = 'abc123' + /** + * Optional. Environment name. If not set, draft environment is assumed. + * Format: `projects//locations//agents//environments/`. + */ + // const environment = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function exportAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.exportAgent(request); + const [response] = await operation.promise(); + console.log(response); + } + + exportAgent(); + // [END dialogflow_v3beta1_generated_Agents_ExportAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.get_agent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.get_agent.js new file mode 100644 index 00000000000..b7800b6ab58 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.get_agent.js @@ -0,0 +1,53 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Agents_GetAgent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the agent. + * Format: `projects//locations//agents/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function getAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getAgent(request); + console.log(response); + } + + getAgent(); + // [END dialogflow_v3beta1_generated_Agents_GetAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.get_agent_validation_result.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.get_agent_validation_result.js new file mode 100644 index 00000000000..9aa15c2a5f3 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.get_agent_validation_result.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Agents_GetAgentValidationResult_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent name. + * Format: `projects//locations//agents//validationResult`. + */ + // const name = 'abc123' + /** + * If not specified, the agent's default language is used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function getAgentValidationResult() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getAgentValidationResult(request); + console.log(response); + } + + getAgentValidationResult(); + // [END dialogflow_v3beta1_generated_Agents_GetAgentValidationResult_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.list_agents.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.list_agents.js new file mode 100644 index 00000000000..e7d251497e8 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.list_agents.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3beta1_generated_Agents_ListAgents_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location to list all agents for. + * Format: `projects//locations/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function listAgents() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listAgentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listAgents(); + // [END dialogflow_v3beta1_generated_Agents_ListAgents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.restore_agent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.restore_agent.js new file mode 100644 index 00000000000..bc6f917854d --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.restore_agent.js @@ -0,0 +1,68 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Agents_RestoreAgent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the agent to restore into. + * Format: `projects//locations//agents/`. + */ + // const name = 'abc123' + /** + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + * to restore agent from. The format of this URI must be + * `gs:///`. + */ + // const agentUri = 'abc123' + /** + * Uncompressed raw byte content for agent. + */ + // const agentContent = 'Buffer.from('string')' + /** + * Agent restore mode. If not specified, `KEEP` is assumed. + */ + // const restoreOption = '' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function restoreAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.restoreAgent(request); + const [response] = await operation.promise(); + console.log(response); + } + + restoreAgent(); + // [END dialogflow_v3beta1_generated_Agents_RestoreAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.update_agent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.update_agent.js new file mode 100644 index 00000000000..4b210bcf35e --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.update_agent.js @@ -0,0 +1,57 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(agent) { + // [START dialogflow_v3beta1_generated_Agents_UpdateAgent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to update. + */ + // const agent = '' + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function updateAgent() { + // Construct request + const request = { + agent, + }; + + // Run request + const response = await cxClient.updateAgent(request); + console.log(response); + } + + updateAgent(); + // [END dialogflow_v3beta1_generated_Agents_UpdateAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.validate_agent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.validate_agent.js new file mode 100644 index 00000000000..f5bce219cac --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/agents.validate_agent.js @@ -0,0 +1,57 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Agents_ValidateAgent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to validate. + * Format: `projects//locations//agents/`. + */ + // const name = 'abc123' + /** + * If not specified, the agent's default language is used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {AgentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new AgentsClient(); + + async function validateAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.validateAgent(request); + console.log(response); + } + + validateAgent(); + // [END dialogflow_v3beta1_generated_Agents_ValidateAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.create_entity_type.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.create_entity_type.js new file mode 100644 index 00000000000..0b983297d85 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.create_entity_type.js @@ -0,0 +1,70 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, entityType) { + // [START dialogflow_v3beta1_generated_EntityTypes_CreateEntityType_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to create a entity type for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The entity type to create. + */ + // const entityType = '' + /** + * The language of the following fields in `entity_type`: + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function createEntityType() { + // Construct request + const request = { + parent, + entityType, + }; + + // Run request + const response = await cxClient.createEntityType(request); + console.log(response); + } + + createEntityType(); + // [END dialogflow_v3beta1_generated_EntityTypes_CreateEntityType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.delete_entity_type.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.delete_entity_type.js new file mode 100644 index 00000000000..2070a6c269f --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.delete_entity_type.js @@ -0,0 +1,66 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_EntityTypes_DeleteEntityType_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the entity type to delete. + * Format: `projects//locations//agents//entityTypes/`. + */ + // const name = 'abc123' + /** + * This field has no effect for entity type not being used. + * For entity types that are used by intents or pages: + * * If `force` is set to false, an error will be returned with message + * indicating the referencing resources. + * * If `force` is set to true, Dialogflow will remove the entity type, as + * well as any references to the entity type (i.e. Page + * [parameter][google.cloud.dialogflow.cx.v3beta1.Form.Parameter] of the entity type will be changed to + * '@sys.any' and intent [parameter][google.cloud.dialogflow.cx.v3beta1.Intent.Parameter] of the entity type + * will be removed). + */ + // const force = true + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function deleteEntityType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteEntityType(request); + console.log(response); + } + + deleteEntityType(); + // [END dialogflow_v3beta1_generated_EntityTypes_DeleteEntityType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.get_entity_type.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.get_entity_type.js new file mode 100644 index 00000000000..501ccb1aeaa --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.get_entity_type.js @@ -0,0 +1,67 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_EntityTypes_GetEntityType_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the entity type. + * Format: `projects//locations//agents//entityTypes/`. + */ + // const name = 'abc123' + /** + * The language to retrieve the entity type for. The following fields are + * language dependent: + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function getEntityType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getEntityType(request); + console.log(response); + } + + getEntityType(); + // [END dialogflow_v3beta1_generated_EntityTypes_GetEntityType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.list_entity_types.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.list_entity_types.js new file mode 100644 index 00000000000..1733af6cf8e --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.list_entity_types.js @@ -0,0 +1,77 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3beta1_generated_EntityTypes_ListEntityTypes_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to list all entity types for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The language to list entity types for. The following fields are language + * dependent: + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function listEntityTypes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listEntityTypesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listEntityTypes(); + // [END dialogflow_v3beta1_generated_EntityTypes_ListEntityTypes_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.update_entity_type.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.update_entity_type.js new file mode 100644 index 00000000000..9128b9afb6c --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/entity_types.update_entity_type.js @@ -0,0 +1,68 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(entityType) { + // [START dialogflow_v3beta1_generated_EntityTypes_UpdateEntityType_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The entity type to update. + */ + // const entityType = '' + /** + * The language of the following fields in `entity_type`: + * * `EntityType.entities.value` + * * `EntityType.entities.synonyms` + * * `EntityType.excluded_phrases.value` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The mask to control which fields get updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {EntityTypesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EntityTypesClient(); + + async function updateEntityType() { + // Construct request + const request = { + entityType, + }; + + // Run request + const response = await cxClient.updateEntityType(request); + console.log(response); + } + + updateEntityType(); + // [END dialogflow_v3beta1_generated_EntityTypes_UpdateEntityType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.create_environment.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.create_environment.js new file mode 100644 index 00000000000..84ee99dd6e3 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.create_environment.js @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, environment) { + // [START dialogflow_v3beta1_generated_Environments_CreateEnvironment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to create an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The environment to create. + */ + // const environment = '' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function createEnvironment() { + // Construct request + const request = { + parent, + environment, + }; + + // Run request + const [operation] = await cxClient.createEnvironment(request); + const [response] = await operation.promise(); + console.log(response); + } + + createEnvironment(); + // [END dialogflow_v3beta1_generated_Environments_CreateEnvironment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.delete_environment.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.delete_environment.js new file mode 100644 index 00000000000..f5f66536c92 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.delete_environment.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Environments_DeleteEnvironment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to delete. + * Format: `projects//locations//agents//environments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function deleteEnvironment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteEnvironment(request); + console.log(response); + } + + deleteEnvironment(); + // [END dialogflow_v3beta1_generated_Environments_DeleteEnvironment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.get_environment.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.get_environment.js new file mode 100644 index 00000000000..6fbc382c272 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.get_environment.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Environments_GetEnvironment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + * Format: `projects//locations//agents//environments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function getEnvironment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getEnvironment(request); + console.log(response); + } + + getEnvironment(); + // [END dialogflow_v3beta1_generated_Environments_GetEnvironment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.list_continuous_test_results.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.list_continuous_test_results.js new file mode 100644 index 00000000000..29710ea0515 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.list_continuous_test_results.js @@ -0,0 +1,65 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3beta1_generated_Environments_ListContinuousTestResults_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The environment to list results for. + * Format: `projects//locations//agents// + * environments/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function listContinuousTestResults() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listContinuousTestResultsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listContinuousTestResults(); + // [END dialogflow_v3beta1_generated_Environments_ListContinuousTestResults_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.list_environments.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.list_environments.js new file mode 100644 index 00000000000..e3cc4ce0a6a --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.list_environments.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3beta1_generated_Environments_ListEnvironments_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to list all environments for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function listEnvironments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listEnvironmentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listEnvironments(); + // [END dialogflow_v3beta1_generated_Environments_ListEnvironments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.lookup_environment_history.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.lookup_environment_history.js new file mode 100644 index 00000000000..450bba1797c --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.lookup_environment_history.js @@ -0,0 +1,65 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Environments_LookupEnvironmentHistory_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the environment to look up the history for. + * Format: `projects//locations//agents//environments/`. + */ + // const name = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function lookupEnvironmentHistory() { + // Construct request + const request = { + name, + }; + + // Run request + const iterable = await cxClient.lookupEnvironmentHistoryAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + lookupEnvironmentHistory(); + // [END dialogflow_v3beta1_generated_Environments_LookupEnvironmentHistory_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.run_continuous_test.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.run_continuous_test.js new file mode 100644 index 00000000000..de237f1270e --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.run_continuous_test.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(environment) { + // [START dialogflow_v3beta1_generated_Environments_RunContinuousTest_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Format: `projects//locations//agents//environments/`. + */ + // const environment = 'abc123' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function runContinuousTest() { + // Construct request + const request = { + environment, + }; + + // Run request + const [operation] = await cxClient.runContinuousTest(request); + const [response] = await operation.promise(); + console.log(response); + } + + runContinuousTest(); + // [END dialogflow_v3beta1_generated_Environments_RunContinuousTest_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.update_environment.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.update_environment.js new file mode 100644 index 00000000000..0440677d426 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/environments.update_environment.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(environment, updateMask) { + // [START dialogflow_v3beta1_generated_Environments_UpdateEnvironment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The environment to update. + */ + // const environment = '' + /** + * Required. The mask to control which fields get updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {EnvironmentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new EnvironmentsClient(); + + async function updateEnvironment() { + // Construct request + const request = { + environment, + updateMask, + }; + + // Run request + const [operation] = await cxClient.updateEnvironment(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateEnvironment(); + // [END dialogflow_v3beta1_generated_Environments_UpdateEnvironment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.create_experiment.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.create_experiment.js new file mode 100644 index 00000000000..050da94840b --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.create_experiment.js @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, experiment) { + // [START dialogflow_v3beta1_generated_Experiments_CreateExperiment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to create an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] for. + * Format: `projects//locations//agents//environments/`. + */ + // const parent = 'abc123' + /** + * Required. The experiment to create. + */ + // const experiment = '' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function createExperiment() { + // Construct request + const request = { + parent, + experiment, + }; + + // Run request + const response = await cxClient.createExperiment(request); + console.log(response); + } + + createExperiment(); + // [END dialogflow_v3beta1_generated_Experiments_CreateExperiment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.delete_experiment.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.delete_experiment.js new file mode 100644 index 00000000000..0340adc2fa6 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.delete_experiment.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Experiments_DeleteExperiment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to delete. + * Format: `projects//locations//agents//environments//experiments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function deleteExperiment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteExperiment(request); + console.log(response); + } + + deleteExperiment(); + // [END dialogflow_v3beta1_generated_Experiments_DeleteExperiment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.get_experiment.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.get_experiment.js new file mode 100644 index 00000000000..480e7d04095 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.get_experiment.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Experiments_GetExperiment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + * Format: `projects//locations//agents//environments//experiments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function getExperiment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getExperiment(request); + console.log(response); + } + + getExperiment(); + // [END dialogflow_v3beta1_generated_Experiments_GetExperiment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.list_experiments.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.list_experiments.js new file mode 100644 index 00000000000..8c31152338f --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.list_experiments.js @@ -0,0 +1,65 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3beta1_generated_Experiments_ListExperiments_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to list all environments for. + * Format: `projects//locations//agents//environments/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function listExperiments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listExperimentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listExperiments(); + // [END dialogflow_v3beta1_generated_Experiments_ListExperiments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.start_experiment.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.start_experiment.js new file mode 100644 index 00000000000..56db7a51d9c --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.start_experiment.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Experiments_StartExperiment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the experiment to start. + * Format: `projects//locations//agents//environments//experiments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function startExperiment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.startExperiment(request); + console.log(response); + } + + startExperiment(); + // [END dialogflow_v3beta1_generated_Experiments_StartExperiment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.stop_experiment.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.stop_experiment.js new file mode 100644 index 00000000000..b2440216792 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.stop_experiment.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Experiments_StopExperiment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the experiment to stop. + * Format: `projects//locations//agents//environments//experiments/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function stopExperiment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.stopExperiment(request); + console.log(response); + } + + stopExperiment(); + // [END dialogflow_v3beta1_generated_Experiments_StopExperiment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.update_experiment.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.update_experiment.js new file mode 100644 index 00000000000..2b09d9e87e9 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/experiments.update_experiment.js @@ -0,0 +1,57 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(experiment, updateMask) { + // [START dialogflow_v3beta1_generated_Experiments_UpdateExperiment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The experiment to update. + */ + // const experiment = '' + /** + * Required. The mask to control which fields get updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {ExperimentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new ExperimentsClient(); + + async function updateExperiment() { + // Construct request + const request = { + experiment, + updateMask, + }; + + // Run request + const response = await cxClient.updateExperiment(request); + console.log(response); + } + + updateExperiment(); + // [END dialogflow_v3beta1_generated_Experiments_UpdateExperiment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.create_flow.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.create_flow.js new file mode 100644 index 00000000000..0c587ebd86f --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.create_flow.js @@ -0,0 +1,71 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, flow) { + // [START dialogflow_v3beta1_generated_Flows_CreateFlow_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to create a flow for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The flow to create. + */ + // const flow = '' + /** + * The language of the following fields in `flow`: + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function createFlow() { + // Construct request + const request = { + parent, + flow, + }; + + // Run request + const response = await cxClient.createFlow(request); + console.log(response); + } + + createFlow(); + // [END dialogflow_v3beta1_generated_Flows_CreateFlow_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.delete_flow.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.delete_flow.js new file mode 100644 index 00000000000..2f6b0caac7f --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.delete_flow.js @@ -0,0 +1,66 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Flows_DeleteFlow_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the flow to delete. + * Format: `projects//locations//agents//flows/`. + */ + // const name = 'abc123' + /** + * This field has no effect for flows with no incoming transitions. + * For flows with incoming transitions: + * * If `force` is set to false, an error will be returned with message + * indicating the incoming transitions. + * * If `force` is set to true, Dialogflow will remove the flow, as well as + * any transitions to the flow (i.e. [Target + * flow][EventHandler.target_flow] in event handlers or [Target + * flow][TransitionRoute.target_flow] in transition routes that point to + * this flow will be cleared). + */ + // const force = true + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function deleteFlow() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteFlow(request); + console.log(response); + } + + deleteFlow(); + // [END dialogflow_v3beta1_generated_Flows_DeleteFlow_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.export_flow.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.export_flow.js new file mode 100644 index 00000000000..295dcd5adca --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.export_flow.js @@ -0,0 +1,66 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Flows_ExportFlow_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the flow to export. + * Format: `projects//locations//agents//flows/`. + */ + // const name = 'abc123' + /** + * Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to + * export the flow to. The format of this URI must be + * `gs:///`. + * If left unspecified, the serialized flow is returned inline. + */ + // const flowUri = 'abc123' + /** + * Optional. Whether to export flows referenced by the specified flow. + */ + // const includeReferencedFlows = true + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function exportFlow() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.exportFlow(request); + const [response] = await operation.promise(); + console.log(response); + } + + exportFlow(); + // [END dialogflow_v3beta1_generated_Flows_ExportFlow_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.get_flow.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.get_flow.js new file mode 100644 index 00000000000..78032fb77c1 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.get_flow.js @@ -0,0 +1,68 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Flows_GetFlow_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the flow to get. + * Format: `projects//locations//agents//flows/`. + */ + // const name = 'abc123' + /** + * The language to retrieve the flow for. The following fields are language + * dependent: + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function getFlow() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getFlow(request); + console.log(response); + } + + getFlow(); + // [END dialogflow_v3beta1_generated_Flows_GetFlow_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.get_flow_validation_result.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.get_flow_validation_result.js new file mode 100644 index 00000000000..0dc91916d2b --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.get_flow_validation_result.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Flows_GetFlowValidationResult_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The flow name. + * Format: `projects//locations//agents//flows//validationResult`. + */ + // const name = 'abc123' + /** + * If not specified, the agent's default language is used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function getFlowValidationResult() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getFlowValidationResult(request); + console.log(response); + } + + getFlowValidationResult(); + // [END dialogflow_v3beta1_generated_Flows_GetFlowValidationResult_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.import_flow.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.import_flow.js new file mode 100644 index 00000000000..5307113d8b7 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.import_flow.js @@ -0,0 +1,68 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3beta1_generated_Flows_ImportFlow_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to import the flow into. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + * to import flow from. The format of this URI must be + * `gs:///`. + */ + // const flowUri = 'abc123' + /** + * Uncompressed raw byte content for flow. + */ + // const flowContent = 'Buffer.from('string')' + /** + * Flow import mode. If not specified, `KEEP` is assumed. + */ + // const importOption = '' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function importFlow() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await cxClient.importFlow(request); + const [response] = await operation.promise(); + console.log(response); + } + + importFlow(); + // [END dialogflow_v3beta1_generated_Flows_ImportFlow_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.list_flows.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.list_flows.js new file mode 100644 index 00000000000..59bc09928d8 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.list_flows.js @@ -0,0 +1,78 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3beta1_generated_Flows_ListFlows_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent containing the flows. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + /** + * The language to list flows for. The following fields are language + * dependent: + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function listFlows() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listFlowsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listFlows(); + // [END dialogflow_v3beta1_generated_Flows_ListFlows_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.train_flow.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.train_flow.js new file mode 100644 index 00000000000..f54b0db6dc5 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.train_flow.js @@ -0,0 +1,55 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Flows_TrainFlow_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The flow to train. + * Format: `projects//locations//agents//flows/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function trainFlow() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.trainFlow(request); + const [response] = await operation.promise(); + console.log(response); + } + + trainFlow(); + // [END dialogflow_v3beta1_generated_Flows_TrainFlow_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.update_flow.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.update_flow.js new file mode 100644 index 00000000000..8a11d168738 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.update_flow.js @@ -0,0 +1,70 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(flow) { + // [START dialogflow_v3beta1_generated_Flows_UpdateFlow_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The flow to update. + */ + // const flow = '' + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = '' + /** + * The language of the following fields in `flow`: + * * `Flow.event_handlers.trigger_fulfillment.messages` + * * `Flow.event_handlers.trigger_fulfillment.conditional_cases` + * * `Flow.transition_routes.trigger_fulfillment.messages` + * * `Flow.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function updateFlow() { + // Construct request + const request = { + flow, + }; + + // Run request + const response = await cxClient.updateFlow(request); + console.log(response); + } + + updateFlow(); + // [END dialogflow_v3beta1_generated_Flows_UpdateFlow_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.validate_flow.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.validate_flow.js new file mode 100644 index 00000000000..cbda621125e --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/flows.validate_flow.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Flows_ValidateFlow_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The flow to validate. + * Format: `projects//locations//agents//flows/`. + */ + // const name = 'abc123' + /** + * If not specified, the agent's default language is used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {FlowsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new FlowsClient(); + + async function validateFlow() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.validateFlow(request); + console.log(response); + } + + validateFlow(); + // [END dialogflow_v3beta1_generated_Flows_ValidateFlow_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.create_intent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.create_intent.js new file mode 100644 index 00000000000..2204f2ce2ee --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.create_intent.js @@ -0,0 +1,68 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, intent) { + // [START dialogflow_v3beta1_generated_Intents_CreateIntent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to create an intent for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The intent to create. + */ + // const intent = '' + /** + * The language of the following fields in `intent`: + * * `Intent.training_phrases.parts.text` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function createIntent() { + // Construct request + const request = { + parent, + intent, + }; + + // Run request + const response = await cxClient.createIntent(request); + console.log(response); + } + + createIntent(); + // [END dialogflow_v3beta1_generated_Intents_CreateIntent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.delete_intent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.delete_intent.js new file mode 100644 index 00000000000..8f0d1a4aa48 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.delete_intent.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Intents_DeleteIntent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the intent to delete. + * Format: `projects//locations//agents//intents/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function deleteIntent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteIntent(request); + console.log(response); + } + + deleteIntent(); + // [END dialogflow_v3beta1_generated_Intents_DeleteIntent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.get_intent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.get_intent.js new file mode 100644 index 00000000000..9d129d8e984 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.get_intent.js @@ -0,0 +1,65 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Intents_GetIntent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the intent. + * Format: `projects//locations//agents//intents/`. + */ + // const name = 'abc123' + /** + * The language to retrieve the intent for. The following fields are language + * dependent: + * * `Intent.training_phrases.parts.text` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function getIntent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getIntent(request); + console.log(response); + } + + getIntent(); + // [END dialogflow_v3beta1_generated_Intents_GetIntent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.list_intents.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.list_intents.js new file mode 100644 index 00000000000..78c3f4159f8 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.list_intents.js @@ -0,0 +1,79 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3beta1_generated_Intents_ListIntents_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to list all intents for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The language to list intents for. The following fields are language + * dependent: + * * `Intent.training_phrases.parts.text` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The resource view to apply to the returned intent. + */ + // const intentView = '' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function listIntents() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listIntentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listIntents(); + // [END dialogflow_v3beta1_generated_Intents_ListIntents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.update_intent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.update_intent.js new file mode 100644 index 00000000000..5c707387227 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/intents.update_intent.js @@ -0,0 +1,67 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(intent) { + // [START dialogflow_v3beta1_generated_Intents_UpdateIntent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The intent to update. + */ + // const intent = '' + /** + * The language of the following fields in `intent`: + * * `Intent.training_phrases.parts.text` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {IntentsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new IntentsClient(); + + async function updateIntent() { + // Construct request + const request = { + intent, + }; + + // Run request + const response = await cxClient.updateIntent(request); + console.log(response); + } + + updateIntent(); + // [END dialogflow_v3beta1_generated_Intents_UpdateIntent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.create_page.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.create_page.js new file mode 100644 index 00000000000..35f9d7a2202 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.create_page.js @@ -0,0 +1,80 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, page) { + // [START dialogflow_v3beta1_generated_Pages_CreatePage_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The flow to create a page for. + * Format: `projects//locations//agents//flows/`. + */ + // const parent = 'abc123' + /** + * Required. The page to create. + */ + // const page = '' + /** + * The language of the following fields in `page`: + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {PagesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PagesClient(); + + async function createPage() { + // Construct request + const request = { + parent, + page, + }; + + // Run request + const response = await cxClient.createPage(request); + console.log(response); + } + + createPage(); + // [END dialogflow_v3beta1_generated_Pages_CreatePage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.delete_page.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.delete_page.js new file mode 100644 index 00000000000..a481f19a315 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.delete_page.js @@ -0,0 +1,66 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Pages_DeletePage_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the page to delete. + * Format: `projects//locations//agents//Flows//pages/`. + */ + // const name = 'abc123' + /** + * This field has no effect for pages with no incoming transitions. + * For pages with incoming transitions: + * * If `force` is set to false, an error will be returned with message + * indicating the incoming transitions. + * * If `force` is set to true, Dialogflow will remove the page, as well as + * any transitions to the page (i.e. [Target + * page][EventHandler.target_page] in event handlers or [Target + * page][TransitionRoute.target_page] in transition routes that point to + * this page will be cleared). + */ + // const force = true + + // Imports the Cx library + const {PagesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PagesClient(); + + async function deletePage() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deletePage(request); + console.log(response); + } + + deletePage(); + // [END dialogflow_v3beta1_generated_Pages_DeletePage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.get_page.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.get_page.js new file mode 100644 index 00000000000..b2550e727df --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.get_page.js @@ -0,0 +1,76 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Pages_GetPage_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the page. + * Format: `projects//locations//agents//flows//pages/`. + */ + // const name = 'abc123' + /** + * The language to retrieve the page for. The following fields are language + * dependent: + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {PagesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PagesClient(); + + async function getPage() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getPage(request); + console.log(response); + } + + getPage(); + // [END dialogflow_v3beta1_generated_Pages_GetPage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.list_pages.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.list_pages.js new file mode 100644 index 00000000000..ace4860a938 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.list_pages.js @@ -0,0 +1,87 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3beta1_generated_Pages_ListPages_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The flow to list all pages for. + * Format: `projects//locations//agents//flows/`. + */ + // const parent = 'abc123' + /** + * The language to list pages for. The following fields are language + * dependent: + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {PagesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PagesClient(); + + async function listPages() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listPagesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listPages(); + // [END dialogflow_v3beta1_generated_Pages_ListPages_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.update_page.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.update_page.js new file mode 100644 index 00000000000..c30a0ff4179 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/pages.update_page.js @@ -0,0 +1,78 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(page) { + // [START dialogflow_v3beta1_generated_Pages_UpdatePage_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The page to update. + */ + // const page = '' + /** + * The language of the following fields in `page`: + * * `Page.entry_fulfillment.messages` + * * `Page.entry_fulfillment.conditional_cases` + * * `Page.event_handlers.trigger_fulfillment.messages` + * * `Page.event_handlers.trigger_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + * * + * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases` + * * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + * * + * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases` + * * `Page.transition_routes.trigger_fulfillment.messages` + * * `Page.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {PagesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new PagesClient(); + + async function updatePage() { + // Construct request + const request = { + page, + }; + + // Run request + const response = await cxClient.updatePage(request); + console.log(response); + } + + updatePage(); + // [END dialogflow_v3beta1_generated_Pages_UpdatePage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.create_security_settings.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.create_security_settings.js new file mode 100644 index 00000000000..2893112f70a --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.create_security_settings.js @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, securitySettings) { + // [START dialogflow_v3beta1_generated_SecuritySettingsService_CreateSecuritySettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location to create an [SecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettings] for. + * Format: `projects//locations/`. + */ + // const parent = 'abc123' + /** + * Required. The security settings to create. + */ + // const securitySettings = '' + + // Imports the Cx library + const {SecuritySettingsServiceClient} = + require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SecuritySettingsServiceClient(); + + async function createSecuritySettings() { + // Construct request + const request = { + parent, + securitySettings, + }; + + // Run request + const response = await cxClient.createSecuritySettings(request); + console.log(response); + } + + createSecuritySettings(); + // [END dialogflow_v3beta1_generated_SecuritySettingsService_CreateSecuritySettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.delete_security_settings.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.delete_security_settings.js new file mode 100644 index 00000000000..be150b68184 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.delete_security_settings.js @@ -0,0 +1,55 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_SecuritySettingsService_DeleteSecuritySettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the [SecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettings] to delete. + * Format: `projects//locations//securitySettings/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {SecuritySettingsServiceClient} = + require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SecuritySettingsServiceClient(); + + async function deleteSecuritySettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteSecuritySettings(request); + console.log(response); + } + + deleteSecuritySettings(); + // [END dialogflow_v3beta1_generated_SecuritySettingsService_DeleteSecuritySettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.get_security_settings.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.get_security_settings.js new file mode 100644 index 00000000000..e3a906b5006 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.get_security_settings.js @@ -0,0 +1,55 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_SecuritySettingsService_GetSecuritySettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the settings. + * Format: `projects//locations//securitySettings/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {SecuritySettingsServiceClient} = + require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SecuritySettingsServiceClient(); + + async function getSecuritySettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getSecuritySettings(request); + console.log(response); + } + + getSecuritySettings(); + // [END dialogflow_v3beta1_generated_SecuritySettingsService_GetSecuritySettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.list_security_settings.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.list_security_settings.js new file mode 100644 index 00000000000..4793464bbd5 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.list_security_settings.js @@ -0,0 +1,65 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3beta1_generated_SecuritySettingsService_ListSecuritySettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location to list all security settings for. + * Format: `projects//locations/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {SecuritySettingsServiceClient} = + require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SecuritySettingsServiceClient(); + + async function listSecuritySettings() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listSecuritySettingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listSecuritySettings(); + // [END dialogflow_v3beta1_generated_SecuritySettingsService_ListSecuritySettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.update_security_settings.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.update_security_settings.js new file mode 100644 index 00000000000..6273b51f65a --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/security_settings_service.update_security_settings.js @@ -0,0 +1,60 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(securitySettings, updateMask) { + // [START dialogflow_v3beta1_generated_SecuritySettingsService_UpdateSecuritySettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. [SecuritySettings] object that contains values for each of the + * fields to update. + */ + // const securitySettings = '' + /** + * Required. The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {SecuritySettingsServiceClient} = + require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SecuritySettingsServiceClient(); + + async function updateSecuritySettings() { + // Construct request + const request = { + securitySettings, + updateMask, + }; + + // Run request + const response = await cxClient.updateSecuritySettings(request); + console.log(response); + } + + updateSecuritySettings(); + // [END dialogflow_v3beta1_generated_SecuritySettingsService_UpdateSecuritySettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.create_session_entity_type.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.create_session_entity_type.js new file mode 100644 index 00000000000..8960a21bcb5 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.create_session_entity_type.js @@ -0,0 +1,63 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, sessionEntityType) { + // [START dialogflow_v3beta1_generated_SessionEntityTypes_CreateSessionEntityType_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The session to create a session entity type for. + * Format: `projects//locations//agents//sessions/` or `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + */ + // const parent = 'abc123' + /** + * Required. The session entity type to create. + */ + // const sessionEntityType = '' + + // Imports the Cx library + const {SessionEntityTypesClient} = + require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SessionEntityTypesClient(); + + async function createSessionEntityType() { + // Construct request + const request = { + parent, + sessionEntityType, + }; + + // Run request + const response = await cxClient.createSessionEntityType(request); + console.log(response); + } + + createSessionEntityType(); + // [END dialogflow_v3beta1_generated_SessionEntityTypes_CreateSessionEntityType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.delete_session_entity_type.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.delete_session_entity_type.js new file mode 100644 index 00000000000..f31765a6099 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.delete_session_entity_type.js @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_SessionEntityTypes_DeleteSessionEntityType_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the session entity type to delete. + * Format: `projects//locations//agents//sessions//entityTypes/` or + * `projects//locations//agents//environments//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + * environment. + */ + // const name = 'abc123' + + // Imports the Cx library + const {SessionEntityTypesClient} = + require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SessionEntityTypesClient(); + + async function deleteSessionEntityType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteSessionEntityType(request); + console.log(response); + } + + deleteSessionEntityType(); + // [END dialogflow_v3beta1_generated_SessionEntityTypes_DeleteSessionEntityType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.get_session_entity_type.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.get_session_entity_type.js new file mode 100644 index 00000000000..19d2e679896 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.get_session_entity_type.js @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_SessionEntityTypes_GetSessionEntityType_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the session entity type. + * Format: `projects//locations//agents//sessions//entityTypes/` or + * `projects//locations//agents//environments//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + * environment. + */ + // const name = 'abc123' + + // Imports the Cx library + const {SessionEntityTypesClient} = + require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SessionEntityTypesClient(); + + async function getSessionEntityType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getSessionEntityType(request); + console.log(response); + } + + getSessionEntityType(); + // [END dialogflow_v3beta1_generated_SessionEntityTypes_GetSessionEntityType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.list_session_entity_types.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.list_session_entity_types.js new file mode 100644 index 00000000000..1af4dda6200 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.list_session_entity_types.js @@ -0,0 +1,69 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3beta1_generated_SessionEntityTypes_ListSessionEntityTypes_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The session to list all session entity types from. + * Format: `projects//locations//agents//sessions/` or `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {SessionEntityTypesClient} = + require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SessionEntityTypesClient(); + + async function listSessionEntityTypes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listSessionEntityTypesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listSessionEntityTypes(); + // [END dialogflow_v3beta1_generated_SessionEntityTypes_ListSessionEntityTypes_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.update_session_entity_type.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.update_session_entity_type.js new file mode 100644 index 00000000000..aaca5ad4350 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/session_entity_types.update_session_entity_type.js @@ -0,0 +1,63 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(sessionEntityType) { + // [START dialogflow_v3beta1_generated_SessionEntityTypes_UpdateSessionEntityType_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The session entity type to update. + * Format: `projects//locations//agents//sessions//entityTypes/` or + * `projects//locations//agents//environments//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + * environment. + */ + // const sessionEntityType = '' + /** + * The mask to control which fields get updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {SessionEntityTypesClient} = + require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SessionEntityTypesClient(); + + async function updateSessionEntityType() { + // Construct request + const request = { + sessionEntityType, + }; + + // Run request + const response = await cxClient.updateSessionEntityType(request); + console.log(response); + } + + updateSessionEntityType(); + // [END dialogflow_v3beta1_generated_SessionEntityTypes_UpdateSessionEntityType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.detect_intent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.detect_intent.js new file mode 100644 index 00000000000..90c3abfb69c --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.detect_intent.js @@ -0,0 +1,78 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(session, queryInput) { + // [START dialogflow_v3beta1_generated_Sessions_DetectIntent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the session this query is sent to. + * Format: `projects//locations//agents//sessions/` or `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * It's up to the API caller to choose an appropriate `Session ID`. It can be + * a random number or some type of session identifiers (preferably hashed). + * The length of the `Session ID` must not exceed 36 characters. + * For more information, see the [sessions + * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + */ + // const session = 'abc123' + /** + * The parameters of this query. + */ + // const queryParams = '' + /** + * Required. The input specification. + */ + // const queryInput = '' + /** + * Instructs the speech synthesizer how to generate the output audio. + */ + // const outputAudioConfig = '' + + // Imports the Cx library + const {SessionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SessionsClient(); + + async function detectIntent() { + // Construct request + const request = { + session, + queryInput, + }; + + // Run request + const response = await cxClient.detectIntent(request); + console.log(response); + } + + detectIntent(); + // [END dialogflow_v3beta1_generated_Sessions_DetectIntent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.fulfill_intent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.fulfill_intent.js new file mode 100644 index 00000000000..8e8501299b5 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.fulfill_intent.js @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main() { + // [START dialogflow_v3beta1_generated_Sessions_FulfillIntent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Must be same as the corresponding MatchIntent request, otherwise the + * behavior is undefined. + */ + // const matchIntentRequest = '' + /** + * The matched intent/event to fulfill. + */ + // const match = '' + /** + * Instructs the speech synthesizer how to generate output audio. + */ + // const outputAudioConfig = '' + + // Imports the Cx library + const {SessionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SessionsClient(); + + async function fulfillIntent() { + // Construct request + const request = {}; + + // Run request + const response = await cxClient.fulfillIntent(request); + console.log(response); + } + + fulfillIntent(); + // [END dialogflow_v3beta1_generated_Sessions_FulfillIntent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.match_intent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.match_intent.js new file mode 100644 index 00000000000..354f344bde0 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.match_intent.js @@ -0,0 +1,71 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(session, queryInput) { + // [START dialogflow_v3beta1_generated_Sessions_MatchIntent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the session this query is sent to. + * Format: `projects//locations//agents//sessions/` or `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * It's up to the API caller to choose an appropriate `Session ID`. It can be + * a random number or some type of session identifiers (preferably hashed). + * The length of the `Session ID` must not exceed 36 characters. + * For more information, see the [sessions + * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + */ + // const session = 'abc123' + /** + * The parameters of this query. + */ + // const queryParams = '' + /** + * Required. The input specification. + */ + // const queryInput = '' + + // Imports the Cx library + const {SessionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SessionsClient(); + + async function matchIntent() { + // Construct request + const request = { + session, + queryInput, + }; + + // Run request + const response = await cxClient.matchIntent(request); + console.log(response); + } + + matchIntent(); + // [END dialogflow_v3beta1_generated_Sessions_MatchIntent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.streaming_detect_intent.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.streaming_detect_intent.js new file mode 100644 index 00000000000..44753b16fa8 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/sessions.streaming_detect_intent.js @@ -0,0 +1,95 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(queryInput) { + // [START dialogflow_v3beta1_generated_Sessions_StreamingDetectIntent_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name of the session this query is sent to. + * Format: `projects//locations//agents//sessions/` or `projects//locations//agents//environments//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. + * It's up to the API caller to choose an appropriate `Session ID`. It can be + * a random number or some type of session identifiers (preferably hashed). + * The length of the `Session ID` must not exceed 36 characters. + * Note: session must be set in the first request. + * For more information, see the [sessions + * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + */ + // const session = 'abc123' + /** + * The parameters of this query. + */ + // const queryParams = '' + /** + * Required. The input specification. + */ + // const queryInput = '' + /** + * Instructs the speech synthesizer how to generate the output audio. + */ + // const outputAudioConfig = '' + /** + * Enable partial detect intent response. If this flag is not enabled, + * response stream still contains only one final `DetectIntentResponse` even + * if some `Fulfillment`s in the agent have been configured to return partial + * responses. + */ + // const enablePartialResponse = true + + // Imports the Cx library + const {SessionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new SessionsClient(); + + async function streamingDetectIntent() { + // Construct request + const request = { + queryInput, + }; + + // Run request + const stream = await cxClient.streamingDetectIntent(); + stream.on('data', response => { + console.log(response); + }); + stream.on('error', err => { + throw err; + }); + stream.on('end', () => { + /* API call completed */ + }); + stream.write(request); + stream.end(); + } + + streamingDetectIntent(); + // [END dialogflow_v3beta1_generated_Sessions_StreamingDetectIntent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.batch_delete_test_cases.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.batch_delete_test_cases.js new file mode 100644 index 00000000000..f8cfa64a8b4 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.batch_delete_test_cases.js @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, names) { + // [START dialogflow_v3beta1_generated_TestCases_BatchDeleteTestCases_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to delete test cases from. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. Format of test case names: `projects//locations/ + * /agents//testCases/`. + */ + // const names = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function batchDeleteTestCases() { + // Construct request + const request = { + parent, + names, + }; + + // Run request + const response = await cxClient.batchDeleteTestCases(request); + console.log(response); + } + + batchDeleteTestCases(); + // [END dialogflow_v3beta1_generated_TestCases_BatchDeleteTestCases_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.batch_run_test_cases.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.batch_run_test_cases.js new file mode 100644 index 00000000000..332085fac78 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.batch_run_test_cases.js @@ -0,0 +1,66 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, testCases) { + // [START dialogflow_v3beta1_generated_TestCases_BatchRunTestCases_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Agent name. Format: `projects//locations//agents/ + * `. + */ + // const parent = 'abc123' + /** + * Optional. If not set, draft environment is assumed. Format: `projects//locations//agents//environments/`. + */ + // const environment = 'abc123' + /** + * Required. Format: `projects//locations//agents//testCases/`. + */ + // const testCases = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function batchRunTestCases() { + // Construct request + const request = { + parent, + testCases, + }; + + // Run request + const [operation] = await cxClient.batchRunTestCases(request); + const [response] = await operation.promise(); + console.log(response); + } + + batchRunTestCases(); + // [END dialogflow_v3beta1_generated_TestCases_BatchRunTestCases_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.calculate_coverage.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.calculate_coverage.js new file mode 100644 index 00000000000..82e9c15e448 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.calculate_coverage.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(agent, type) { + // [START dialogflow_v3beta1_generated_TestCases_CalculateCoverage_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to calculate coverage for. + * Format: `projects//locations//agents/`. + */ + // const agent = 'abc123' + /** + * Required. The type of coverage requested. + */ + // const type = '' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function calculateCoverage() { + // Construct request + const request = { + agent, + type, + }; + + // Run request + const response = await cxClient.calculateCoverage(request); + console.log(response); + } + + calculateCoverage(); + // [END dialogflow_v3beta1_generated_TestCases_CalculateCoverage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.create_test_case.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.create_test_case.js new file mode 100644 index 00000000000..5a1e897bc65 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.create_test_case.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, testCase) { + // [START dialogflow_v3beta1_generated_TestCases_CreateTestCase_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to create the test case for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The test case to create. + */ + // const testCase = '' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function createTestCase() { + // Construct request + const request = { + parent, + testCase, + }; + + // Run request + const response = await cxClient.createTestCase(request); + console.log(response); + } + + createTestCase(); + // [END dialogflow_v3beta1_generated_TestCases_CreateTestCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.export_test_cases.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.export_test_cases.js new file mode 100644 index 00000000000..b03c4568583 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.export_test_cases.js @@ -0,0 +1,76 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3beta1_generated_TestCases_ExportTestCases_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent where to export test cases from. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to + * export the test cases to. The format of this URI must be + * `gs:///`. If unspecified, the serialized test + * cases is returned inline. + */ + // const gcsUri = 'abc123' + /** + * The data format of the exported test cases. If not specified, `BLOB` is + * assumed. + */ + // const dataFormat = '' + /** + * The filter expression used to filter exported test cases, see + * [API Filtering](https://aip.dev/160). The expression is case insensitive + * and supports the following syntax: + * name = [OR name = ] ... + * For example: + * * "name = t1 OR name = t2" matches the test case with the exact resource + * name "t1" or "t2". + */ + // const filter = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function exportTestCases() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await cxClient.exportTestCases(request); + const [response] = await operation.promise(); + console.log(response); + } + + exportTestCases(); + // [END dialogflow_v3beta1_generated_TestCases_ExportTestCases_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.get_test_case.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.get_test_case.js new file mode 100644 index 00000000000..2ae3af62bc1 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.get_test_case.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_TestCases_GetTestCase_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the testcase. + * Format: `projects//locations//agents//testCases/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function getTestCase() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getTestCase(request); + console.log(response); + } + + getTestCase(); + // [END dialogflow_v3beta1_generated_TestCases_GetTestCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.get_test_case_result.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.get_test_case_result.js new file mode 100644 index 00000000000..7bbe5e1ba4b --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.get_test_case_result.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_TestCases_GetTestCaseResult_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the testcase. + * Format: `projects//locations//agents//testCases//results/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function getTestCaseResult() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getTestCaseResult(request); + console.log(response); + } + + getTestCaseResult(); + // [END dialogflow_v3beta1_generated_TestCases_GetTestCaseResult_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.import_test_cases.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.import_test_cases.js new file mode 100644 index 00000000000..616d5d56cc7 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.import_test_cases.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3beta1_generated_TestCases_ImportTestCases_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to import test cases to. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + * to import test cases from. The format of this URI must be + * `gs:///`. + */ + // const gcsUri = 'abc123' + /** + * Uncompressed raw byte content for test cases. + */ + // const content = 'Buffer.from('string')' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function importTestCases() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await cxClient.importTestCases(request); + const [response] = await operation.promise(); + console.log(response); + } + + importTestCases(); + // [END dialogflow_v3beta1_generated_TestCases_ImportTestCases_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.list_test_case_results.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.list_test_case_results.js new file mode 100644 index 00000000000..3a0b466db5b --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.list_test_case_results.js @@ -0,0 +1,88 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3beta1_generated_TestCases_ListTestCaseResults_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The test case to list results for. + * Format: `projects//locations//agents// + * testCases/`. Specify a `-` as a wildcard for TestCase ID to + * list results across multiple test cases. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + /** + * The filter expression used to filter test case results. See + * [API Filtering](https://aip.dev/160). + * The expression is case insensitive. Only 'AND' is supported for logical + * operators. The supported syntax is listed below in detail: + * [AND ] ... + * [AND latest] + * The supported fields and operators are: + * field operator + * `environment` `=`, `IN` (Use value `draft` for draft environment) + * `test_time` `>`, `<` + * `latest` only returns the latest test result in all results for each test + * case. + * Examples: + * * "environment=draft AND latest" matches the latest test result for each + * test case in the draft environment. + * * "environment IN (e1,e2)" matches any test case results with an + * environment resource name of either "e1" or "e2". + * * "test_time > 1602540713" matches any test case results with test time + * later than a unix timestamp in seconds 1602540713. + */ + // const filter = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function listTestCaseResults() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listTestCaseResultsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listTestCaseResults(); + // [END dialogflow_v3beta1_generated_TestCases_ListTestCaseResults_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.list_test_cases.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.list_test_cases.js new file mode 100644 index 00000000000..b5ac3b668b3 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.list_test_cases.js @@ -0,0 +1,69 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3beta1_generated_TestCases_ListTestCases_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to list all pages for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20. + * Note that when TestCaseView = FULL, the maximum page size allowed is 20. + * When TestCaseView = BASIC, the maximum page size allowed is 500. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + /** + * Specifies whether response should include all fields or just the metadata. + */ + // const view = '' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function listTestCases() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listTestCasesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listTestCases(); + // [END dialogflow_v3beta1_generated_TestCases_ListTestCases_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.run_test_case.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.run_test_case.js new file mode 100644 index 00000000000..604769d036b --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.run_test_case.js @@ -0,0 +1,60 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_TestCases_RunTestCase_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Format of test case name to run: `projects//locations/ + * /agents//testCases/`. + */ + // const name = 'abc123' + /** + * Optional. Environment name. If not set, draft environment is assumed. + * Format: `projects//locations//agents//environments/`. + */ + // const environment = 'abc123' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function runTestCase() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.runTestCase(request); + const [response] = await operation.promise(); + console.log(response); + } + + runTestCase(); + // [END dialogflow_v3beta1_generated_TestCases_RunTestCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.update_test_case.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.update_test_case.js new file mode 100644 index 00000000000..9c3a69431e2 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/test_cases.update_test_case.js @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(testCase, updateMask) { + // [START dialogflow_v3beta1_generated_TestCases_UpdateTestCase_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The test case to update. + */ + // const testCase = '' + /** + * Required. The mask to specify which fields should be updated. The + * [`creationTime`][google.cloud.dialogflow.cx.v3beta1.TestCase.creation_time] and + * [`lastTestResult`][google.cloud.dialogflow.cx.v3beta1.TestCase.last_test_result] cannot be updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {TestCasesClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TestCasesClient(); + + async function updateTestCase() { + // Construct request + const request = { + testCase, + updateMask, + }; + + // Run request + const response = await cxClient.updateTestCase(request); + console.log(response); + } + + updateTestCase(); + // [END dialogflow_v3beta1_generated_TestCases_UpdateTestCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.create_transition_route_group.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.create_transition_route_group.js new file mode 100644 index 00000000000..2d77e3e8031 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.create_transition_route_group.js @@ -0,0 +1,72 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, transitionRouteGroup) { + // [START dialogflow_v3beta1_generated_TransitionRouteGroups_CreateTransitionRouteGroup_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The flow to create an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] for. + * Format: `projects//locations//agents//flows/`. + */ + // const parent = 'abc123' + /** + * Required. The transition route group to create. + */ + // const transitionRouteGroup = '' + /** + * The language of the following fields in `TransitionRouteGroup`: + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {TransitionRouteGroupsClient} = + require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TransitionRouteGroupsClient(); + + async function createTransitionRouteGroup() { + // Construct request + const request = { + parent, + transitionRouteGroup, + }; + + // Run request + const response = await cxClient.createTransitionRouteGroup(request); + console.log(response); + } + + createTransitionRouteGroup(); + // [END dialogflow_v3beta1_generated_TransitionRouteGroups_CreateTransitionRouteGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.delete_transition_route_group.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.delete_transition_route_group.js new file mode 100644 index 00000000000..925ed35e5fa --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.delete_transition_route_group.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] to delete. + * Format: `projects//locations//agents//flows//transitionRouteGroups/`. + */ + // const name = 'abc123' + /** + * This field has no effect for transition route group that no page is using. + * If the transition route group is referenced by any page: + * * If `force` is set to false, an error will be returned with message + * indicating pages that reference the transition route group. + * * If `force` is set to true, Dialogflow will remove the transition route + * group, as well as any reference to it. + */ + // const force = true + + // Imports the Cx library + const {TransitionRouteGroupsClient} = + require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TransitionRouteGroupsClient(); + + async function deleteTransitionRouteGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteTransitionRouteGroup(request); + console.log(response); + } + + deleteTransitionRouteGroup(); + // [END dialogflow_v3beta1_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.get_transition_route_group.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.get_transition_route_group.js new file mode 100644 index 00000000000..cac837876a1 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.get_transition_route_group.js @@ -0,0 +1,68 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_TransitionRouteGroups_GetTransitionRouteGroup_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + * Format: `projects//locations//agents//flows//transitionRouteGroups/`. + */ + // const name = 'abc123' + /** + * The language to retrieve the transition route group for. The following + * fields are language dependent: + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {TransitionRouteGroupsClient} = + require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TransitionRouteGroupsClient(); + + async function getTransitionRouteGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getTransitionRouteGroup(request); + console.log(response); + } + + getTransitionRouteGroup(); + // [END dialogflow_v3beta1_generated_TransitionRouteGroups_GetTransitionRouteGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.list_transition_route_groups.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.list_transition_route_groups.js new file mode 100644 index 00000000000..fada8dee369 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.list_transition_route_groups.js @@ -0,0 +1,79 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3beta1_generated_TransitionRouteGroups_ListTransitionRouteGroups_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The flow to list all transition route groups for. + * Format: `projects//locations//agents//flows/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + /** + * The language to list transition route groups for. The following fields are + * language dependent: + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {TransitionRouteGroupsClient} = + require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TransitionRouteGroupsClient(); + + async function listTransitionRouteGroups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listTransitionRouteGroupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listTransitionRouteGroups(); + // [END dialogflow_v3beta1_generated_TransitionRouteGroups_ListTransitionRouteGroups_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.update_transition_route_group.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.update_transition_route_group.js new file mode 100644 index 00000000000..bfaef553f7e --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/transition_route_groups.update_transition_route_group.js @@ -0,0 +1,69 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(transitionRouteGroup) { + // [START dialogflow_v3beta1_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The transition route group to update. + */ + // const transitionRouteGroup = '' + /** + * The mask to control which fields get updated. + */ + // const updateMask = '' + /** + * The language of the following fields in `TransitionRouteGroup`: + * * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` + * * + * `TransitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` + * If not specified, the agent's default language is used. + * [Many + * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) + * are supported. + * Note: languages must be enabled in the agent before they can be used. + */ + // const languageCode = 'abc123' + + // Imports the Cx library + const {TransitionRouteGroupsClient} = + require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new TransitionRouteGroupsClient(); + + async function updateTransitionRouteGroup() { + // Construct request + const request = { + transitionRouteGroup, + }; + + // Run request + const response = await cxClient.updateTransitionRouteGroup(request); + console.log(response); + } + + updateTransitionRouteGroup(); + // [END dialogflow_v3beta1_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.create_version.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.create_version.js new file mode 100644 index 00000000000..3397ebe9d50 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.create_version.js @@ -0,0 +1,60 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, version) { + // [START dialogflow_v3beta1_generated_Versions_CreateVersion_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to create an [Version][google.cloud.dialogflow.cx.v3beta1.Version] for. + * Format: `projects//locations//agents//flows/`. + */ + // const parent = 'abc123' + /** + * Required. The version to create. + */ + // const version = '' + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function createVersion() { + // Construct request + const request = { + parent, + version, + }; + + // Run request + const [operation] = await cxClient.createVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + createVersion(); + // [END dialogflow_v3beta1_generated_Versions_CreateVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.delete_version.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.delete_version.js new file mode 100644 index 00000000000..853f74a7e3d --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.delete_version.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Versions_DeleteVersion_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version] to delete. + * Format: `projects//locations//agents//flows//versions/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function deleteVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteVersion(request); + console.log(response); + } + + deleteVersion(); + // [END dialogflow_v3beta1_generated_Versions_DeleteVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.get_version.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.get_version.js new file mode 100644 index 00000000000..ec4ac89405d --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.get_version.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Versions_GetVersion_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + * Format: `projects//locations//agents//flows//versions/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function getVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getVersion(request); + console.log(response); + } + + getVersion(); + // [END dialogflow_v3beta1_generated_Versions_GetVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.list_versions.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.list_versions.js new file mode 100644 index 00000000000..adb67be437f --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.list_versions.js @@ -0,0 +1,65 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3beta1_generated_Versions_ListVersions_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to list all versions for. + * Format: `projects//locations//agents//flows/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function listVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listVersions(); + // [END dialogflow_v3beta1_generated_Versions_ListVersions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.load_version.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.load_version.js new file mode 100644 index 00000000000..ff31b649744 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.load_version.js @@ -0,0 +1,62 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Versions_LoadVersion_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The [Version][google.cloud.dialogflow.cx.v3beta1.Version] to be loaded to draft flow. + * Format: `projects//locations//agents//flows//versions/`. + */ + // const name = 'abc123' + /** + * This field is used to prevent accidental overwrite of other agent + * resources, which can potentially impact other flow's behavior. If + * `allow_override_agent_resources` is false, conflicted agent-level resources + * will not be overridden (i.e. intents, entities, webhooks). + */ + // const allowOverrideAgentResources = true + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function loadVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cxClient.loadVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + loadVersion(); + // [END dialogflow_v3beta1_generated_Versions_LoadVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.update_version.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.update_version.js new file mode 100644 index 00000000000..55ed9dfb407 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/versions.update_version.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(version, updateMask) { + // [START dialogflow_v3beta1_generated_Versions_UpdateVersion_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The version to update. + */ + // const version = '' + /** + * Required. The mask to control which fields get updated. Currently only `description` + * and `display_name` can be updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {VersionsClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new VersionsClient(); + + async function updateVersion() { + // Construct request + const request = { + version, + updateMask, + }; + + // Run request + const response = await cxClient.updateVersion(request); + console.log(response); + } + + updateVersion(); + // [END dialogflow_v3beta1_generated_Versions_UpdateVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.create_webhook.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.create_webhook.js new file mode 100644 index 00000000000..2a2450b3b03 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.create_webhook.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent, webhook) { + // [START dialogflow_v3beta1_generated_Webhooks_CreateWebhook_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to create a webhook for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * Required. The webhook to create. + */ + // const webhook = '' + + // Imports the Cx library + const {WebhooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new WebhooksClient(); + + async function createWebhook() { + // Construct request + const request = { + parent, + webhook, + }; + + // Run request + const response = await cxClient.createWebhook(request); + console.log(response); + } + + createWebhook(); + // [END dialogflow_v3beta1_generated_Webhooks_CreateWebhook_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.delete_webhook.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.delete_webhook.js new file mode 100644 index 00000000000..f653359b3e7 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.delete_webhook.js @@ -0,0 +1,65 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Webhooks_DeleteWebhook_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the webhook to delete. + * Format: `projects//locations//agents//webhooks/`. + */ + // const name = 'abc123' + /** + * This field has no effect for webhook not being used. + * For webhooks that are used by pages/flows/transition route groups: + * * If `force` is set to false, an error will be returned with message + * indicating the referenced resources. + * * If `force` is set to true, Dialogflow will remove the webhook, as well + * as any references to the webhook (i.e. [Webhook][google.cloud.dialogflow.cx.v3beta1.Fulfillment.webhook] + * and [tag][google.cloud.dialogflow.cx.v3beta1.Fulfillment.tag]in fulfillments that point to this webhook + * will be removed). + */ + // const force = true + + // Imports the Cx library + const {WebhooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new WebhooksClient(); + + async function deleteWebhook() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.deleteWebhook(request); + console.log(response); + } + + deleteWebhook(); + // [END dialogflow_v3beta1_generated_Webhooks_DeleteWebhook_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.get_webhook.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.get_webhook.js new file mode 100644 index 00000000000..10e70f297df --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.get_webhook.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(name) { + // [START dialogflow_v3beta1_generated_Webhooks_GetWebhook_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the webhook. + * Format: `projects//locations//agents//webhooks/`. + */ + // const name = 'abc123' + + // Imports the Cx library + const {WebhooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new WebhooksClient(); + + async function getWebhook() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cxClient.getWebhook(request); + console.log(response); + } + + getWebhook(); + // [END dialogflow_v3beta1_generated_Webhooks_GetWebhook_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.list_webhooks.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.list_webhooks.js new file mode 100644 index 00000000000..8faa698c320 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.list_webhooks.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(parent) { + // [START dialogflow_v3beta1_generated_Webhooks_ListWebhooks_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent to list all webhooks for. + * Format: `projects//locations//agents/`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous list request. + */ + // const pageToken = 'abc123' + + // Imports the Cx library + const {WebhooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new WebhooksClient(); + + async function listWebhooks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cxClient.listWebhooksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listWebhooks(); + // [END dialogflow_v3beta1_generated_Webhooks_ListWebhooks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.update_webhook.js b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.update_webhook.js new file mode 100644 index 00000000000..9b972ab0546 --- /dev/null +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/webhooks.update_webhook.js @@ -0,0 +1,57 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(webhook) { + // [START dialogflow_v3beta1_generated_Webhooks_UpdateWebhook_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The webhook to update. + */ + // const webhook = '' + /** + * The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + */ + // const updateMask = '' + + // Imports the Cx library + const {WebhooksClient} = require('@google-cloud/dialogflow-cx').v3beta1; + + // Instantiates a client + const cxClient = new WebhooksClient(); + + async function updateWebhook() { + // Construct request + const request = { + webhook, + }; + + // Run request + const response = await cxClient.updateWebhook(request); + console.log(response); + } + + updateWebhook(); + // [END dialogflow_v3beta1_generated_Webhooks_UpdateWebhook_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dialogflow-cx/src/v3/agents_client.ts b/packages/google-cloud-dialogflow-cx/src/v3/agents_client.ts index ae746292b17..cc4ebdad405 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3/agents_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3/agents_client.ts @@ -1453,7 +1453,8 @@ export class AgentsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listAgents']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAgents.createStream( this.innerApiCalls.listAgents as gax.GaxCall, @@ -1505,7 +1506,8 @@ export class AgentsClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listAgents']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAgents.asyncIterate( this.innerApiCalls['listAgents'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3/entity_types_client.ts b/packages/google-cloud-dialogflow-cx/src/v3/entity_types_client.ts index c5a08b75caa..1ac73caf9dd 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3/entity_types_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3/entity_types_client.ts @@ -976,7 +976,8 @@ export class EntityTypesClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listEntityTypes']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listEntityTypes.createStream( this.innerApiCalls.listEntityTypes as gax.GaxCall, @@ -1041,7 +1042,8 @@ export class EntityTypesClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listEntityTypes']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listEntityTypes.asyncIterate( this.innerApiCalls['listEntityTypes'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3/environments_client.ts b/packages/google-cloud-dialogflow-cx/src/v3/environments_client.ts index 5bddac72bf2..4a2bd68e81b 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3/environments_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3/environments_client.ts @@ -1205,7 +1205,8 @@ export class EnvironmentsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listEnvironments']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listEnvironments.createStream( this.innerApiCalls.listEnvironments as gax.GaxCall, @@ -1257,7 +1258,8 @@ export class EnvironmentsClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listEnvironments']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listEnvironments.asyncIterate( this.innerApiCalls['listEnvironments'] as GaxCall, @@ -1408,7 +1410,8 @@ export class EnvironmentsClient { gax.routingHeader.fromParams({ name: request.name || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['lookupEnvironmentHistory']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.lookupEnvironmentHistory.createStream( this.innerApiCalls.lookupEnvironmentHistory as gax.GaxCall, @@ -1461,7 +1464,8 @@ export class EnvironmentsClient { name: request.name || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['lookupEnvironmentHistory']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.lookupEnvironmentHistory.asyncIterate( this.innerApiCalls['lookupEnvironmentHistory'] as GaxCall, @@ -1612,7 +1616,8 @@ export class EnvironmentsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listContinuousTestResults']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listContinuousTestResults.createStream( this.innerApiCalls.listContinuousTestResults as gax.GaxCall, @@ -1665,7 +1670,8 @@ export class EnvironmentsClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listContinuousTestResults']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listContinuousTestResults.asyncIterate( this.innerApiCalls['listContinuousTestResults'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3/experiments_client.ts b/packages/google-cloud-dialogflow-cx/src/v3/experiments_client.ts index c6db8df08f7..c86c6e82460 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3/experiments_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3/experiments_client.ts @@ -1083,7 +1083,8 @@ export class ExperimentsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listExperiments']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listExperiments.createStream( this.innerApiCalls.listExperiments as gax.GaxCall, @@ -1136,7 +1137,8 @@ export class ExperimentsClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listExperiments']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listExperiments.asyncIterate( this.innerApiCalls['listExperiments'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3/flows_client.ts b/packages/google-cloud-dialogflow-cx/src/v3/flows_client.ts index fad1fe9a734..7afb313f746 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3/flows_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3/flows_client.ts @@ -1686,7 +1686,8 @@ export class FlowsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listFlows']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listFlows.createStream( this.innerApiCalls.listFlows as gax.GaxCall, @@ -1752,7 +1753,8 @@ export class FlowsClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listFlows']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listFlows.asyncIterate( this.innerApiCalls['listFlows'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3/intents_client.ts b/packages/google-cloud-dialogflow-cx/src/v3/intents_client.ts index ded82bcfb15..75cc649729c 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3/intents_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3/intents_client.ts @@ -954,7 +954,8 @@ export class IntentsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listIntents']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listIntents.createStream( this.innerApiCalls.listIntents as gax.GaxCall, @@ -1019,7 +1020,8 @@ export class IntentsClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listIntents']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listIntents.asyncIterate( this.innerApiCalls['listIntents'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3/pages_client.ts b/packages/google-cloud-dialogflow-cx/src/v3/pages_client.ts index a6ce68d1393..a8d22094bf8 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3/pages_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3/pages_client.ts @@ -1019,7 +1019,8 @@ export class PagesClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listPages']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listPages.createStream( this.innerApiCalls.listPages as gax.GaxCall, @@ -1094,7 +1095,8 @@ export class PagesClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listPages']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listPages.asyncIterate( this.innerApiCalls['listPages'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3/security_settings_service_client.ts b/packages/google-cloud-dialogflow-cx/src/v3/security_settings_service_client.ts index bb4c0e18658..20005d3446b 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3/security_settings_service_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3/security_settings_service_client.ts @@ -947,7 +947,8 @@ export class SecuritySettingsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listSecuritySettings']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSecuritySettings.createStream( this.innerApiCalls.listSecuritySettings as gax.GaxCall, @@ -999,7 +1000,8 @@ export class SecuritySettingsServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listSecuritySettings']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSecuritySettings.asyncIterate( this.innerApiCalls['listSecuritySettings'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3/session_entity_types_client.ts b/packages/google-cloud-dialogflow-cx/src/v3/session_entity_types_client.ts index 7cbaa74dce0..040769f335b 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3/session_entity_types_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3/session_entity_types_client.ts @@ -960,7 +960,8 @@ export class SessionEntityTypesClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listSessionEntityTypes']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSessionEntityTypes.createStream( this.innerApiCalls.listSessionEntityTypes as gax.GaxCall, @@ -1016,7 +1017,8 @@ export class SessionEntityTypesClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listSessionEntityTypes']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSessionEntityTypes.asyncIterate( this.innerApiCalls['listSessionEntityTypes'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3/test_cases_client.ts b/packages/google-cloud-dialogflow-cx/src/v3/test_cases_client.ts index e7246affc36..56fc4ce58ca 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3/test_cases_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3/test_cases_client.ts @@ -1796,7 +1796,8 @@ export class TestCasesClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listTestCases']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listTestCases.createStream( this.innerApiCalls.listTestCases as gax.GaxCall, @@ -1851,7 +1852,8 @@ export class TestCasesClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listTestCases']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listTestCases.asyncIterate( this.innerApiCalls['listTestCases'] as GaxCall, @@ -2050,7 +2052,8 @@ export class TestCasesClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listTestCaseResults']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listTestCaseResults.createStream( this.innerApiCalls.listTestCaseResults as gax.GaxCall, @@ -2129,7 +2132,8 @@ export class TestCasesClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listTestCaseResults']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listTestCaseResults.asyncIterate( this.innerApiCalls['listTestCaseResults'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3/transition_route_groups_client.ts b/packages/google-cloud-dialogflow-cx/src/v3/transition_route_groups_client.ts index 4fd9a8a66b9..30d4df8883a 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3/transition_route_groups_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3/transition_route_groups_client.ts @@ -1024,7 +1024,8 @@ export class TransitionRouteGroupsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listTransitionRouteGroups']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listTransitionRouteGroups.createStream( this.innerApiCalls.listTransitionRouteGroups as gax.GaxCall, @@ -1091,7 +1092,8 @@ export class TransitionRouteGroupsClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listTransitionRouteGroups']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listTransitionRouteGroups.asyncIterate( this.innerApiCalls['listTransitionRouteGroups'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3/versions_client.ts b/packages/google-cloud-dialogflow-cx/src/v3/versions_client.ts index bef3c4f30bb..9050586b474 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3/versions_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3/versions_client.ts @@ -1133,7 +1133,8 @@ export class VersionsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listVersions']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listVersions.createStream( this.innerApiCalls.listVersions as gax.GaxCall, @@ -1186,7 +1187,8 @@ export class VersionsClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listVersions']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listVersions.asyncIterate( this.innerApiCalls['listVersions'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3/webhooks_client.ts b/packages/google-cloud-dialogflow-cx/src/v3/webhooks_client.ts index 15254bfffeb..503a58ac457 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3/webhooks_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3/webhooks_client.ts @@ -908,7 +908,8 @@ export class WebhooksClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listWebhooks']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listWebhooks.createStream( this.innerApiCalls.listWebhooks as gax.GaxCall, @@ -960,7 +961,8 @@ export class WebhooksClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listWebhooks']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listWebhooks.asyncIterate( this.innerApiCalls['listWebhooks'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3beta1/agents_client.ts b/packages/google-cloud-dialogflow-cx/src/v3beta1/agents_client.ts index b7a9546afe3..0aeb9507777 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3beta1/agents_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3beta1/agents_client.ts @@ -1464,7 +1464,8 @@ export class AgentsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listAgents']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAgents.createStream( this.innerApiCalls.listAgents as gax.GaxCall, @@ -1516,7 +1517,8 @@ export class AgentsClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listAgents']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAgents.asyncIterate( this.innerApiCalls['listAgents'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3beta1/entity_types_client.ts b/packages/google-cloud-dialogflow-cx/src/v3beta1/entity_types_client.ts index 7f531686da4..edbd6dd4195 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3beta1/entity_types_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3beta1/entity_types_client.ts @@ -996,7 +996,8 @@ export class EntityTypesClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listEntityTypes']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listEntityTypes.createStream( this.innerApiCalls.listEntityTypes as gax.GaxCall, @@ -1061,7 +1062,8 @@ export class EntityTypesClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listEntityTypes']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listEntityTypes.asyncIterate( this.innerApiCalls['listEntityTypes'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3beta1/environments_client.ts b/packages/google-cloud-dialogflow-cx/src/v3beta1/environments_client.ts index 954a6eceb9f..639c2ca5358 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3beta1/environments_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3beta1/environments_client.ts @@ -1211,7 +1211,8 @@ export class EnvironmentsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listEnvironments']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listEnvironments.createStream( this.innerApiCalls.listEnvironments as gax.GaxCall, @@ -1263,7 +1264,8 @@ export class EnvironmentsClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listEnvironments']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listEnvironments.asyncIterate( this.innerApiCalls['listEnvironments'] as GaxCall, @@ -1414,7 +1416,8 @@ export class EnvironmentsClient { gax.routingHeader.fromParams({ name: request.name || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['lookupEnvironmentHistory']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.lookupEnvironmentHistory.createStream( this.innerApiCalls.lookupEnvironmentHistory as gax.GaxCall, @@ -1467,7 +1470,8 @@ export class EnvironmentsClient { name: request.name || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['lookupEnvironmentHistory']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.lookupEnvironmentHistory.asyncIterate( this.innerApiCalls['lookupEnvironmentHistory'] as GaxCall, @@ -1618,7 +1622,8 @@ export class EnvironmentsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listContinuousTestResults']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listContinuousTestResults.createStream( this.innerApiCalls.listContinuousTestResults as gax.GaxCall, @@ -1671,7 +1676,8 @@ export class EnvironmentsClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listContinuousTestResults']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listContinuousTestResults.asyncIterate( this.innerApiCalls['listContinuousTestResults'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3beta1/experiments_client.ts b/packages/google-cloud-dialogflow-cx/src/v3beta1/experiments_client.ts index 6a1a149a9d5..23f0c038f61 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3beta1/experiments_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3beta1/experiments_client.ts @@ -1119,7 +1119,8 @@ export class ExperimentsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listExperiments']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listExperiments.createStream( this.innerApiCalls.listExperiments as gax.GaxCall, @@ -1172,7 +1173,8 @@ export class ExperimentsClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listExperiments']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listExperiments.asyncIterate( this.innerApiCalls['listExperiments'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3beta1/flows_client.ts b/packages/google-cloud-dialogflow-cx/src/v3beta1/flows_client.ts index 80a99f643cd..57b247662fe 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3beta1/flows_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3beta1/flows_client.ts @@ -1698,7 +1698,8 @@ export class FlowsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listFlows']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listFlows.createStream( this.innerApiCalls.listFlows as gax.GaxCall, @@ -1764,7 +1765,8 @@ export class FlowsClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listFlows']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listFlows.asyncIterate( this.innerApiCalls['listFlows'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3beta1/intents_client.ts b/packages/google-cloud-dialogflow-cx/src/v3beta1/intents_client.ts index 5634a308c47..07348a57a1b 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3beta1/intents_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3beta1/intents_client.ts @@ -978,7 +978,8 @@ export class IntentsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listIntents']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listIntents.createStream( this.innerApiCalls.listIntents as gax.GaxCall, @@ -1043,7 +1044,8 @@ export class IntentsClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listIntents']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listIntents.asyncIterate( this.innerApiCalls['listIntents'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3beta1/pages_client.ts b/packages/google-cloud-dialogflow-cx/src/v3beta1/pages_client.ts index 9f93effd57b..d702a741362 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3beta1/pages_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3beta1/pages_client.ts @@ -1013,7 +1013,8 @@ export class PagesClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listPages']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listPages.createStream( this.innerApiCalls.listPages as gax.GaxCall, @@ -1088,7 +1089,8 @@ export class PagesClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listPages']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listPages.asyncIterate( this.innerApiCalls['listPages'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3beta1/security_settings_service_client.ts b/packages/google-cloud-dialogflow-cx/src/v3beta1/security_settings_service_client.ts index bce41d91131..bdcbe2c9a5c 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3beta1/security_settings_service_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3beta1/security_settings_service_client.ts @@ -947,7 +947,8 @@ export class SecuritySettingsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listSecuritySettings']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSecuritySettings.createStream( this.innerApiCalls.listSecuritySettings as gax.GaxCall, @@ -999,7 +1000,8 @@ export class SecuritySettingsServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listSecuritySettings']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSecuritySettings.asyncIterate( this.innerApiCalls['listSecuritySettings'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3beta1/session_entity_types_client.ts b/packages/google-cloud-dialogflow-cx/src/v3beta1/session_entity_types_client.ts index 64d5df85c7b..03aa40235fe 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3beta1/session_entity_types_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3beta1/session_entity_types_client.ts @@ -960,7 +960,8 @@ export class SessionEntityTypesClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listSessionEntityTypes']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSessionEntityTypes.createStream( this.innerApiCalls.listSessionEntityTypes as gax.GaxCall, @@ -1016,7 +1017,8 @@ export class SessionEntityTypesClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listSessionEntityTypes']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSessionEntityTypes.asyncIterate( this.innerApiCalls['listSessionEntityTypes'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3beta1/test_cases_client.ts b/packages/google-cloud-dialogflow-cx/src/v3beta1/test_cases_client.ts index ef72c2a74a6..d1231de0595 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3beta1/test_cases_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3beta1/test_cases_client.ts @@ -1808,7 +1808,8 @@ export class TestCasesClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listTestCases']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listTestCases.createStream( this.innerApiCalls.listTestCases as gax.GaxCall, @@ -1863,7 +1864,8 @@ export class TestCasesClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listTestCases']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listTestCases.asyncIterate( this.innerApiCalls['listTestCases'] as GaxCall, @@ -2062,7 +2064,8 @@ export class TestCasesClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listTestCaseResults']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listTestCaseResults.createStream( this.innerApiCalls.listTestCaseResults as gax.GaxCall, @@ -2141,7 +2144,8 @@ export class TestCasesClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listTestCaseResults']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listTestCaseResults.asyncIterate( this.innerApiCalls['listTestCaseResults'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3beta1/transition_route_groups_client.ts b/packages/google-cloud-dialogflow-cx/src/v3beta1/transition_route_groups_client.ts index bc73073a2c3..8cf10de1ca8 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3beta1/transition_route_groups_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3beta1/transition_route_groups_client.ts @@ -1022,7 +1022,8 @@ export class TransitionRouteGroupsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listTransitionRouteGroups']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listTransitionRouteGroups.createStream( this.innerApiCalls.listTransitionRouteGroups as gax.GaxCall, @@ -1088,7 +1089,8 @@ export class TransitionRouteGroupsClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listTransitionRouteGroups']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listTransitionRouteGroups.asyncIterate( this.innerApiCalls['listTransitionRouteGroups'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3beta1/versions_client.ts b/packages/google-cloud-dialogflow-cx/src/v3beta1/versions_client.ts index 54d880655fd..086b9ec417a 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3beta1/versions_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3beta1/versions_client.ts @@ -1145,7 +1145,8 @@ export class VersionsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listVersions']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listVersions.createStream( this.innerApiCalls.listVersions as gax.GaxCall, @@ -1198,7 +1199,8 @@ export class VersionsClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listVersions']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listVersions.asyncIterate( this.innerApiCalls['listVersions'] as GaxCall, diff --git a/packages/google-cloud-dialogflow-cx/src/v3beta1/webhooks_client.ts b/packages/google-cloud-dialogflow-cx/src/v3beta1/webhooks_client.ts index 42dcc46018a..89e25f36ffb 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3beta1/webhooks_client.ts +++ b/packages/google-cloud-dialogflow-cx/src/v3beta1/webhooks_client.ts @@ -926,7 +926,8 @@ export class WebhooksClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listWebhooks']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listWebhooks.createStream( this.innerApiCalls.listWebhooks as gax.GaxCall, @@ -978,7 +979,8 @@ export class WebhooksClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listWebhooks']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listWebhooks.asyncIterate( this.innerApiCalls['listWebhooks'] as GaxCall,