google-cloud-dialogflow-cx overview (0.14.2)

com.google.cloud.dialogflow.cx.v3

A client to Dialogflow API

The interfaces provided are listed below, along with usage samples.

AgentsClient

Service Description: Service for managing Agents.

Sample for AgentsClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (AgentsClient agentsClient = AgentsClient.create()) {
   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
   Agent response = agentsClient.getAgent(name);
 }
 

ChangelogsClient

Service Description: Service for managing Changelogs.

Sample for ChangelogsClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ChangelogsClient changelogsClient = ChangelogsClient.create()) {
   ChangelogName name = ChangelogName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[CHANGELOG]");
   Changelog response = changelogsClient.getChangelog(name);
 }
 

DeploymentsClient

Service Description: Service for managing Deployments.

Sample for DeploymentsClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (DeploymentsClient deploymentsClient = DeploymentsClient.create()) {
   DeploymentName name =
       DeploymentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[DEPLOYMENT]");
   Deployment response = deploymentsClient.getDeployment(name);
 }
 

EntityTypesClient

Service Description: Service for managing EntityTypes.

Sample for EntityTypesClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
   EntityTypeName name =
       EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
   EntityType response = entityTypesClient.getEntityType(name);
 }
 

EnvironmentsClient

Service Description: Service for managing Environments.

Sample for EnvironmentsClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
   EnvironmentName name =
       EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
   Environment response = environmentsClient.getEnvironment(name);
 }
 

ExperimentsClient

Service Description: Service for managing Experiments.

Sample for ExperimentsClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ExperimentsClient experimentsClient = ExperimentsClient.create()) {
   ExperimentName name =
       ExperimentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[EXPERIMENT]");
   Experiment response = experimentsClient.getExperiment(name);
 }
 

FlowsClient

Service Description: Service for managing Flows.

Sample for FlowsClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (FlowsClient flowsClient = FlowsClient.create()) {
   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
   Flow flow = Flow.newBuilder().build();
   Flow response = flowsClient.createFlow(parent, flow);
 }
 

IntentsClient

Service Description: Service for managing Intents.

Sample for IntentsClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (IntentsClient intentsClient = IntentsClient.create()) {
   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
   Intent response = intentsClient.getIntent(name);
 }
 

PagesClient

Service Description: Service for managing Pages.

Sample for PagesClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (PagesClient pagesClient = PagesClient.create()) {
   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
   Page response = pagesClient.getPage(name);
 }
 

SecuritySettingsServiceClient

Service Description: Service for managing security settings for Dialogflow.

Sample for SecuritySettingsServiceClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (SecuritySettingsServiceClient securitySettingsServiceClient =
     SecuritySettingsServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   SecuritySettings securitySettings = SecuritySettings.newBuilder().build();
   SecuritySettings response =
       securitySettingsServiceClient.createSecuritySettings(parent, securitySettings);
 }
 

SessionsClient

Service Description: A session represents an interaction with a user. You retrieve user input and pass it to the DetectIntent method to determine user intent and respond.

Sample for SessionsClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (SessionsClient sessionsClient = SessionsClient.create()) {
   DetectIntentRequest request =
       DetectIntentRequest.newBuilder()
           .setSession(
               SessionName.ofProjectLocationAgentSessionName(
                       "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]")
                   .toString())
           .setQueryParams(QueryParameters.newBuilder().build())
           .setQueryInput(QueryInput.newBuilder().build())
           .setOutputAudioConfig(OutputAudioConfig.newBuilder().build())
           .build();
   DetectIntentResponse response = sessionsClient.detectIntent(request);
 }
 

SessionEntityTypesClient

Service Description: Service for managing SessionEntityTypes.

Sample for SessionEntityTypesClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
   SessionEntityTypeName name =
       SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName(
           "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
   SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name);
 }
 

TestCasesClient

Service Description: Service for managing Test Cases and Test Case Results.

Sample for TestCasesClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (TestCasesClient testCasesClient = TestCasesClient.create()) {
   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
   testCasesClient.batchDeleteTestCases(parent);
 }
 

TransitionRouteGroupsClient

Service Description: Service for managing TransitionRouteGroups.

Sample for TransitionRouteGroupsClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (TransitionRouteGroupsClient transitionRouteGroupsClient =
     TransitionRouteGroupsClient.create()) {
   TransitionRouteGroupName name =
       TransitionRouteGroupName.of(
           "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
   TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(name);
 }
 

VersionsClient

Service Description: Service for managing Versions.

Sample for VersionsClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (VersionsClient versionsClient = VersionsClient.create()) {
   VersionName name =
       VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
   Version response = versionsClient.getVersion(name);
 }
 

WebhooksClient

Service Description: Service for managing Webhooks.

Sample for WebhooksClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (WebhooksClient webhooksClient = WebhooksClient.create()) {
   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
   Webhook response = webhooksClient.getWebhook(name);
 }
 

com.google.cloud.dialogflow.cx.v3.stub

com.google.cloud.dialogflow.cx.v3beta1

A client to Dialogflow API

The interfaces provided are listed below, along with usage samples.

AgentsClient

Service Description: Service for managing Agents.

Sample for AgentsClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (AgentsClient agentsClient = AgentsClient.create()) {
   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
   Agent response = agentsClient.getAgent(name);
 }
 

ChangelogsClient

Service Description: Service for managing Changelogs.

Sample for ChangelogsClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ChangelogsClient changelogsClient = ChangelogsClient.create()) {
   ChangelogName name = ChangelogName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[CHANGELOG]");
   Changelog response = changelogsClient.getChangelog(name);
 }
 

DeploymentsClient

Service Description: Service for managing Deployments.

Sample for DeploymentsClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (DeploymentsClient deploymentsClient = DeploymentsClient.create()) {
   DeploymentName name =
       DeploymentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[DEPLOYMENT]");
   Deployment response = deploymentsClient.getDeployment(name);
 }
 

EntityTypesClient

Service Description: Service for managing EntityTypes.

Sample for EntityTypesClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
   EntityTypeName name =
       EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
   EntityType response = entityTypesClient.getEntityType(name);
 }
 

EnvironmentsClient

Service Description: Service for managing Environments.

Sample for EnvironmentsClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
   EnvironmentName name =
       EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
   Environment response = environmentsClient.getEnvironment(name);
 }
 

ExperimentsClient

Service Description: Service for managing Experiments.

Sample for ExperimentsClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ExperimentsClient experimentsClient = ExperimentsClient.create()) {
   ExperimentName name =
       ExperimentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[EXPERIMENT]");
   Experiment response = experimentsClient.getExperiment(name);
 }
 

FlowsClient

Service Description: Service for managing Flows.

Sample for FlowsClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (FlowsClient flowsClient = FlowsClient.create()) {
   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
   Flow flow = Flow.newBuilder().build();
   Flow response = flowsClient.createFlow(parent, flow);
 }
 

IntentsClient

Service Description: Service for managing Intents.

Sample for IntentsClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (IntentsClient intentsClient = IntentsClient.create()) {
   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
   Intent response = intentsClient.getIntent(name);
 }
 

PagesClient

Service Description: Service for managing Pages.

Sample for PagesClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (PagesClient pagesClient = PagesClient.create()) {
   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
   Page response = pagesClient.getPage(name);
 }
 

SecuritySettingsServiceClient

Service Description: Service for managing security settings for Dialogflow.

Sample for SecuritySettingsServiceClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (SecuritySettingsServiceClient securitySettingsServiceClient =
     SecuritySettingsServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   SecuritySettings securitySettings = SecuritySettings.newBuilder().build();
   SecuritySettings response =
       securitySettingsServiceClient.createSecuritySettings(parent, securitySettings);
 }
 

SessionsClient

Service Description: A session represents an interaction with a user. You retrieve user input and pass it to the DetectIntent method to determine user intent and respond.

Sample for SessionsClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (SessionsClient sessionsClient = SessionsClient.create()) {
   DetectIntentRequest request =
       DetectIntentRequest.newBuilder()
           .setSession(
               SessionName.ofProjectLocationAgentSessionName(
                       "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]")
                   .toString())
           .setQueryParams(QueryParameters.newBuilder().build())
           .setQueryInput(QueryInput.newBuilder().build())
           .setOutputAudioConfig(OutputAudioConfig.newBuilder().build())
           .build();
   DetectIntentResponse response = sessionsClient.detectIntent(request);
 }
 

SessionEntityTypesClient

Service Description: Service for managing SessionEntityTypes.

Sample for SessionEntityTypesClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
   SessionEntityTypeName name =
       SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName(
           "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
   SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name);
 }
 

TestCasesClient

Service Description: Service for managing Test Cases and Test Case Results.

Sample for TestCasesClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (TestCasesClient testCasesClient = TestCasesClient.create()) {
   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
   testCasesClient.batchDeleteTestCases(parent);
 }
 

TransitionRouteGroupsClient

Service Description: Service for managing TransitionRouteGroups.

Sample for TransitionRouteGroupsClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (TransitionRouteGroupsClient transitionRouteGroupsClient =
     TransitionRouteGroupsClient.create()) {
   TransitionRouteGroupName name =
       TransitionRouteGroupName.of(
           "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
   TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(name);
 }
 

VersionsClient

Service Description: Service for managing Versions.

Sample for VersionsClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (VersionsClient versionsClient = VersionsClient.create()) {
   VersionName name =
       VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
   Version response = versionsClient.getVersion(name);
 }
 

WebhooksClient

Service Description: Service for managing Webhooks.

Sample for WebhooksClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (WebhooksClient webhooksClient = WebhooksClient.create()) {
   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
   Webhook response = webhooksClient.getWebhook(name);
 }
 

com.google.cloud.dialogflow.cx.v3beta1.stub