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.v2beta1.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.v2beta1.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 * GetAnswerRecordRequest request = 55 * GetAnswerRecordRequest.newBuilder().setName("name3373707").build(); 56 * AnswerRecord response = answerRecordsClient.getAnswerRecord(request); 57 * } 58 * }</pre> 59 * 60 * <p>======================= ContextsClient ======================= 61 * 62 * <p>Service Description: Service for managing [Contexts][google.cloud.dialogflow.v2beta1.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.v2beta1.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>======================= ConversationProfilesClient ======================= 100 * 101 * <p>Service Description: Service for managing 102 * [ConversationProfiles][google.cloud.dialogflow.v2beta1.ConversationProfile]. 103 * 104 * <p>Sample for ConversationProfilesClient: 105 * 106 * <pre>{@code 107 * // This snippet has been automatically generated and should be regarded as a code template only. 108 * // It will require modifications to work: 109 * // - It may require correct/in-range values for request initialization. 110 * // - It may require specifying regional endpoints when creating the service client as shown in 111 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 112 * try (ConversationProfilesClient conversationProfilesClient = 113 * ConversationProfilesClient.create()) { 114 * ConversationProfileName name = 115 * ConversationProfileName.ofProjectConversationProfileName( 116 * "[PROJECT]", "[CONVERSATION_PROFILE]"); 117 * ConversationProfile response = conversationProfilesClient.getConversationProfile(name); 118 * } 119 * }</pre> 120 * 121 * <p>======================= DocumentsClient ======================= 122 * 123 * <p>Service Description: Service for managing knowledge 124 * [Documents][google.cloud.dialogflow.v2beta1.Document]. 125 * 126 * <p>Sample for DocumentsClient: 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 (DocumentsClient documentsClient = DocumentsClient.create()) { 135 * DocumentName name = 136 * DocumentName.ofProjectKnowledgeBaseDocumentName( 137 * "[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]"); 138 * Document response = documentsClient.getDocument(name); 139 * } 140 * }</pre> 141 * 142 * <p>======================= EntityTypesClient ======================= 143 * 144 * <p>Service Description: Service for managing 145 * [EntityTypes][google.cloud.dialogflow.v2beta1.EntityType]. 146 * 147 * <p>Sample for EntityTypesClient: 148 * 149 * <pre>{@code 150 * // This snippet has been automatically generated and should be regarded as a code template only. 151 * // It will require modifications to work: 152 * // - It may require correct/in-range values for request initialization. 153 * // - It may require specifying regional endpoints when creating the service client as shown in 154 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 155 * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { 156 * EntityTypeName name = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]"); 157 * EntityType response = entityTypesClient.getEntityType(name); 158 * } 159 * }</pre> 160 * 161 * <p>======================= EnvironmentsClient ======================= 162 * 163 * <p>Service Description: Service for managing 164 * [Environments][google.cloud.dialogflow.v2beta1.Environment]. 165 * 166 * <p>Sample for EnvironmentsClient: 167 * 168 * <pre>{@code 169 * // This snippet has been automatically generated and should be regarded as a code template only. 170 * // It will require modifications to work: 171 * // - It may require correct/in-range values for request initialization. 172 * // - It may require specifying regional endpoints when creating the service client as shown in 173 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 174 * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) { 175 * GetEnvironmentRequest request = 176 * GetEnvironmentRequest.newBuilder() 177 * .setName( 178 * EnvironmentName.ofProjectEnvironmentName("[PROJECT]", "[ENVIRONMENT]").toString()) 179 * .build(); 180 * Environment response = environmentsClient.getEnvironment(request); 181 * } 182 * }</pre> 183 * 184 * <p>======================= FulfillmentsClient ======================= 185 * 186 * <p>Service Description: Service for managing 187 * [Fulfillments][google.cloud.dialogflow.v2beta1.Fulfillment]. 188 * 189 * <p>Sample for FulfillmentsClient: 190 * 191 * <pre>{@code 192 * // This snippet has been automatically generated and should be regarded as a code template only. 193 * // It will require modifications to work: 194 * // - It may require correct/in-range values for request initialization. 195 * // - It may require specifying regional endpoints when creating the service client as shown in 196 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 197 * try (FulfillmentsClient fulfillmentsClient = FulfillmentsClient.create()) { 198 * FulfillmentName name = FulfillmentName.ofProjectName("[PROJECT]"); 199 * Fulfillment response = fulfillmentsClient.getFulfillment(name); 200 * } 201 * }</pre> 202 * 203 * <p>======================= IntentsClient ======================= 204 * 205 * <p>Service Description: Service for managing [Intents][google.cloud.dialogflow.v2beta1.Intent]. 206 * 207 * <p>Sample for IntentsClient: 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 (IntentsClient intentsClient = IntentsClient.create()) { 216 * IntentName name = IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]"); 217 * Intent response = intentsClient.getIntent(name); 218 * } 219 * }</pre> 220 * 221 * <p>======================= KnowledgeBasesClient ======================= 222 * 223 * <p>Service Description: Service for managing 224 * [KnowledgeBases][google.cloud.dialogflow.v2beta1.KnowledgeBase]. 225 * 226 * <p>Sample for KnowledgeBasesClient: 227 * 228 * <pre>{@code 229 * // This snippet has been automatically generated and should be regarded as a code template only. 230 * // It will require modifications to work: 231 * // - It may require correct/in-range values for request initialization. 232 * // - It may require specifying regional endpoints when creating the service client as shown in 233 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 234 * try (KnowledgeBasesClient knowledgeBasesClient = KnowledgeBasesClient.create()) { 235 * KnowledgeBaseName name = 236 * KnowledgeBaseName.ofProjectKnowledgeBaseName("[PROJECT]", "[KNOWLEDGE_BASE]"); 237 * KnowledgeBase response = knowledgeBasesClient.getKnowledgeBase(name); 238 * } 239 * }</pre> 240 * 241 * <p>======================= ParticipantsClient ======================= 242 * 243 * <p>Service Description: Service for managing 244 * [Participants][google.cloud.dialogflow.v2beta1.Participant]. 245 * 246 * <p>Sample for ParticipantsClient: 247 * 248 * <pre>{@code 249 * // This snippet has been automatically generated and should be regarded as a code template only. 250 * // It will require modifications to work: 251 * // - It may require correct/in-range values for request initialization. 252 * // - It may require specifying regional endpoints when creating the service client as shown in 253 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 254 * try (ParticipantsClient participantsClient = ParticipantsClient.create()) { 255 * ConversationName parent = 256 * ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]"); 257 * Participant participant = Participant.newBuilder().build(); 258 * Participant response = participantsClient.createParticipant(parent, participant); 259 * } 260 * }</pre> 261 * 262 * <p>======================= SessionsClient ======================= 263 * 264 * <p>Service Description: A service used for session interactions. 265 * 266 * <p>For more information, see the [API interactions 267 * guide](https://cloud.google.com/dialogflow/docs/api-overview). 268 * 269 * <p>Sample for SessionsClient: 270 * 271 * <pre>{@code 272 * // This snippet has been automatically generated and should be regarded as a code template only. 273 * // It will require modifications to work: 274 * // - It may require correct/in-range values for request initialization. 275 * // - It may require specifying regional endpoints when creating the service client as shown in 276 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 277 * try (SessionsClient sessionsClient = SessionsClient.create()) { 278 * SessionName session = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]"); 279 * QueryInput queryInput = QueryInput.newBuilder().build(); 280 * DetectIntentResponse response = sessionsClient.detectIntent(session, queryInput); 281 * } 282 * }</pre> 283 * 284 * <p>======================= SessionEntityTypesClient ======================= 285 * 286 * <p>Service Description: Service for managing 287 * [SessionEntityTypes][google.cloud.dialogflow.v2beta1.SessionEntityType]. 288 * 289 * <p>Sample for SessionEntityTypesClient: 290 * 291 * <pre>{@code 292 * // This snippet has been automatically generated and should be regarded as a code template only. 293 * // It will require modifications to work: 294 * // - It may require correct/in-range values for request initialization. 295 * // - It may require specifying regional endpoints when creating the service client as shown in 296 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 297 * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) { 298 * SessionEntityTypeName name = 299 * SessionEntityTypeName.ofProjectSessionEntityTypeName( 300 * "[PROJECT]", "[SESSION]", "[ENTITY_TYPE]"); 301 * SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name); 302 * } 303 * }</pre> 304 * 305 * <p>======================= VersionsClient ======================= 306 * 307 * <p>Service Description: Service for managing [Versions][google.cloud.dialogflow.v2beta1.Version]. 308 * 309 * <p>Sample for VersionsClient: 310 * 311 * <pre>{@code 312 * // This snippet has been automatically generated and should be regarded as a code template only. 313 * // It will require modifications to work: 314 * // - It may require correct/in-range values for request initialization. 315 * // - It may require specifying regional endpoints when creating the service client as shown in 316 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 317 * try (VersionsClient versionsClient = VersionsClient.create()) { 318 * VersionName name = VersionName.ofProjectVersionName("[PROJECT]", "[VERSION]"); 319 * Version response = versionsClient.getVersion(name); 320 * } 321 * }</pre> 322 */ 323 @Generated("by gapic-generator-java") 324 package com.google.cloud.dialogflow.v2beta1; 325 326 import javax.annotation.Generated; 327