1 /* 2 * Copyright 2022 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 /** 18 * A client to Dialogflow API 19 * 20 * <p>The interfaces provided are listed below, along with usage samples. 21 * 22 * <p>======================= AgentsClient ======================= 23 * 24 * <p>Service Description: Service for managing [Agents][google.cloud.dialogflow.v2.Agent]. 25 * 26 * <p>Sample for AgentsClient: 27 * 28 * <pre>{@code 29 * // This snippet has been automatically generated and should be regarded as a code template only. 30 * // It will require modifications to work: 31 * // - It may require correct/in-range values for request initialization. 32 * // - It may require specifying regional endpoints when creating the service client as shown in 33 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 34 * try (AgentsClient agentsClient = AgentsClient.create()) { 35 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 36 * Agent response = agentsClient.getAgent(parent); 37 * } 38 * }</pre> 39 * 40 * <p>======================= AnswerRecordsClient ======================= 41 * 42 * <p>Service Description: Service for managing 43 * [AnswerRecords][google.cloud.dialogflow.v2.AnswerRecord]. 44 * 45 * <p>Sample for AnswerRecordsClient: 46 * 47 * <pre>{@code 48 * // This snippet has been automatically generated and should be regarded as a code template only. 49 * // It will require modifications to work: 50 * // - It may require correct/in-range values for request initialization. 51 * // - It may require specifying regional endpoints when creating the service client as shown in 52 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 53 * try (AnswerRecordsClient answerRecordsClient = AnswerRecordsClient.create()) { 54 * AnswerRecord answerRecord = AnswerRecord.newBuilder().build(); 55 * FieldMask updateMask = FieldMask.newBuilder().build(); 56 * AnswerRecord response = answerRecordsClient.updateAnswerRecord(answerRecord, updateMask); 57 * } 58 * }</pre> 59 * 60 * <p>======================= ContextsClient ======================= 61 * 62 * <p>Service Description: Service for managing [Contexts][google.cloud.dialogflow.v2.Context]. 63 * 64 * <p>Sample for ContextsClient: 65 * 66 * <pre>{@code 67 * // This snippet has been automatically generated and should be regarded as a code template only. 68 * // It will require modifications to work: 69 * // - It may require correct/in-range values for request initialization. 70 * // - It may require specifying regional endpoints when creating the service client as shown in 71 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 72 * try (ContextsClient contextsClient = ContextsClient.create()) { 73 * ContextName name = 74 * ContextName.ofProjectSessionContextName("[PROJECT]", "[SESSION]", "[CONTEXT]"); 75 * Context response = contextsClient.getContext(name); 76 * } 77 * }</pre> 78 * 79 * <p>======================= ConversationsClient ======================= 80 * 81 * <p>Service Description: Service for managing 82 * [Conversations][google.cloud.dialogflow.v2.Conversation]. 83 * 84 * <p>Sample for ConversationsClient: 85 * 86 * <pre>{@code 87 * // This snippet has been automatically generated and should be regarded as a code template only. 88 * // It will require modifications to work: 89 * // - It may require correct/in-range values for request initialization. 90 * // - It may require specifying regional endpoints when creating the service client as shown in 91 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 92 * try (ConversationsClient conversationsClient = ConversationsClient.create()) { 93 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 94 * Conversation conversation = Conversation.newBuilder().build(); 95 * Conversation response = conversationsClient.createConversation(parent, conversation); 96 * } 97 * }</pre> 98 * 99 * <p>======================= ConversationDatasetsClient ======================= 100 * 101 * <p>Service Description: Conversation datasets. 102 * 103 * <p>Conversation datasets contain raw conversation files and their customizable metadata that can 104 * be used for model training. 105 * 106 * <p>Sample for ConversationDatasetsClient: 107 * 108 * <pre>{@code 109 * // This snippet has been automatically generated and should be regarded as a code template only. 110 * // It will require modifications to work: 111 * // - It may require correct/in-range values for request initialization. 112 * // - It may require specifying regional endpoints when creating the service client as shown in 113 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 114 * try (ConversationDatasetsClient conversationDatasetsClient = 115 * ConversationDatasetsClient.create()) { 116 * ConversationDatasetName name = 117 * ConversationDatasetName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION_DATASET]"); 118 * ConversationDataset response = conversationDatasetsClient.getConversationDataset(name); 119 * } 120 * }</pre> 121 * 122 * <p>======================= ConversationModelsClient ======================= 123 * 124 * <p>Service Description: Manages a collection of models for human agent assistant. 125 * 126 * <p>Sample for ConversationModelsClient: 127 * 128 * <pre>{@code 129 * // This snippet has been automatically generated and should be regarded as a code template only. 130 * // It will require modifications to work: 131 * // - It may require correct/in-range values for request initialization. 132 * // - It may require specifying regional endpoints when creating the service client as shown in 133 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 134 * try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) { 135 * String name = "name3373707"; 136 * ConversationModel response = conversationModelsClient.getConversationModel(name); 137 * } 138 * }</pre> 139 * 140 * <p>======================= ConversationProfilesClient ======================= 141 * 142 * <p>Service Description: Service for managing 143 * [ConversationProfiles][google.cloud.dialogflow.v2.ConversationProfile]. 144 * 145 * <p>Sample for ConversationProfilesClient: 146 * 147 * <pre>{@code 148 * // This snippet has been automatically generated and should be regarded as a code template only. 149 * // It will require modifications to work: 150 * // - It may require correct/in-range values for request initialization. 151 * // - It may require specifying regional endpoints when creating the service client as shown in 152 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 153 * try (ConversationProfilesClient conversationProfilesClient = 154 * ConversationProfilesClient.create()) { 155 * ConversationProfileName name = 156 * ConversationProfileName.ofProjectConversationProfileName( 157 * "[PROJECT]", "[CONVERSATION_PROFILE]"); 158 * ConversationProfile response = conversationProfilesClient.getConversationProfile(name); 159 * } 160 * }</pre> 161 * 162 * <p>======================= DocumentsClient ======================= 163 * 164 * <p>Service Description: Service for managing knowledge 165 * [Documents][google.cloud.dialogflow.v2.Document]. 166 * 167 * <p>Sample for DocumentsClient: 168 * 169 * <pre>{@code 170 * // This snippet has been automatically generated and should be regarded as a code template only. 171 * // It will require modifications to work: 172 * // - It may require correct/in-range values for request initialization. 173 * // - It may require specifying regional endpoints when creating the service client as shown in 174 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 175 * try (DocumentsClient documentsClient = DocumentsClient.create()) { 176 * DocumentName name = 177 * DocumentName.ofProjectKnowledgeBaseDocumentName( 178 * "[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]"); 179 * Document response = documentsClient.getDocument(name); 180 * } 181 * }</pre> 182 * 183 * <p>======================= EntityTypesClient ======================= 184 * 185 * <p>Service Description: Service for managing 186 * [EntityTypes][google.cloud.dialogflow.v2.EntityType]. 187 * 188 * <p>Sample for EntityTypesClient: 189 * 190 * <pre>{@code 191 * // This snippet has been automatically generated and should be regarded as a code template only. 192 * // It will require modifications to work: 193 * // - It may require correct/in-range values for request initialization. 194 * // - It may require specifying regional endpoints when creating the service client as shown in 195 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 196 * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { 197 * EntityTypeName name = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]"); 198 * EntityType response = entityTypesClient.getEntityType(name); 199 * } 200 * }</pre> 201 * 202 * <p>======================= EnvironmentsClient ======================= 203 * 204 * <p>Service Description: Service for managing 205 * [Environments][google.cloud.dialogflow.v2.Environment]. 206 * 207 * <p>Sample for EnvironmentsClient: 208 * 209 * <pre>{@code 210 * // This snippet has been automatically generated and should be regarded as a code template only. 211 * // It will require modifications to work: 212 * // - It may require correct/in-range values for request initialization. 213 * // - It may require specifying regional endpoints when creating the service client as shown in 214 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 215 * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) { 216 * GetEnvironmentRequest request = 217 * GetEnvironmentRequest.newBuilder() 218 * .setName( 219 * EnvironmentName.ofProjectEnvironmentName("[PROJECT]", "[ENVIRONMENT]").toString()) 220 * .build(); 221 * Environment response = environmentsClient.getEnvironment(request); 222 * } 223 * }</pre> 224 * 225 * <p>======================= FulfillmentsClient ======================= 226 * 227 * <p>Service Description: Service for managing 228 * [Fulfillments][google.cloud.dialogflow.v2.Fulfillment]. 229 * 230 * <p>Sample for FulfillmentsClient: 231 * 232 * <pre>{@code 233 * // This snippet has been automatically generated and should be regarded as a code template only. 234 * // It will require modifications to work: 235 * // - It may require correct/in-range values for request initialization. 236 * // - It may require specifying regional endpoints when creating the service client as shown in 237 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 238 * try (FulfillmentsClient fulfillmentsClient = FulfillmentsClient.create()) { 239 * FulfillmentName name = FulfillmentName.ofProjectName("[PROJECT]"); 240 * Fulfillment response = fulfillmentsClient.getFulfillment(name); 241 * } 242 * }</pre> 243 * 244 * <p>======================= IntentsClient ======================= 245 * 246 * <p>Service Description: Service for managing [Intents][google.cloud.dialogflow.v2.Intent]. 247 * 248 * <p>Sample for IntentsClient: 249 * 250 * <pre>{@code 251 * // This snippet has been automatically generated and should be regarded as a code template only. 252 * // It will require modifications to work: 253 * // - It may require correct/in-range values for request initialization. 254 * // - It may require specifying regional endpoints when creating the service client as shown in 255 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 256 * try (IntentsClient intentsClient = IntentsClient.create()) { 257 * IntentName name = IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]"); 258 * Intent response = intentsClient.getIntent(name); 259 * } 260 * }</pre> 261 * 262 * <p>======================= KnowledgeBasesClient ======================= 263 * 264 * <p>Service Description: Service for managing 265 * [KnowledgeBases][google.cloud.dialogflow.v2.KnowledgeBase]. 266 * 267 * <p>Sample for KnowledgeBasesClient: 268 * 269 * <pre>{@code 270 * // This snippet has been automatically generated and should be regarded as a code template only. 271 * // It will require modifications to work: 272 * // - It may require correct/in-range values for request initialization. 273 * // - It may require specifying regional endpoints when creating the service client as shown in 274 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 275 * try (KnowledgeBasesClient knowledgeBasesClient = KnowledgeBasesClient.create()) { 276 * KnowledgeBaseName name = 277 * KnowledgeBaseName.ofProjectKnowledgeBaseName("[PROJECT]", "[KNOWLEDGE_BASE]"); 278 * KnowledgeBase response = knowledgeBasesClient.getKnowledgeBase(name); 279 * } 280 * }</pre> 281 * 282 * <p>======================= ParticipantsClient ======================= 283 * 284 * <p>Service Description: Service for managing 285 * [Participants][google.cloud.dialogflow.v2.Participant]. 286 * 287 * <p>Sample for ParticipantsClient: 288 * 289 * <pre>{@code 290 * // This snippet has been automatically generated and should be regarded as a code template only. 291 * // It will require modifications to work: 292 * // - It may require correct/in-range values for request initialization. 293 * // - It may require specifying regional endpoints when creating the service client as shown in 294 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 295 * try (ParticipantsClient participantsClient = ParticipantsClient.create()) { 296 * ConversationName parent = 297 * ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]"); 298 * Participant participant = Participant.newBuilder().build(); 299 * Participant response = participantsClient.createParticipant(parent, participant); 300 * } 301 * }</pre> 302 * 303 * <p>======================= SessionsClient ======================= 304 * 305 * <p>Service Description: A service used for session interactions. 306 * 307 * <p>For more information, see the [API interactions 308 * guide](https://cloud.google.com/dialogflow/docs/api-overview). 309 * 310 * <p>Sample for SessionsClient: 311 * 312 * <pre>{@code 313 * // This snippet has been automatically generated and should be regarded as a code template only. 314 * // It will require modifications to work: 315 * // - It may require correct/in-range values for request initialization. 316 * // - It may require specifying regional endpoints when creating the service client as shown in 317 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 318 * try (SessionsClient sessionsClient = SessionsClient.create()) { 319 * SessionName session = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]"); 320 * QueryInput queryInput = QueryInput.newBuilder().build(); 321 * DetectIntentResponse response = sessionsClient.detectIntent(session, queryInput); 322 * } 323 * }</pre> 324 * 325 * <p>======================= SessionEntityTypesClient ======================= 326 * 327 * <p>Service Description: Service for managing 328 * [SessionEntityTypes][google.cloud.dialogflow.v2.SessionEntityType]. 329 * 330 * <p>Sample for SessionEntityTypesClient: 331 * 332 * <pre>{@code 333 * // This snippet has been automatically generated and should be regarded as a code template only. 334 * // It will require modifications to work: 335 * // - It may require correct/in-range values for request initialization. 336 * // - It may require specifying regional endpoints when creating the service client as shown in 337 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 338 * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) { 339 * SessionEntityTypeName name = 340 * SessionEntityTypeName.ofProjectSessionEntityTypeName( 341 * "[PROJECT]", "[SESSION]", "[ENTITY_TYPE]"); 342 * SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name); 343 * } 344 * }</pre> 345 * 346 * <p>======================= VersionsClient ======================= 347 * 348 * <p>Service Description: Service for managing [Versions][google.cloud.dialogflow.v2.Version]. 349 * 350 * <p>Sample for VersionsClient: 351 * 352 * <pre>{@code 353 * // This snippet has been automatically generated and should be regarded as a code template only. 354 * // It will require modifications to work: 355 * // - It may require correct/in-range values for request initialization. 356 * // - It may require specifying regional endpoints when creating the service client as shown in 357 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 358 * try (VersionsClient versionsClient = VersionsClient.create()) { 359 * VersionName name = VersionName.ofProjectVersionName("[PROJECT]", "[VERSION]"); 360 * Version response = versionsClient.getVersion(name); 361 * } 362 * }</pre> 363 */ 364 @Generated("by gapic-generator-java") 365 package com.google.cloud.dialogflow.v2; 366 367 import javax.annotation.Generated; 368