| // This is a generated file (see the discoveryapis_generator project). |
| |
| // ignore_for_file: camel_case_types |
| // ignore_for_file: comment_references |
| // ignore_for_file: file_names |
| // ignore_for_file: library_names |
| // ignore_for_file: lines_longer_than_80_chars |
| // ignore_for_file: non_constant_identifier_names |
| // ignore_for_file: prefer_expression_function_bodies |
| // ignore_for_file: prefer_interpolation_to_compose_strings |
| // ignore_for_file: unnecessary_brace_in_string_interps |
| // ignore_for_file: unnecessary_lambdas |
| // ignore_for_file: unnecessary_string_interpolations |
| |
| /// Dialogflow API - v2 |
| /// |
| /// Builds conversational interfaces (for example, chatbots, and voice-powered |
| /// apps and devices). |
| /// |
| /// For more information, see <https://cloud.google.com/dialogflow/> |
| /// |
| /// Create an instance of [DialogflowApi] to access these resources: |
| /// |
| /// - [ProjectsResource] |
| /// - [ProjectsAgentResource] |
| /// - [ProjectsAgentEntityTypesResource] |
| /// - [ProjectsAgentEntityTypesEntitiesResource] |
| /// - [ProjectsAgentEnvironmentsResource] |
| /// - [ProjectsAgentEnvironmentsIntentsResource] |
| /// - [ProjectsAgentEnvironmentsUsersResource] |
| /// - [ProjectsAgentEnvironmentsUsersSessionsResource] |
| /// - [ProjectsAgentEnvironmentsUsersSessionsContextsResource] |
| /// - [ProjectsAgentEnvironmentsUsersSessionsEntityTypesResource] |
| /// - [ProjectsAgentIntentsResource] |
| /// - [ProjectsAgentKnowledgeBasesResource] |
| /// - [ProjectsAgentKnowledgeBasesDocumentsResource] |
| /// - [ProjectsAgentSessionsResource] |
| /// - [ProjectsAgentSessionsContextsResource] |
| /// - [ProjectsAgentSessionsEntityTypesResource] |
| /// - [ProjectsAgentVersionsResource] |
| /// - [ProjectsAnswerRecordsResource] |
| /// - [ProjectsConversationProfilesResource] |
| /// - [ProjectsConversationsResource] |
| /// - [ProjectsConversationsMessagesResource] |
| /// - [ProjectsConversationsParticipantsResource] |
| /// - [ProjectsConversationsParticipantsSuggestionsResource] |
| /// - [ProjectsKnowledgeBasesResource] |
| /// - [ProjectsKnowledgeBasesDocumentsResource] |
| /// - [ProjectsLocationsResource] |
| /// - [ProjectsLocationsAgentResource] |
| /// - [ProjectsLocationsAgentEntityTypesResource] |
| /// - [ProjectsLocationsAgentEntityTypesEntitiesResource] |
| /// - [ProjectsLocationsAgentEnvironmentsResource] |
| /// - [ProjectsLocationsAgentEnvironmentsIntentsResource] |
| /// - [ProjectsLocationsAgentEnvironmentsUsersResource] |
| /// - [ProjectsLocationsAgentEnvironmentsUsersSessionsResource] |
| /// - [ProjectsLocationsAgentEnvironmentsUsersSessionsContextsResource] |
| /// - [ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesResource] |
| /// - [ProjectsLocationsAgentIntentsResource] |
| /// - [ProjectsLocationsAgentSessionsResource] |
| /// - [ProjectsLocationsAgentSessionsContextsResource] |
| /// - [ProjectsLocationsAgentSessionsEntityTypesResource] |
| /// - [ProjectsLocationsAgentVersionsResource] |
| /// - [ProjectsLocationsAnswerRecordsResource] |
| /// - [ProjectsLocationsConversationProfilesResource] |
| /// - [ProjectsLocationsConversationsResource] |
| /// - [ProjectsLocationsConversationsMessagesResource] |
| /// - [ProjectsLocationsConversationsParticipantsResource] |
| /// - [ProjectsLocationsConversationsParticipantsSuggestionsResource] |
| /// - [ProjectsLocationsKnowledgeBasesResource] |
| /// - [ProjectsLocationsKnowledgeBasesDocumentsResource] |
| /// - [ProjectsLocationsOperationsResource] |
| /// - [ProjectsOperationsResource] |
| library dialogflow.v2; |
| |
| import 'dart:async' as async; |
| import 'dart:convert' as convert; |
| import 'dart:core' as core; |
| |
| import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| import 'package:http/http.dart' as http; |
| |
| import '../src/user_agent.dart'; |
| |
| export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' |
| show ApiRequestError, DetailedApiRequestError; |
| |
| /// Builds conversational interfaces (for example, chatbots, and voice-powered |
| /// apps and devices). |
| class DialogflowApi { |
| /// See, edit, configure, and delete your Google Cloud data and see the email |
| /// address for your Google Account. |
| static const cloudPlatformScope = |
| 'https://www.googleapis.com/auth/cloud-platform'; |
| |
| /// View, manage and query your Dialogflow agents |
| static const dialogflowScope = 'https://www.googleapis.com/auth/dialogflow'; |
| |
| final commons.ApiRequester _requester; |
| |
| ProjectsResource get projects => ProjectsResource(_requester); |
| |
| DialogflowApi(http.Client client, |
| {core.String rootUrl = 'https://dialogflow.googleapis.com/', |
| core.String servicePath = ''}) |
| : _requester = |
| commons.ApiRequester(client, rootUrl, servicePath, requestHeaders); |
| } |
| |
| class ProjectsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsAgentResource get agent => ProjectsAgentResource(_requester); |
| ProjectsAnswerRecordsResource get answerRecords => |
| ProjectsAnswerRecordsResource(_requester); |
| ProjectsConversationProfilesResource get conversationProfiles => |
| ProjectsConversationProfilesResource(_requester); |
| ProjectsConversationsResource get conversations => |
| ProjectsConversationsResource(_requester); |
| ProjectsKnowledgeBasesResource get knowledgeBases => |
| ProjectsKnowledgeBasesResource(_requester); |
| ProjectsLocationsResource get locations => |
| ProjectsLocationsResource(_requester); |
| ProjectsOperationsResource get operations => |
| ProjectsOperationsResource(_requester); |
| |
| ProjectsResource(commons.ApiRequester client) : _requester = client; |
| |
| /// Deletes the specified agent. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project that the agent to delete is associated |
| /// with. Format: `projects/`. |
| /// Value must have pattern `^projects/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> deleteAgent( |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/agent'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified agent. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project that the agent to fetch is associated |
| /// with. Format: `projects/`. |
| /// Value must have pattern `^projects/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Agent]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Agent> getAgent( |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/agent'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Agent.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Creates/updates the specified agent. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project of this agent. Format: `projects/`. |
| /// Value must have pattern `^projects/\[^/\]+$`. |
| /// |
| /// [updateMask] - Optional. The mask to control which fields get updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Agent]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Agent> setAgent( |
| GoogleCloudDialogflowV2Agent request, |
| core.String parent, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/agent'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Agent.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsAgentResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsAgentEntityTypesResource get entityTypes => |
| ProjectsAgentEntityTypesResource(_requester); |
| ProjectsAgentEnvironmentsResource get environments => |
| ProjectsAgentEnvironmentsResource(_requester); |
| ProjectsAgentIntentsResource get intents => |
| ProjectsAgentIntentsResource(_requester); |
| ProjectsAgentKnowledgeBasesResource get knowledgeBases => |
| ProjectsAgentKnowledgeBasesResource(_requester); |
| ProjectsAgentSessionsResource get sessions => |
| ProjectsAgentSessionsResource(_requester); |
| ProjectsAgentVersionsResource get versions => |
| ProjectsAgentVersionsResource(_requester); |
| |
| ProjectsAgentResource(commons.ApiRequester client) : _requester = client; |
| |
| /// Exports the specified agent to a ZIP file. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project that the agent to export is associated |
| /// with. Format: `projects/`. |
| /// Value must have pattern `^projects/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> export( |
| GoogleCloudDialogflowV2ExportAgentRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/agent:export'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the fulfillment. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the fulfillment. Format: |
| /// `projects//agent/fulfillment`. |
| /// Value must have pattern `^projects/\[^/\]+/agent/fulfillment$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Fulfillment]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Fulfillment> getFulfillment( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Fulfillment.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Gets agent validation result. |
| /// |
| /// Agent validation is performed during training time and is updated |
| /// automatically when training is completed. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project that the agent is associated with. |
| /// Format: `projects/`. |
| /// Value must have pattern `^projects/\[^/\]+$`. |
| /// |
| /// [languageCode] - Optional. The language for which you want a validation |
| /// result. If not specified, the agent's default language is used. |
| /// [Many languages](https://cloud.google.com/dialogflow/docs/reference/language) |
| /// are supported. Note: languages must be enabled in the agent before they |
| /// can be used. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ValidationResult]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ValidationResult> getValidationResult( |
| core.String parent, { |
| core.String? languageCode, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (languageCode != null) 'languageCode': [languageCode], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/agent/validationResult'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ValidationResult.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Imports the specified agent from a ZIP file. |
| /// |
| /// Uploads new intents and entity types without deleting the existing ones. |
| /// Intents and entity types with the same name are replaced with the new |
| /// versions from ImportAgentRequest. After the import, the imported draft |
| /// agent will be trained automatically (unless disabled in agent settings). |
| /// However, once the import is done, training may not be completed yet. |
| /// Please call TrainAgent and wait for the operation it returns in order to |
| /// train explicitly. An operation which tracks when importing is complete. It |
| /// only tracks when the draft agent is updated not when it is done training. |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project that the agent to import is associated |
| /// with. Format: `projects/`. |
| /// Value must have pattern `^projects/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> import( |
| GoogleCloudDialogflowV2ImportAgentRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/agent:import'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Restores the specified agent from a ZIP file. |
| /// |
| /// Replaces the current agent version with a new one. All the intents and |
| /// entity types in the older version are deleted. After the restore, the |
| /// restored draft agent will be trained automatically (unless disabled in |
| /// agent settings). However, once the restore is done, training may not be |
| /// completed yet. Please call TrainAgent and wait for the operation it |
| /// returns in order to train explicitly. An operation which tracks when |
| /// restoring is complete. It only tracks when the draft agent is updated not |
| /// when it is done training. Note: You should always train an agent prior to |
| /// sending it queries. See the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project that the agent to restore is associated |
| /// with. Format: `projects/`. |
| /// Value must have pattern `^projects/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> restore( |
| GoogleCloudDialogflowV2RestoreAgentRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/agent:restore'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of agents. |
| /// |
| /// Since there is at most one conversational agent per project, this method |
| /// is useful primarily for listing all agents across projects the caller has |
| /// access to. One can achieve that with a wildcard project collection id "-". |
| /// Refer to \[List |
| /// Sub-Collections\](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project to list agents from. Format: `projects/`. |
| /// Value must have pattern `^projects/\[^/\]+$`. |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - The next_page_token value returned from a previous list |
| /// request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2SearchAgentsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2SearchAgentsResponse> search( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/agent:search'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2SearchAgentsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Trains the specified agent. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project that the agent to train is associated |
| /// with. Format: `projects/`. |
| /// Value must have pattern `^projects/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> train( |
| GoogleCloudDialogflowV2TrainAgentRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/agent:train'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the fulfillment. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The unique identifier of the fulfillment. Supported |
| /// formats: - `projects//agent/fulfillment` - |
| /// `projects//locations//agent/fulfillment` This field is not used for |
| /// Fulfillment in an Environment. |
| /// Value must have pattern `^projects/\[^/\]+/agent/fulfillment$`. |
| /// |
| /// [updateMask] - Required. The mask to control which fields get updated. If |
| /// the mask is not present, all fields will be updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Fulfillment]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Fulfillment> updateFulfillment( |
| GoogleCloudDialogflowV2Fulfillment request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Fulfillment.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsAgentEntityTypesResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsAgentEntityTypesEntitiesResource get entities => |
| ProjectsAgentEntityTypesEntitiesResource(_requester); |
| |
| ProjectsAgentEntityTypesResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Deletes entity types in the specified agent. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the agent to delete all entities types |
| /// for. Format: `projects//agent`. |
| /// Value must have pattern `^projects/\[^/\]+/agent$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> batchDelete( |
| GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/entityTypes:batchDelete'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates/Creates multiple entity types in the specified agent. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the agent to update or create entity |
| /// types in. Format: `projects//agent`. |
| /// Value must have pattern `^projects/\[^/\]+/agent$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> batchUpdate( |
| GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/entityTypes:batchUpdate'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Creates an entity type in the specified agent. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The agent to create a entity type for. Format: |
| /// `projects//agent`. |
| /// Value must have pattern `^projects/\[^/\]+/agent$`. |
| /// |
| /// [languageCode] - Optional. The language used to access language-specific |
| /// data. If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2EntityType]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2EntityType> create( |
| GoogleCloudDialogflowV2EntityType request, |
| core.String parent, { |
| core.String? languageCode, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (languageCode != null) 'languageCode': [languageCode], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/entityTypes'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2EntityType.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified entity type. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the entity type to delete. Format: |
| /// `projects//agent/entityTypes/`. |
| /// Value must have pattern `^projects/\[^/\]+/agent/entityTypes/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> delete( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified entity type. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the entity type. Format: |
| /// `projects//agent/entityTypes/`. |
| /// Value must have pattern `^projects/\[^/\]+/agent/entityTypes/\[^/\]+$`. |
| /// |
| /// [languageCode] - Optional. The language used to access language-specific |
| /// data. If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2EntityType]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2EntityType> get( |
| core.String name, { |
| core.String? languageCode, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (languageCode != null) 'languageCode': [languageCode], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2EntityType.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all entity types in the specified agent. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The agent to list all entity types from. Format: |
| /// `projects//agent`. |
| /// Value must have pattern `^projects/\[^/\]+/agent$`. |
| /// |
| /// [languageCode] - Optional. The language used to access language-specific |
| /// data. If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListEntityTypesResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListEntityTypesResponse> list( |
| core.String parent, { |
| core.String? languageCode, |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (languageCode != null) 'languageCode': [languageCode], |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/entityTypes'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListEntityTypesResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified entity type. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - The unique identifier of the entity type. Required for |
| /// EntityTypes.UpdateEntityType and EntityTypes.BatchUpdateEntityTypes |
| /// methods. Format: `projects//agent/entityTypes/`. |
| /// Value must have pattern `^projects/\[^/\]+/agent/entityTypes/\[^/\]+$`. |
| /// |
| /// [languageCode] - Optional. The language used to access language-specific |
| /// data. If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// [updateMask] - Optional. The mask to control which fields get updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2EntityType]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2EntityType> patch( |
| GoogleCloudDialogflowV2EntityType request, |
| core.String name, { |
| core.String? languageCode, |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (languageCode != null) 'languageCode': [languageCode], |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2EntityType.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsAgentEntityTypesEntitiesResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsAgentEntityTypesEntitiesResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates multiple new entities in the specified entity type. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the entity type to create entities in. |
| /// Format: `projects//agent/entityTypes/`. |
| /// Value must have pattern `^projects/\[^/\]+/agent/entityTypes/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> batchCreate( |
| GoogleCloudDialogflowV2BatchCreateEntitiesRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/entities:batchCreate'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes entities in the specified entity type. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the entity type to delete entries for. |
| /// Format: `projects//agent/entityTypes/`. |
| /// Value must have pattern `^projects/\[^/\]+/agent/entityTypes/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> batchDelete( |
| GoogleCloudDialogflowV2BatchDeleteEntitiesRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/entities:batchDelete'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates or creates multiple entities in the specified entity type. |
| /// |
| /// This method does not affect entities in the entity type that aren't |
| /// explicitly specified in the request. Note: You should always train an |
| /// agent prior to sending it queries. See the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the entity type to update or create |
| /// entities in. Format: `projects//agent/entityTypes/`. |
| /// Value must have pattern `^projects/\[^/\]+/agent/entityTypes/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> batchUpdate( |
| GoogleCloudDialogflowV2BatchUpdateEntitiesRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/entities:batchUpdate'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsAgentEnvironmentsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsAgentEnvironmentsIntentsResource get intents => |
| ProjectsAgentEnvironmentsIntentsResource(_requester); |
| ProjectsAgentEnvironmentsUsersResource get users => |
| ProjectsAgentEnvironmentsUsersResource(_requester); |
| |
| ProjectsAgentEnvironmentsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates an agent environment. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The agent to create an environment for. Supported |
| /// formats: - `projects//agent` - `projects//locations//agent` |
| /// Value must have pattern `^projects/\[^/\]+/agent$`. |
| /// |
| /// [environmentId] - Required. The unique id of the new environment. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Environment]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Environment> create( |
| GoogleCloudDialogflowV2Environment request, |
| core.String parent, { |
| core.String? environmentId, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (environmentId != null) 'environmentId': [environmentId], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/environments'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Environment.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified agent environment. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the environment to delete. / Format: - |
| /// `projects//agent/environments/` - |
| /// `projects//locations//agent/environments/` The environment ID for the |
| /// default environment is `-`. |
| /// Value must have pattern `^projects/\[^/\]+/agent/environments/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> delete( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified agent environment. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the environment. Supported formats: - |
| /// `projects//agent/environments/` - |
| /// `projects//locations//agent/environments/` The environment ID for the |
| /// default environment is `-`. |
| /// Value must have pattern `^projects/\[^/\]+/agent/environments/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Environment]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Environment> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Environment.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Gets the history of the specified environment. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the environment to retrieve history for. |
| /// Supported formats: - `projects//agent/environments/` - |
| /// `projects//locations//agent/environments/` The environment ID for the |
| /// default environment is `-`. |
| /// Value must have pattern `^projects/\[^/\]+/agent/environments/\[^/\]+$`. |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2EnvironmentHistory]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2EnvironmentHistory> getHistory( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/history'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2EnvironmentHistory.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all non-default environments of the specified agent. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The agent to list all environments from. Format: - |
| /// `projects//agent` - `projects//locations//agent` |
| /// Value must have pattern `^projects/\[^/\]+/agent$`. |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListEnvironmentsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListEnvironmentsResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/environments'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListEnvironmentsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified agent environment. |
| /// |
| /// This method allows you to deploy new agent versions into the environment. |
| /// When an environment is pointed to a new agent version by setting |
| /// `environment.agent_version`, the environment is temporarily set to the |
| /// `LOADING` state. During that time, the environment continues serving the |
| /// previous version of the agent. After the new agent version is done |
| /// loading, the environment is set back to the `RUNNING` state. You can use |
| /// "-" as Environment ID in environment name to update an agent version in |
| /// the default environment. WARNING: this will negate all recent changes to |
| /// the draft agent and can't be undone. You may want to save the draft agent |
| /// to a version before calling this method. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Output only. The unique identifier of this agent environment. |
| /// Supported formats: - `projects//agent/environments/` - |
| /// `projects//locations//agent/environments/` The environment ID for the |
| /// default environment is `-`. |
| /// Value must have pattern `^projects/\[^/\]+/agent/environments/\[^/\]+$`. |
| /// |
| /// [allowLoadToDraftAndDiscardChanges] - Optional. This field is used to |
| /// prevent accidental overwrite of the default environment, which is an |
| /// operation that cannot be undone. To confirm that the caller desires this |
| /// overwrite, this field must be explicitly set to true when updating the |
| /// default environment (environment ID = `-`). |
| /// |
| /// [updateMask] - Required. The mask to control which fields get updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Environment]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Environment> patch( |
| GoogleCloudDialogflowV2Environment request, |
| core.String name, { |
| core.bool? allowLoadToDraftAndDiscardChanges, |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (allowLoadToDraftAndDiscardChanges != null) |
| 'allowLoadToDraftAndDiscardChanges': [ |
| '${allowLoadToDraftAndDiscardChanges}' |
| ], |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Environment.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsAgentEnvironmentsIntentsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsAgentEnvironmentsIntentsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Returns the list of all intents in the specified agent. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The agent to list all intents from. Format: |
| /// `projects//agent` or `projects//locations//agent`. Alternatively, you can |
| /// specify the environment to list intents for. Format: |
| /// `projects//agent/environments/` or |
| /// `projects//locations//agent/environments/`. Note: training phrases of the |
| /// intents will not be returned for non-draft environment. |
| /// Value must have pattern `^projects/\[^/\]+/agent/environments/\[^/\]+$`. |
| /// |
| /// [intentView] - Optional. The resource view to apply to the returned |
| /// intent. |
| /// Possible string values are: |
| /// - "INTENT_VIEW_UNSPECIFIED" : Training phrases field is not populated in |
| /// the response. |
| /// - "INTENT_VIEW_FULL" : All fields are populated. |
| /// |
| /// [languageCode] - Optional. The language used to access language-specific |
| /// data. If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListIntentsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListIntentsResponse> list( |
| core.String parent, { |
| core.String? intentView, |
| core.String? languageCode, |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (intentView != null) 'intentView': [intentView], |
| if (languageCode != null) 'languageCode': [languageCode], |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/intents'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListIntentsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsAgentEnvironmentsUsersResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsAgentEnvironmentsUsersSessionsResource get sessions => |
| ProjectsAgentEnvironmentsUsersSessionsResource(_requester); |
| |
| ProjectsAgentEnvironmentsUsersResource(commons.ApiRequester client) |
| : _requester = client; |
| } |
| |
| class ProjectsAgentEnvironmentsUsersSessionsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsAgentEnvironmentsUsersSessionsContextsResource get contexts => |
| ProjectsAgentEnvironmentsUsersSessionsContextsResource(_requester); |
| ProjectsAgentEnvironmentsUsersSessionsEntityTypesResource get entityTypes => |
| ProjectsAgentEnvironmentsUsersSessionsEntityTypesResource(_requester); |
| |
| ProjectsAgentEnvironmentsUsersSessionsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Deletes all active contexts in the specified session. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the session to delete all contexts from. |
| /// Format: `projects//agent/sessions/` or |
| /// `projects//agent/environments//users//sessions/`. If `Environment ID` is |
| /// not specified we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> deleteContexts( |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/contexts'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Processes a natural language query and returns structured, actionable data |
| /// as a result. |
| /// |
| /// This method is not idempotent, because it may cause contexts and session |
| /// entity types to be updated, which in turn might affect results of future |
| /// queries. Note: Always use agent versions for production traffic. See |
| /// [Versions and environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [session] - Required. The name of the session this query is sent to. |
| /// Format: `projects//agent/sessions/`, or |
| /// `projects//agent/environments//users//sessions/`. If `Environment ID` is |
| /// not specified, we assume default 'draft' environment (`Environment ID` |
| /// might be referred to as environment name at some places). If `User ID` is |
| /// not specified, we are using "-". It's up to the API caller to choose an |
| /// appropriate `Session ID` and `User Id`. They can be a random number or |
| /// some type of user and session identifiers (preferably hashed). The length |
| /// of the `Session ID` and `User ID` must not exceed 36 characters. For more |
| /// information, see the |
| /// [API interactions guide](https://cloud.google.com/dialogflow/docs/api-overview). |
| /// Note: Always use agent versions for production traffic. See |
| /// [Versions and environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2DetectIntentResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2DetectIntentResponse> detectIntent( |
| GoogleCloudDialogflowV2DetectIntentRequest request, |
| core.String session, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$session') + ':detectIntent'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2DetectIntentResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsAgentEnvironmentsUsersSessionsContextsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsAgentEnvironmentsUsersSessionsContextsResource( |
| commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates a context. |
| /// |
| /// If the specified context already exists, overrides the context. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The session to create a context for. Format: |
| /// `projects//agent/sessions/` or |
| /// `projects//agent/environments//users//sessions/`. If `Environment ID` is |
| /// not specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Context]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Context> create( |
| GoogleCloudDialogflowV2Context request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/contexts'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Context.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified context. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the context to delete. Format: |
| /// `projects//agent/sessions//contexts/` or |
| /// `projects//agent/environments//users//sessions//contexts/`. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/contexts/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> delete( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified context. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the context. Format: |
| /// `projects//agent/sessions//contexts/` or |
| /// `projects//agent/environments//users//sessions//contexts/`. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/contexts/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Context]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Context> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Context.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all contexts in the specified session. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The session to list all contexts from. Format: |
| /// `projects//agent/sessions/` or |
| /// `projects//agent/environments//users//sessions/`. If `Environment ID` is |
| /// not specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListContextsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListContextsResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/contexts'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListContextsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified context. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The unique identifier of the context. Format: |
| /// `projects//agent/sessions//contexts/`, or |
| /// `projects//agent/environments//users//sessions//contexts/`. The `Context |
| /// ID` is always converted to lowercase, may only contain characters in |
| /// a-zA-Z0-9_-% and may be at most 250 bytes long. If `Environment ID` is not |
| /// specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. The following context names are |
| /// reserved for internal use by Dialogflow. You should not use these contexts |
| /// or create contexts with these names: * `__system_counters__` * |
| /// `*_id_dialog_context` * `*_dialog_params_size` |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/contexts/\[^/\]+$`. |
| /// |
| /// [updateMask] - Optional. The mask to control which fields get updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Context]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Context> patch( |
| GoogleCloudDialogflowV2Context request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Context.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsAgentEnvironmentsUsersSessionsEntityTypesResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsAgentEnvironmentsUsersSessionsEntityTypesResource( |
| commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates a session entity type. |
| /// |
| /// If the specified session entity type already exists, overrides the session |
| /// entity type. This method doesn't work with Google Assistant integration. |
| /// Contact Dialogflow support if you need to use session entities with Google |
| /// Assistant integration. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The session to create a session entity type for. |
| /// Format: `projects//agent/sessions/` or |
| /// `projects//agent/environments//users// sessions/`. If `Environment ID` is |
| /// not specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2SessionEntityType]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2SessionEntityType> create( |
| GoogleCloudDialogflowV2SessionEntityType request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/entityTypes'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2SessionEntityType.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified session entity type. |
| /// |
| /// This method doesn't work with Google Assistant integration. Contact |
| /// Dialogflow support if you need to use session entities with Google |
| /// Assistant integration. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the entity type to delete. Format: |
| /// `projects//agent/sessions//entityTypes/` or |
| /// `projects//agent/environments//users//sessions//entityTypes/`. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/entityTypes/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> delete( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified session entity type. |
| /// |
| /// This method doesn't work with Google Assistant integration. Contact |
| /// Dialogflow support if you need to use session entities with Google |
| /// Assistant integration. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the session entity type. Format: |
| /// `projects//agent/sessions//entityTypes/` or |
| /// `projects//agent/environments//users//sessions//entityTypes/`. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/entityTypes/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2SessionEntityType]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2SessionEntityType> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2SessionEntityType.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all session entity types in the specified session. |
| /// |
| /// This method doesn't work with Google Assistant integration. Contact |
| /// Dialogflow support if you need to use session entities with Google |
| /// Assistant integration. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The session to list all session entity types from. |
| /// Format: `projects//agent/sessions/` or |
| /// `projects//agent/environments//users// sessions/`. If `Environment ID` is |
| /// not specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListSessionEntityTypesResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListSessionEntityTypesResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/entityTypes'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListSessionEntityTypesResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified session entity type. |
| /// |
| /// This method doesn't work with Google Assistant integration. Contact |
| /// Dialogflow support if you need to use session entities with Google |
| /// Assistant integration. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The unique identifier of this session entity type. |
| /// Format: `projects//agent/sessions//entityTypes/`, or |
| /// `projects//agent/environments//users//sessions//entityTypes/`. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. `` must be the |
| /// display name of an existing entity type in the same agent that will be |
| /// overridden or supplemented. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/entityTypes/\[^/\]+$`. |
| /// |
| /// [updateMask] - Optional. The mask to control which fields get updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2SessionEntityType]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2SessionEntityType> patch( |
| GoogleCloudDialogflowV2SessionEntityType request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2SessionEntityType.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsAgentIntentsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsAgentIntentsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Deletes intents in the specified agent. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the agent to delete all entities types |
| /// for. Format: `projects//agent`. |
| /// Value must have pattern `^projects/\[^/\]+/agent$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> batchDelete( |
| GoogleCloudDialogflowV2BatchDeleteIntentsRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/intents:batchDelete'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates/Creates multiple intents in the specified agent. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the agent to update or create intents in. |
| /// Format: `projects//agent`. |
| /// Value must have pattern `^projects/\[^/\]+/agent$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> batchUpdate( |
| GoogleCloudDialogflowV2BatchUpdateIntentsRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/intents:batchUpdate'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Creates an intent in the specified agent. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The agent to create a intent for. Format: |
| /// `projects//agent`. |
| /// Value must have pattern `^projects/\[^/\]+/agent$`. |
| /// |
| /// [intentView] - Optional. The resource view to apply to the returned |
| /// intent. |
| /// Possible string values are: |
| /// - "INTENT_VIEW_UNSPECIFIED" : Training phrases field is not populated in |
| /// the response. |
| /// - "INTENT_VIEW_FULL" : All fields are populated. |
| /// |
| /// [languageCode] - Optional. The language used to access language-specific |
| /// data. If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Intent]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Intent> create( |
| GoogleCloudDialogflowV2Intent request, |
| core.String parent, { |
| core.String? intentView, |
| core.String? languageCode, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (intentView != null) 'intentView': [intentView], |
| if (languageCode != null) 'languageCode': [languageCode], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/intents'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Intent.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified intent and its direct or indirect followup intents. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the intent to delete. If this intent has |
| /// direct or indirect followup intents, we also delete them. Format: |
| /// `projects//agent/intents/`. |
| /// Value must have pattern `^projects/\[^/\]+/agent/intents/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> delete( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified intent. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the intent. Format: |
| /// `projects//agent/intents/`. |
| /// Value must have pattern `^projects/\[^/\]+/agent/intents/\[^/\]+$`. |
| /// |
| /// [intentView] - Optional. The resource view to apply to the returned |
| /// intent. |
| /// Possible string values are: |
| /// - "INTENT_VIEW_UNSPECIFIED" : Training phrases field is not populated in |
| /// the response. |
| /// - "INTENT_VIEW_FULL" : All fields are populated. |
| /// |
| /// [languageCode] - Optional. The language used to access language-specific |
| /// data. If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Intent]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Intent> get( |
| core.String name, { |
| core.String? intentView, |
| core.String? languageCode, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (intentView != null) 'intentView': [intentView], |
| if (languageCode != null) 'languageCode': [languageCode], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Intent.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all intents in the specified agent. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The agent to list all intents from. Format: |
| /// `projects//agent` or `projects//locations//agent`. Alternatively, you can |
| /// specify the environment to list intents for. Format: |
| /// `projects//agent/environments/` or |
| /// `projects//locations//agent/environments/`. Note: training phrases of the |
| /// intents will not be returned for non-draft environment. |
| /// Value must have pattern `^projects/\[^/\]+/agent$`. |
| /// |
| /// [intentView] - Optional. The resource view to apply to the returned |
| /// intent. |
| /// Possible string values are: |
| /// - "INTENT_VIEW_UNSPECIFIED" : Training phrases field is not populated in |
| /// the response. |
| /// - "INTENT_VIEW_FULL" : All fields are populated. |
| /// |
| /// [languageCode] - Optional. The language used to access language-specific |
| /// data. If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListIntentsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListIntentsResponse> list( |
| core.String parent, { |
| core.String? intentView, |
| core.String? languageCode, |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (intentView != null) 'intentView': [intentView], |
| if (languageCode != null) 'languageCode': [languageCode], |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/intents'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListIntentsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified intent. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Optional. The unique identifier of this intent. Required for |
| /// Intents.UpdateIntent and Intents.BatchUpdateIntents methods. Format: |
| /// `projects//agent/intents/`. |
| /// Value must have pattern `^projects/\[^/\]+/agent/intents/\[^/\]+$`. |
| /// |
| /// [intentView] - Optional. The resource view to apply to the returned |
| /// intent. |
| /// Possible string values are: |
| /// - "INTENT_VIEW_UNSPECIFIED" : Training phrases field is not populated in |
| /// the response. |
| /// - "INTENT_VIEW_FULL" : All fields are populated. |
| /// |
| /// [languageCode] - Optional. The language used to access language-specific |
| /// data. If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// [updateMask] - Optional. The mask to control which fields get updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Intent]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Intent> patch( |
| GoogleCloudDialogflowV2Intent request, |
| core.String name, { |
| core.String? intentView, |
| core.String? languageCode, |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (intentView != null) 'intentView': [intentView], |
| if (languageCode != null) 'languageCode': [languageCode], |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Intent.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsAgentKnowledgeBasesResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsAgentKnowledgeBasesDocumentsResource get documents => |
| ProjectsAgentKnowledgeBasesDocumentsResource(_requester); |
| |
| ProjectsAgentKnowledgeBasesResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates a knowledge base. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project to create a knowledge base for. Format: |
| /// `projects//locations/`. |
| /// Value must have pattern `^projects/\[^/\]+/agent$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2KnowledgeBase]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2KnowledgeBase> create( |
| GoogleCloudDialogflowV2KnowledgeBase request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/knowledgeBases'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2KnowledgeBase.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified knowledge base. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the knowledge base to delete. Format: |
| /// `projects//locations//knowledgeBases/`. |
| /// Value must have pattern `^projects/\[^/\]+/agent/knowledgeBases/\[^/\]+$`. |
| /// |
| /// [force] - Optional. Force deletes the knowledge base. When set to true, |
| /// any documents in the knowledge base are also deleted. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> delete( |
| core.String name, { |
| core.bool? force, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (force != null) 'force': ['${force}'], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified knowledge base. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the knowledge base to retrieve. Format |
| /// `projects//locations//knowledgeBases/`. |
| /// Value must have pattern `^projects/\[^/\]+/agent/knowledgeBases/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2KnowledgeBase]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2KnowledgeBase> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2KnowledgeBase.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all knowledge bases of the specified agent. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project to list of knowledge bases for. Format: |
| /// `projects//locations/`. |
| /// Value must have pattern `^projects/\[^/\]+/agent$`. |
| /// |
| /// [pageSize] - The maximum number of items to return in a single page. By |
| /// default 10 and at most 100. |
| /// |
| /// [pageToken] - The next_page_token value returned from a previous list |
| /// request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListKnowledgeBasesResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListKnowledgeBasesResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/knowledgeBases'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListKnowledgeBasesResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified knowledge base. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - The knowledge base resource name. The name must be empty when |
| /// creating a knowledge base. Format: `projects//locations//knowledgeBases/`. |
| /// Value must have pattern `^projects/\[^/\]+/agent/knowledgeBases/\[^/\]+$`. |
| /// |
| /// [updateMask] - Optional. Not specified means `update all`. Currently, only |
| /// `display_name` can be updated, an InvalidArgument will be returned for |
| /// attempting to update other fields. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2KnowledgeBase]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2KnowledgeBase> patch( |
| GoogleCloudDialogflowV2KnowledgeBase request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2KnowledgeBase.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsAgentKnowledgeBasesDocumentsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsAgentKnowledgeBasesDocumentsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates a new document. |
| /// |
| /// Operation |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The knowledge base to create a document for. Format: |
| /// `projects//locations//knowledgeBases/`. |
| /// Value must have pattern `^projects/\[^/\]+/agent/knowledgeBases/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> create( |
| GoogleCloudDialogflowV2Document request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/documents'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified document. |
| /// |
| /// Operation |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the document to delete. Format: |
| /// `projects//locations//knowledgeBases//documents/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/knowledgeBases/\[^/\]+/documents/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> delete( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified document. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the document to retrieve. Format |
| /// `projects//locations//knowledgeBases//documents/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/knowledgeBases/\[^/\]+/documents/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Document]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Document> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Document.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all documents of the knowledge base. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The knowledge base to list all documents for. Format: |
| /// `projects//locations//knowledgeBases/`. |
| /// Value must have pattern `^projects/\[^/\]+/agent/knowledgeBases/\[^/\]+$`. |
| /// |
| /// [pageSize] - The maximum number of items to return in a single page. By |
| /// default 10 and at most 100. |
| /// |
| /// [pageToken] - The next_page_token value returned from a previous list |
| /// request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListDocumentsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListDocumentsResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/documents'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListDocumentsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified document. |
| /// |
| /// Operation |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Optional. The document resource name. The name must be empty when |
| /// creating a document. Format: |
| /// `projects//locations//knowledgeBases//documents/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/knowledgeBases/\[^/\]+/documents/\[^/\]+$`. |
| /// |
| /// [updateMask] - Optional. Not specified means `update all`. Currently, only |
| /// `display_name` can be updated, an InvalidArgument will be returned for |
| /// attempting to update other fields. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> patch( |
| GoogleCloudDialogflowV2Document request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Reloads the specified document from its specified source, content_uri or |
| /// content. |
| /// |
| /// The previously loaded content of the document will be deleted. Note: Even |
| /// when the content of the document has not changed, there still may be side |
| /// effects because of internal implementation changes. Note: The |
| /// `projects.agent.knowledgeBases.documents` resource is deprecated; only use |
| /// `projects.knowledgeBases.documents`. Operation |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the document to reload. Format: |
| /// `projects//locations//knowledgeBases//documents/` |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/knowledgeBases/\[^/\]+/documents/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> reload( |
| GoogleCloudDialogflowV2ReloadDocumentRequest request, |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name') + ':reload'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsAgentSessionsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsAgentSessionsContextsResource get contexts => |
| ProjectsAgentSessionsContextsResource(_requester); |
| ProjectsAgentSessionsEntityTypesResource get entityTypes => |
| ProjectsAgentSessionsEntityTypesResource(_requester); |
| |
| ProjectsAgentSessionsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Deletes all active contexts in the specified session. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the session to delete all contexts from. |
| /// Format: `projects//agent/sessions/` or |
| /// `projects//agent/environments//users//sessions/`. If `Environment ID` is |
| /// not specified we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. |
| /// Value must have pattern `^projects/\[^/\]+/agent/sessions/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> deleteContexts( |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/contexts'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Processes a natural language query and returns structured, actionable data |
| /// as a result. |
| /// |
| /// This method is not idempotent, because it may cause contexts and session |
| /// entity types to be updated, which in turn might affect results of future |
| /// queries. Note: Always use agent versions for production traffic. See |
| /// [Versions and environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [session] - Required. The name of the session this query is sent to. |
| /// Format: `projects//agent/sessions/`, or |
| /// `projects//agent/environments//users//sessions/`. If `Environment ID` is |
| /// not specified, we assume default 'draft' environment (`Environment ID` |
| /// might be referred to as environment name at some places). If `User ID` is |
| /// not specified, we are using "-". It's up to the API caller to choose an |
| /// appropriate `Session ID` and `User Id`. They can be a random number or |
| /// some type of user and session identifiers (preferably hashed). The length |
| /// of the `Session ID` and `User ID` must not exceed 36 characters. For more |
| /// information, see the |
| /// [API interactions guide](https://cloud.google.com/dialogflow/docs/api-overview). |
| /// Note: Always use agent versions for production traffic. See |
| /// [Versions and environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). |
| /// Value must have pattern `^projects/\[^/\]+/agent/sessions/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2DetectIntentResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2DetectIntentResponse> detectIntent( |
| GoogleCloudDialogflowV2DetectIntentRequest request, |
| core.String session, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$session') + ':detectIntent'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2DetectIntentResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsAgentSessionsContextsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsAgentSessionsContextsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates a context. |
| /// |
| /// If the specified context already exists, overrides the context. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The session to create a context for. Format: |
| /// `projects//agent/sessions/` or |
| /// `projects//agent/environments//users//sessions/`. If `Environment ID` is |
| /// not specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. |
| /// Value must have pattern `^projects/\[^/\]+/agent/sessions/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Context]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Context> create( |
| GoogleCloudDialogflowV2Context request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/contexts'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Context.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified context. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the context to delete. Format: |
| /// `projects//agent/sessions//contexts/` or |
| /// `projects//agent/environments//users//sessions//contexts/`. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/sessions/\[^/\]+/contexts/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> delete( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified context. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the context. Format: |
| /// `projects//agent/sessions//contexts/` or |
| /// `projects//agent/environments//users//sessions//contexts/`. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/sessions/\[^/\]+/contexts/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Context]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Context> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Context.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all contexts in the specified session. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The session to list all contexts from. Format: |
| /// `projects//agent/sessions/` or |
| /// `projects//agent/environments//users//sessions/`. If `Environment ID` is |
| /// not specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. |
| /// Value must have pattern `^projects/\[^/\]+/agent/sessions/\[^/\]+$`. |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListContextsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListContextsResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/contexts'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListContextsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified context. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The unique identifier of the context. Format: |
| /// `projects//agent/sessions//contexts/`, or |
| /// `projects//agent/environments//users//sessions//contexts/`. The `Context |
| /// ID` is always converted to lowercase, may only contain characters in |
| /// a-zA-Z0-9_-% and may be at most 250 bytes long. If `Environment ID` is not |
| /// specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. The following context names are |
| /// reserved for internal use by Dialogflow. You should not use these contexts |
| /// or create contexts with these names: * `__system_counters__` * |
| /// `*_id_dialog_context` * `*_dialog_params_size` |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/sessions/\[^/\]+/contexts/\[^/\]+$`. |
| /// |
| /// [updateMask] - Optional. The mask to control which fields get updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Context]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Context> patch( |
| GoogleCloudDialogflowV2Context request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Context.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsAgentSessionsEntityTypesResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsAgentSessionsEntityTypesResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates a session entity type. |
| /// |
| /// If the specified session entity type already exists, overrides the session |
| /// entity type. This method doesn't work with Google Assistant integration. |
| /// Contact Dialogflow support if you need to use session entities with Google |
| /// Assistant integration. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The session to create a session entity type for. |
| /// Format: `projects//agent/sessions/` or |
| /// `projects//agent/environments//users// sessions/`. If `Environment ID` is |
| /// not specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. |
| /// Value must have pattern `^projects/\[^/\]+/agent/sessions/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2SessionEntityType]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2SessionEntityType> create( |
| GoogleCloudDialogflowV2SessionEntityType request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/entityTypes'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2SessionEntityType.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified session entity type. |
| /// |
| /// This method doesn't work with Google Assistant integration. Contact |
| /// Dialogflow support if you need to use session entities with Google |
| /// Assistant integration. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the entity type to delete. Format: |
| /// `projects//agent/sessions//entityTypes/` or |
| /// `projects//agent/environments//users//sessions//entityTypes/`. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/sessions/\[^/\]+/entityTypes/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> delete( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified session entity type. |
| /// |
| /// This method doesn't work with Google Assistant integration. Contact |
| /// Dialogflow support if you need to use session entities with Google |
| /// Assistant integration. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the session entity type. Format: |
| /// `projects//agent/sessions//entityTypes/` or |
| /// `projects//agent/environments//users//sessions//entityTypes/`. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/sessions/\[^/\]+/entityTypes/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2SessionEntityType]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2SessionEntityType> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2SessionEntityType.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all session entity types in the specified session. |
| /// |
| /// This method doesn't work with Google Assistant integration. Contact |
| /// Dialogflow support if you need to use session entities with Google |
| /// Assistant integration. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The session to list all session entity types from. |
| /// Format: `projects//agent/sessions/` or |
| /// `projects//agent/environments//users// sessions/`. If `Environment ID` is |
| /// not specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. |
| /// Value must have pattern `^projects/\[^/\]+/agent/sessions/\[^/\]+$`. |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListSessionEntityTypesResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListSessionEntityTypesResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/entityTypes'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListSessionEntityTypesResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified session entity type. |
| /// |
| /// This method doesn't work with Google Assistant integration. Contact |
| /// Dialogflow support if you need to use session entities with Google |
| /// Assistant integration. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The unique identifier of this session entity type. |
| /// Format: `projects//agent/sessions//entityTypes/`, or |
| /// `projects//agent/environments//users//sessions//entityTypes/`. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. `` must be the |
| /// display name of an existing entity type in the same agent that will be |
| /// overridden or supplemented. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/agent/sessions/\[^/\]+/entityTypes/\[^/\]+$`. |
| /// |
| /// [updateMask] - Optional. The mask to control which fields get updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2SessionEntityType]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2SessionEntityType> patch( |
| GoogleCloudDialogflowV2SessionEntityType request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2SessionEntityType.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsAgentVersionsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsAgentVersionsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates an agent version. |
| /// |
| /// The new version points to the agent instance in the "default" environment. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The agent to create a version for. Supported formats: |
| /// - `projects//agent` - `projects//locations//agent` |
| /// Value must have pattern `^projects/\[^/\]+/agent$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Version]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Version> create( |
| GoogleCloudDialogflowV2Version request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/versions'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Version.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Delete the specified agent version. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the version to delete. Supported formats: - |
| /// `projects//agent/versions/` - `projects//locations//agent/versions/` |
| /// Value must have pattern `^projects/\[^/\]+/agent/versions/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> delete( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified agent version. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the version. Supported formats: - |
| /// `projects//agent/versions/` - `projects//locations//agent/versions/` |
| /// Value must have pattern `^projects/\[^/\]+/agent/versions/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Version]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Version> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Version.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all versions of the specified agent. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The agent to list all versions from. Supported |
| /// formats: - `projects//agent` - `projects//locations//agent` |
| /// Value must have pattern `^projects/\[^/\]+/agent$`. |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListVersionsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListVersionsResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/versions'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListVersionsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified agent version. |
| /// |
| /// Note that this method does not allow you to update the state of the agent |
| /// the given version points to. It allows you to update only mutable |
| /// properties of the version resource. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Output only. The unique identifier of this agent version. |
| /// Supported formats: - `projects//agent/versions/` - |
| /// `projects//locations//agent/versions/` |
| /// Value must have pattern `^projects/\[^/\]+/agent/versions/\[^/\]+$`. |
| /// |
| /// [updateMask] - Required. The mask to control which fields get updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Version]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Version> patch( |
| GoogleCloudDialogflowV2Version request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Version.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsAnswerRecordsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsAnswerRecordsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Returns the list of all answer records in the specified project in reverse |
| /// chronological order. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project to list all answer records for in reverse |
| /// chronological order. Format: `projects//locations/`. |
| /// Value must have pattern `^projects/\[^/\]+$`. |
| /// |
| /// [filter] - Required. Filters to restrict results to specific answer |
| /// records. Filter on answer record type. Currently predicates on `type` is |
| /// supported, valid values are `ARTICLE_ANSWER`, `FAQ_ANSWER`. For more |
| /// information about filtering, see [API Filtering](https://aip.dev/160). |
| /// |
| /// [pageSize] - Optional. The maximum number of records to return in a single |
| /// page. The server may return fewer records than this. If unspecified, we |
| /// use 10. The maximum is 100. |
| /// |
| /// [pageToken] - Optional. The ListAnswerRecordsResponse.next_page_token |
| /// value returned from a previous list request used to continue listing on |
| /// the next page. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListAnswerRecordsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListAnswerRecordsResponse> list( |
| core.String parent, { |
| core.String? filter, |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (filter != null) 'filter': [filter], |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/answerRecords'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListAnswerRecordsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified answer record. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - The unique identifier of this answer record. Format: |
| /// `projects//locations//answerRecords/`. |
| /// Value must have pattern `^projects/\[^/\]+/answerRecords/\[^/\]+$`. |
| /// |
| /// [updateMask] - Required. The mask to control which fields get updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2AnswerRecord]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2AnswerRecord> patch( |
| GoogleCloudDialogflowV2AnswerRecord request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2AnswerRecord.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsConversationProfilesResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsConversationProfilesResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates a conversation profile in the specified project. |
| /// |
| /// ConversationProfile.CreateTime and ConversationProfile.UpdateTime aren't |
| /// populated in the response. You can retrieve them via |
| /// GetConversationProfile API. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project to create a conversation profile for. |
| /// Format: `projects//locations/`. |
| /// Value must have pattern `^projects/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ConversationProfile]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ConversationProfile> create( |
| GoogleCloudDialogflowV2ConversationProfile request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/conversationProfiles'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ConversationProfile.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified conversation profile. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the conversation profile to delete. Format: |
| /// `projects//locations//conversationProfiles/`. |
| /// Value must have pattern `^projects/\[^/\]+/conversationProfiles/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> delete( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified conversation profile. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The resource name of the conversation profile. Format: |
| /// `projects//locations//conversationProfiles/`. |
| /// Value must have pattern `^projects/\[^/\]+/conversationProfiles/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ConversationProfile]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ConversationProfile> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ConversationProfile.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all conversation profiles in the specified project. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project to list all conversation profiles from. |
| /// Format: `projects//locations/`. |
| /// Value must have pattern `^projects/\[^/\]+$`. |
| /// |
| /// [pageSize] - The maximum number of items to return in a single page. By |
| /// default 100 and at most 1000. |
| /// |
| /// [pageToken] - The next_page_token value returned from a previous list |
| /// request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a |
| /// [GoogleCloudDialogflowV2ListConversationProfilesResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListConversationProfilesResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/conversationProfiles'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListConversationProfilesResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified conversation profile. |
| /// |
| /// ConversationProfile.CreateTime and ConversationProfile.UpdateTime aren't |
| /// populated in the response. You can retrieve them via |
| /// GetConversationProfile API. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - The unique identifier of this conversation profile. Format: |
| /// `projects//locations//conversationProfiles/`. |
| /// Value must have pattern `^projects/\[^/\]+/conversationProfiles/\[^/\]+$`. |
| /// |
| /// [updateMask] - Required. The mask to control which fields to update. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ConversationProfile]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ConversationProfile> patch( |
| GoogleCloudDialogflowV2ConversationProfile request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ConversationProfile.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsConversationsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsConversationsMessagesResource get messages => |
| ProjectsConversationsMessagesResource(_requester); |
| ProjectsConversationsParticipantsResource get participants => |
| ProjectsConversationsParticipantsResource(_requester); |
| |
| ProjectsConversationsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Completes the specified conversation. |
| /// |
| /// Finished conversations are purged from the database after 30 days. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. Resource identifier of the conversation to close. |
| /// Format: `projects//locations//conversations/`. |
| /// Value must have pattern `^projects/\[^/\]+/conversations/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Conversation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Conversation> complete( |
| GoogleCloudDialogflowV2CompleteConversationRequest request, |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name') + ':complete'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Conversation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Creates a new conversation. |
| /// |
| /// Conversations are auto-completed after 24 hours. Conversation Lifecycle: |
| /// There are two stages during a conversation: Automated Agent Stage and |
| /// Assist Stage. For Automated Agent Stage, there will be a dialogflow agent |
| /// responding to user queries. For Assist Stage, there's no dialogflow agent |
| /// responding to user queries. But we will provide suggestions which are |
| /// generated from conversation. If Conversation.conversation_profile is |
| /// configured for a dialogflow agent, conversation will start from `Automated |
| /// Agent Stage`, otherwise, it will start from `Assist Stage`. And during |
| /// `Automated Agent Stage`, once an Intent with Intent.live_agent_handoff is |
| /// triggered, conversation will transfer to Assist Stage. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. Resource identifier of the project creating the |
| /// conversation. Format: `projects//locations/`. |
| /// Value must have pattern `^projects/\[^/\]+$`. |
| /// |
| /// [conversationId] - Optional. Identifier of the conversation. Generally |
| /// it's auto generated by Google. Only set it if you cannot wait for the |
| /// response to return a auto-generated one to you. The conversation ID must |
| /// be compliant with the regression fomula "a-zA-Z*" with the characters |
| /// length in range of \[3,64\]. If the field is provided, the caller is |
| /// resposible for 1. the uniqueness of the ID, otherwise the request will be |
| /// rejected. 2. the consistency for whether to use custom ID or not under a |
| /// project to better ensure uniqueness. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Conversation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Conversation> create( |
| GoogleCloudDialogflowV2Conversation request, |
| core.String parent, { |
| core.String? conversationId, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (conversationId != null) 'conversationId': [conversationId], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/conversations'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Conversation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specific conversation. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the conversation. Format: |
| /// `projects//locations//conversations/`. |
| /// Value must have pattern `^projects/\[^/\]+/conversations/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Conversation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Conversation> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Conversation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all conversations in the specified project. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project from which to list all conversation. |
| /// Format: `projects//locations/`. |
| /// Value must have pattern `^projects/\[^/\]+$`. |
| /// |
| /// [filter] - A filter expression that filters conversations listed in the |
| /// response. In general, the expression must specify the field name, a |
| /// comparison operator, and the value to use for filtering: - The value must |
| /// be a string, a number, or a boolean. - The comparison operator must be |
| /// either `=`,`!=`, `>`, or `<`. - To filter on multiple expressions, |
| /// separate the expressions with `AND` or `OR` (omitting both implies `AND`). |
| /// - For clarity, expressions can be enclosed in parentheses. Only |
| /// `lifecycle_state` can be filtered on in this way. For example, the |
| /// following expression only returns `COMPLETED` conversations: |
| /// `lifecycle_state = "COMPLETED"` For more information about filtering, see |
| /// [API Filtering](https://aip.dev/160). |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListConversationsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListConversationsResponse> list( |
| core.String parent, { |
| core.String? filter, |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (filter != null) 'filter': [filter], |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/conversations'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListConversationsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsConversationsMessagesResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsConversationsMessagesResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Lists messages that belong to a given conversation. |
| /// |
| /// `messages` are ordered by `create_time` in descending order. To fetch |
| /// updates without duplication, send request with filter |
| /// `create_time_epoch_microseconds > [first item's create_time of previous |
| /// request]` and empty page_token. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the conversation to list messages for. |
| /// Format: `projects//locations//conversations/` |
| /// Value must have pattern `^projects/\[^/\]+/conversations/\[^/\]+$`. |
| /// |
| /// [filter] - Optional. Filter on message fields. Currently predicates on |
| /// `create_time` and `create_time_epoch_microseconds` are supported. |
| /// `create_time` only support milliseconds accuracy. E.g., |
| /// `create_time_epoch_microseconds > 1551790877964485` or `create_time > |
| /// 2017-01-15T01:30:15.01Z`. For more information about filtering, see |
| /// [API Filtering](https://aip.dev/160). |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListMessagesResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListMessagesResponse> list( |
| core.String parent, { |
| core.String? filter, |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (filter != null) 'filter': [filter], |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/messages'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListMessagesResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsConversationsParticipantsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsConversationsParticipantsSuggestionsResource get suggestions => |
| ProjectsConversationsParticipantsSuggestionsResource(_requester); |
| |
| ProjectsConversationsParticipantsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Adds a text (chat, for example), or audio (phone recording, for example) |
| /// message from a participant into the conversation. |
| /// |
| /// Note: Always use agent versions for production traffic sent to virtual |
| /// agents. See |
| /// [Versions and environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [participant] - Required. The name of the participant this text comes |
| /// from. Format: `projects//locations//conversations//participants/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/conversations/\[^/\]+/participants/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2AnalyzeContentResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2AnalyzeContentResponse> analyzeContent( |
| GoogleCloudDialogflowV2AnalyzeContentRequest request, |
| core.String participant, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$participant') + ':analyzeContent'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2AnalyzeContentResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Creates a new participant in a conversation. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. Resource identifier of the conversation adding the |
| /// participant. Format: `projects//locations//conversations/`. |
| /// Value must have pattern `^projects/\[^/\]+/conversations/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Participant]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Participant> create( |
| GoogleCloudDialogflowV2Participant request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/participants'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Participant.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves a conversation participant. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the participant. Format: |
| /// `projects//locations//conversations//participants/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/conversations/\[^/\]+/participants/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Participant]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Participant> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Participant.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all participants in the specified conversation. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The conversation to list all participants from. |
| /// Format: `projects//locations//conversations/`. |
| /// Value must have pattern `^projects/\[^/\]+/conversations/\[^/\]+$`. |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListParticipantsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListParticipantsResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/participants'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListParticipantsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified participant. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Optional. The unique identifier of this participant. Format: |
| /// `projects//locations//conversations//participants/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/conversations/\[^/\]+/participants/\[^/\]+$`. |
| /// |
| /// [updateMask] - Required. The mask to specify which fields to update. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Participant]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Participant> patch( |
| GoogleCloudDialogflowV2Participant request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Participant.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsConversationsParticipantsSuggestionsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsConversationsParticipantsSuggestionsResource( |
| commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Gets suggested articles for a participant based on specific historical |
| /// messages. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the participant to fetch suggestion for. |
| /// Format: `projects//locations//conversations//participants/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/conversations/\[^/\]+/participants/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2SuggestArticlesResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2SuggestArticlesResponse> suggestArticles( |
| GoogleCloudDialogflowV2SuggestArticlesRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/suggestions:suggestArticles'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2SuggestArticlesResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Gets suggested faq answers for a participant based on specific historical |
| /// messages. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the participant to fetch suggestion for. |
| /// Format: `projects//locations//conversations//participants/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/conversations/\[^/\]+/participants/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2SuggestFaqAnswersResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2SuggestFaqAnswersResponse> |
| suggestFaqAnswers( |
| GoogleCloudDialogflowV2SuggestFaqAnswersRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + |
| core.Uri.encodeFull('$parent') + |
| '/suggestions:suggestFaqAnswers'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2SuggestFaqAnswersResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsKnowledgeBasesResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsKnowledgeBasesDocumentsResource get documents => |
| ProjectsKnowledgeBasesDocumentsResource(_requester); |
| |
| ProjectsKnowledgeBasesResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates a knowledge base. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project to create a knowledge base for. Format: |
| /// `projects//locations/`. |
| /// Value must have pattern `^projects/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2KnowledgeBase]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2KnowledgeBase> create( |
| GoogleCloudDialogflowV2KnowledgeBase request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/knowledgeBases'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2KnowledgeBase.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified knowledge base. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the knowledge base to delete. Format: |
| /// `projects//locations//knowledgeBases/`. |
| /// Value must have pattern `^projects/\[^/\]+/knowledgeBases/\[^/\]+$`. |
| /// |
| /// [force] - Optional. Force deletes the knowledge base. When set to true, |
| /// any documents in the knowledge base are also deleted. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> delete( |
| core.String name, { |
| core.bool? force, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (force != null) 'force': ['${force}'], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified knowledge base. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the knowledge base to retrieve. Format |
| /// `projects//locations//knowledgeBases/`. |
| /// Value must have pattern `^projects/\[^/\]+/knowledgeBases/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2KnowledgeBase]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2KnowledgeBase> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2KnowledgeBase.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all knowledge bases of the specified agent. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project to list of knowledge bases for. Format: |
| /// `projects//locations/`. |
| /// Value must have pattern `^projects/\[^/\]+$`. |
| /// |
| /// [pageSize] - The maximum number of items to return in a single page. By |
| /// default 10 and at most 100. |
| /// |
| /// [pageToken] - The next_page_token value returned from a previous list |
| /// request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListKnowledgeBasesResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListKnowledgeBasesResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/knowledgeBases'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListKnowledgeBasesResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified knowledge base. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - The knowledge base resource name. The name must be empty when |
| /// creating a knowledge base. Format: `projects//locations//knowledgeBases/`. |
| /// Value must have pattern `^projects/\[^/\]+/knowledgeBases/\[^/\]+$`. |
| /// |
| /// [updateMask] - Optional. Not specified means `update all`. Currently, only |
| /// `display_name` can be updated, an InvalidArgument will be returned for |
| /// attempting to update other fields. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2KnowledgeBase]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2KnowledgeBase> patch( |
| GoogleCloudDialogflowV2KnowledgeBase request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2KnowledgeBase.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsKnowledgeBasesDocumentsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsKnowledgeBasesDocumentsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates a new document. |
| /// |
| /// Operation |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The knowledge base to create a document for. Format: |
| /// `projects//locations//knowledgeBases/`. |
| /// Value must have pattern `^projects/\[^/\]+/knowledgeBases/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> create( |
| GoogleCloudDialogflowV2Document request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/documents'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified document. |
| /// |
| /// Operation |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the document to delete. Format: |
| /// `projects//locations//knowledgeBases//documents/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/knowledgeBases/\[^/\]+/documents/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> delete( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified document. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the document to retrieve. Format |
| /// `projects//locations//knowledgeBases//documents/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/knowledgeBases/\[^/\]+/documents/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Document]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Document> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Document.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all documents of the knowledge base. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The knowledge base to list all documents for. Format: |
| /// `projects//locations//knowledgeBases/`. |
| /// Value must have pattern `^projects/\[^/\]+/knowledgeBases/\[^/\]+$`. |
| /// |
| /// [pageSize] - The maximum number of items to return in a single page. By |
| /// default 10 and at most 100. |
| /// |
| /// [pageToken] - The next_page_token value returned from a previous list |
| /// request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListDocumentsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListDocumentsResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/documents'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListDocumentsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified document. |
| /// |
| /// Operation |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Optional. The document resource name. The name must be empty when |
| /// creating a document. Format: |
| /// `projects//locations//knowledgeBases//documents/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/knowledgeBases/\[^/\]+/documents/\[^/\]+$`. |
| /// |
| /// [updateMask] - Optional. Not specified means `update all`. Currently, only |
| /// `display_name` can be updated, an InvalidArgument will be returned for |
| /// attempting to update other fields. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> patch( |
| GoogleCloudDialogflowV2Document request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Reloads the specified document from its specified source, content_uri or |
| /// content. |
| /// |
| /// The previously loaded content of the document will be deleted. Note: Even |
| /// when the content of the document has not changed, there still may be side |
| /// effects because of internal implementation changes. Note: The |
| /// `projects.agent.knowledgeBases.documents` resource is deprecated; only use |
| /// `projects.knowledgeBases.documents`. Operation |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the document to reload. Format: |
| /// `projects//locations//knowledgeBases//documents/` |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/knowledgeBases/\[^/\]+/documents/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> reload( |
| GoogleCloudDialogflowV2ReloadDocumentRequest request, |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name') + ':reload'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsAgentResource get agent => |
| ProjectsLocationsAgentResource(_requester); |
| ProjectsLocationsAnswerRecordsResource get answerRecords => |
| ProjectsLocationsAnswerRecordsResource(_requester); |
| ProjectsLocationsConversationProfilesResource get conversationProfiles => |
| ProjectsLocationsConversationProfilesResource(_requester); |
| ProjectsLocationsConversationsResource get conversations => |
| ProjectsLocationsConversationsResource(_requester); |
| ProjectsLocationsKnowledgeBasesResource get knowledgeBases => |
| ProjectsLocationsKnowledgeBasesResource(_requester); |
| ProjectsLocationsOperationsResource get operations => |
| ProjectsLocationsOperationsResource(_requester); |
| |
| ProjectsLocationsResource(commons.ApiRequester client) : _requester = client; |
| |
| /// Deletes the specified agent. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project that the agent to delete is associated |
| /// with. Format: `projects/`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> deleteAgent( |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/agent'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Gets information about a location. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Resource name for the location. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudLocationLocation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudLocationLocation> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudLocationLocation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified agent. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project that the agent to fetch is associated |
| /// with. Format: `projects/`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Agent]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Agent> getAgent( |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/agent'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Agent.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Lists information about the supported locations for this service. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - The resource that owns the locations collection, if applicable. |
| /// Value must have pattern `^projects/\[^/\]+$`. |
| /// |
| /// [filter] - A filter to narrow down results to a preferred subset. The |
| /// filtering language accepts strings like "displayName=tokyo", and is |
| /// documented in more detail in \[AIP-160\](https://google.aip.dev/160). |
| /// |
| /// [pageSize] - The maximum number of results to return. If not set, the |
| /// service selects a default. |
| /// |
| /// [pageToken] - A page token received from the `next_page_token` field in |
| /// the response. Send that page token to receive the subsequent page. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudLocationListLocationsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudLocationListLocationsResponse> list( |
| core.String name, { |
| core.String? filter, |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (filter != null) 'filter': [filter], |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name') + '/locations'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudLocationListLocationsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Creates/updates the specified agent. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project of this agent. Format: `projects/`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. |
| /// |
| /// [updateMask] - Optional. The mask to control which fields get updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Agent]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Agent> setAgent( |
| GoogleCloudDialogflowV2Agent request, |
| core.String parent, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/agent'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Agent.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsAgentResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsAgentEntityTypesResource get entityTypes => |
| ProjectsLocationsAgentEntityTypesResource(_requester); |
| ProjectsLocationsAgentEnvironmentsResource get environments => |
| ProjectsLocationsAgentEnvironmentsResource(_requester); |
| ProjectsLocationsAgentIntentsResource get intents => |
| ProjectsLocationsAgentIntentsResource(_requester); |
| ProjectsLocationsAgentSessionsResource get sessions => |
| ProjectsLocationsAgentSessionsResource(_requester); |
| ProjectsLocationsAgentVersionsResource get versions => |
| ProjectsLocationsAgentVersionsResource(_requester); |
| |
| ProjectsLocationsAgentResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Exports the specified agent to a ZIP file. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project that the agent to export is associated |
| /// with. Format: `projects/`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> export( |
| GoogleCloudDialogflowV2ExportAgentRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/agent:export'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the fulfillment. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the fulfillment. Format: |
| /// `projects//agent/fulfillment`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/fulfillment$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Fulfillment]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Fulfillment> getFulfillment( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Fulfillment.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Gets agent validation result. |
| /// |
| /// Agent validation is performed during training time and is updated |
| /// automatically when training is completed. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project that the agent is associated with. |
| /// Format: `projects/`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. |
| /// |
| /// [languageCode] - Optional. The language for which you want a validation |
| /// result. If not specified, the agent's default language is used. |
| /// [Many languages](https://cloud.google.com/dialogflow/docs/reference/language) |
| /// are supported. Note: languages must be enabled in the agent before they |
| /// can be used. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ValidationResult]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ValidationResult> getValidationResult( |
| core.String parent, { |
| core.String? languageCode, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (languageCode != null) 'languageCode': [languageCode], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/agent/validationResult'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ValidationResult.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Imports the specified agent from a ZIP file. |
| /// |
| /// Uploads new intents and entity types without deleting the existing ones. |
| /// Intents and entity types with the same name are replaced with the new |
| /// versions from ImportAgentRequest. After the import, the imported draft |
| /// agent will be trained automatically (unless disabled in agent settings). |
| /// However, once the import is done, training may not be completed yet. |
| /// Please call TrainAgent and wait for the operation it returns in order to |
| /// train explicitly. An operation which tracks when importing is complete. It |
| /// only tracks when the draft agent is updated not when it is done training. |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project that the agent to import is associated |
| /// with. Format: `projects/`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> import( |
| GoogleCloudDialogflowV2ImportAgentRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/agent:import'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Restores the specified agent from a ZIP file. |
| /// |
| /// Replaces the current agent version with a new one. All the intents and |
| /// entity types in the older version are deleted. After the restore, the |
| /// restored draft agent will be trained automatically (unless disabled in |
| /// agent settings). However, once the restore is done, training may not be |
| /// completed yet. Please call TrainAgent and wait for the operation it |
| /// returns in order to train explicitly. An operation which tracks when |
| /// restoring is complete. It only tracks when the draft agent is updated not |
| /// when it is done training. Note: You should always train an agent prior to |
| /// sending it queries. See the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project that the agent to restore is associated |
| /// with. Format: `projects/`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> restore( |
| GoogleCloudDialogflowV2RestoreAgentRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/agent:restore'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of agents. |
| /// |
| /// Since there is at most one conversational agent per project, this method |
| /// is useful primarily for listing all agents across projects the caller has |
| /// access to. One can achieve that with a wildcard project collection id "-". |
| /// Refer to \[List |
| /// Sub-Collections\](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project to list agents from. Format: `projects/`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - The next_page_token value returned from a previous list |
| /// request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2SearchAgentsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2SearchAgentsResponse> search( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/agent:search'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2SearchAgentsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Trains the specified agent. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project that the agent to train is associated |
| /// with. Format: `projects/`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> train( |
| GoogleCloudDialogflowV2TrainAgentRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/agent:train'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the fulfillment. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The unique identifier of the fulfillment. Supported |
| /// formats: - `projects//agent/fulfillment` - |
| /// `projects//locations//agent/fulfillment` This field is not used for |
| /// Fulfillment in an Environment. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/fulfillment$`. |
| /// |
| /// [updateMask] - Required. The mask to control which fields get updated. If |
| /// the mask is not present, all fields will be updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Fulfillment]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Fulfillment> updateFulfillment( |
| GoogleCloudDialogflowV2Fulfillment request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Fulfillment.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsAgentEntityTypesResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsAgentEntityTypesEntitiesResource get entities => |
| ProjectsLocationsAgentEntityTypesEntitiesResource(_requester); |
| |
| ProjectsLocationsAgentEntityTypesResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Deletes entity types in the specified agent. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the agent to delete all entities types |
| /// for. Format: `projects//agent`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+/agent$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> batchDelete( |
| GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/entityTypes:batchDelete'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates/Creates multiple entity types in the specified agent. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the agent to update or create entity |
| /// types in. Format: `projects//agent`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+/agent$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> batchUpdate( |
| GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/entityTypes:batchUpdate'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Creates an entity type in the specified agent. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The agent to create a entity type for. Format: |
| /// `projects//agent`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+/agent$`. |
| /// |
| /// [languageCode] - Optional. The language used to access language-specific |
| /// data. If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2EntityType]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2EntityType> create( |
| GoogleCloudDialogflowV2EntityType request, |
| core.String parent, { |
| core.String? languageCode, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (languageCode != null) 'languageCode': [languageCode], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/entityTypes'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2EntityType.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified entity type. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the entity type to delete. Format: |
| /// `projects//agent/entityTypes/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/entityTypes/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> delete( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified entity type. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the entity type. Format: |
| /// `projects//agent/entityTypes/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/entityTypes/\[^/\]+$`. |
| /// |
| /// [languageCode] - Optional. The language used to access language-specific |
| /// data. If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2EntityType]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2EntityType> get( |
| core.String name, { |
| core.String? languageCode, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (languageCode != null) 'languageCode': [languageCode], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2EntityType.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all entity types in the specified agent. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The agent to list all entity types from. Format: |
| /// `projects//agent`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+/agent$`. |
| /// |
| /// [languageCode] - Optional. The language used to access language-specific |
| /// data. If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListEntityTypesResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListEntityTypesResponse> list( |
| core.String parent, { |
| core.String? languageCode, |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (languageCode != null) 'languageCode': [languageCode], |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/entityTypes'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListEntityTypesResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified entity type. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - The unique identifier of the entity type. Required for |
| /// EntityTypes.UpdateEntityType and EntityTypes.BatchUpdateEntityTypes |
| /// methods. Format: `projects//agent/entityTypes/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/entityTypes/\[^/\]+$`. |
| /// |
| /// [languageCode] - Optional. The language used to access language-specific |
| /// data. If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// [updateMask] - Optional. The mask to control which fields get updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2EntityType]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2EntityType> patch( |
| GoogleCloudDialogflowV2EntityType request, |
| core.String name, { |
| core.String? languageCode, |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (languageCode != null) 'languageCode': [languageCode], |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2EntityType.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsAgentEntityTypesEntitiesResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsAgentEntityTypesEntitiesResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates multiple new entities in the specified entity type. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the entity type to create entities in. |
| /// Format: `projects//agent/entityTypes/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/entityTypes/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> batchCreate( |
| GoogleCloudDialogflowV2BatchCreateEntitiesRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/entities:batchCreate'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes entities in the specified entity type. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the entity type to delete entries for. |
| /// Format: `projects//agent/entityTypes/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/entityTypes/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> batchDelete( |
| GoogleCloudDialogflowV2BatchDeleteEntitiesRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/entities:batchDelete'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates or creates multiple entities in the specified entity type. |
| /// |
| /// This method does not affect entities in the entity type that aren't |
| /// explicitly specified in the request. Note: You should always train an |
| /// agent prior to sending it queries. See the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the entity type to update or create |
| /// entities in. Format: `projects//agent/entityTypes/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/entityTypes/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> batchUpdate( |
| GoogleCloudDialogflowV2BatchUpdateEntitiesRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/entities:batchUpdate'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsAgentEnvironmentsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsAgentEnvironmentsIntentsResource get intents => |
| ProjectsLocationsAgentEnvironmentsIntentsResource(_requester); |
| ProjectsLocationsAgentEnvironmentsUsersResource get users => |
| ProjectsLocationsAgentEnvironmentsUsersResource(_requester); |
| |
| ProjectsLocationsAgentEnvironmentsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates an agent environment. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The agent to create an environment for. Supported |
| /// formats: - `projects//agent` - `projects//locations//agent` |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+/agent$`. |
| /// |
| /// [environmentId] - Required. The unique id of the new environment. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Environment]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Environment> create( |
| GoogleCloudDialogflowV2Environment request, |
| core.String parent, { |
| core.String? environmentId, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (environmentId != null) 'environmentId': [environmentId], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/environments'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Environment.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified agent environment. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the environment to delete. / Format: - |
| /// `projects//agent/environments/` - |
| /// `projects//locations//agent/environments/` The environment ID for the |
| /// default environment is `-`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> delete( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified agent environment. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the environment. Supported formats: - |
| /// `projects//agent/environments/` - |
| /// `projects//locations//agent/environments/` The environment ID for the |
| /// default environment is `-`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Environment]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Environment> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Environment.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Gets the history of the specified environment. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the environment to retrieve history for. |
| /// Supported formats: - `projects//agent/environments/` - |
| /// `projects//locations//agent/environments/` The environment ID for the |
| /// default environment is `-`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+$`. |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2EnvironmentHistory]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2EnvironmentHistory> getHistory( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/history'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2EnvironmentHistory.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all non-default environments of the specified agent. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The agent to list all environments from. Format: - |
| /// `projects//agent` - `projects//locations//agent` |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+/agent$`. |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListEnvironmentsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListEnvironmentsResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/environments'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListEnvironmentsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified agent environment. |
| /// |
| /// This method allows you to deploy new agent versions into the environment. |
| /// When an environment is pointed to a new agent version by setting |
| /// `environment.agent_version`, the environment is temporarily set to the |
| /// `LOADING` state. During that time, the environment continues serving the |
| /// previous version of the agent. After the new agent version is done |
| /// loading, the environment is set back to the `RUNNING` state. You can use |
| /// "-" as Environment ID in environment name to update an agent version in |
| /// the default environment. WARNING: this will negate all recent changes to |
| /// the draft agent and can't be undone. You may want to save the draft agent |
| /// to a version before calling this method. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Output only. The unique identifier of this agent environment. |
| /// Supported formats: - `projects//agent/environments/` - |
| /// `projects//locations//agent/environments/` The environment ID for the |
| /// default environment is `-`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+$`. |
| /// |
| /// [allowLoadToDraftAndDiscardChanges] - Optional. This field is used to |
| /// prevent accidental overwrite of the default environment, which is an |
| /// operation that cannot be undone. To confirm that the caller desires this |
| /// overwrite, this field must be explicitly set to true when updating the |
| /// default environment (environment ID = `-`). |
| /// |
| /// [updateMask] - Required. The mask to control which fields get updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Environment]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Environment> patch( |
| GoogleCloudDialogflowV2Environment request, |
| core.String name, { |
| core.bool? allowLoadToDraftAndDiscardChanges, |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (allowLoadToDraftAndDiscardChanges != null) |
| 'allowLoadToDraftAndDiscardChanges': [ |
| '${allowLoadToDraftAndDiscardChanges}' |
| ], |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Environment.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsAgentEnvironmentsIntentsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsAgentEnvironmentsIntentsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Returns the list of all intents in the specified agent. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The agent to list all intents from. Format: |
| /// `projects//agent` or `projects//locations//agent`. Alternatively, you can |
| /// specify the environment to list intents for. Format: |
| /// `projects//agent/environments/` or |
| /// `projects//locations//agent/environments/`. Note: training phrases of the |
| /// intents will not be returned for non-draft environment. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+$`. |
| /// |
| /// [intentView] - Optional. The resource view to apply to the returned |
| /// intent. |
| /// Possible string values are: |
| /// - "INTENT_VIEW_UNSPECIFIED" : Training phrases field is not populated in |
| /// the response. |
| /// - "INTENT_VIEW_FULL" : All fields are populated. |
| /// |
| /// [languageCode] - Optional. The language used to access language-specific |
| /// data. If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListIntentsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListIntentsResponse> list( |
| core.String parent, { |
| core.String? intentView, |
| core.String? languageCode, |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (intentView != null) 'intentView': [intentView], |
| if (languageCode != null) 'languageCode': [languageCode], |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/intents'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListIntentsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsAgentEnvironmentsUsersResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsAgentEnvironmentsUsersSessionsResource get sessions => |
| ProjectsLocationsAgentEnvironmentsUsersSessionsResource(_requester); |
| |
| ProjectsLocationsAgentEnvironmentsUsersResource(commons.ApiRequester client) |
| : _requester = client; |
| } |
| |
| class ProjectsLocationsAgentEnvironmentsUsersSessionsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsAgentEnvironmentsUsersSessionsContextsResource |
| get contexts => |
| ProjectsLocationsAgentEnvironmentsUsersSessionsContextsResource( |
| _requester); |
| ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesResource |
| get entityTypes => |
| ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesResource( |
| _requester); |
| |
| ProjectsLocationsAgentEnvironmentsUsersSessionsResource( |
| commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Deletes all active contexts in the specified session. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the session to delete all contexts from. |
| /// Format: `projects//agent/sessions/` or |
| /// `projects//agent/environments//users//sessions/`. If `Environment ID` is |
| /// not specified we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> deleteContexts( |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/contexts'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Processes a natural language query and returns structured, actionable data |
| /// as a result. |
| /// |
| /// This method is not idempotent, because it may cause contexts and session |
| /// entity types to be updated, which in turn might affect results of future |
| /// queries. Note: Always use agent versions for production traffic. See |
| /// [Versions and environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [session] - Required. The name of the session this query is sent to. |
| /// Format: `projects//agent/sessions/`, or |
| /// `projects//agent/environments//users//sessions/`. If `Environment ID` is |
| /// not specified, we assume default 'draft' environment (`Environment ID` |
| /// might be referred to as environment name at some places). If `User ID` is |
| /// not specified, we are using "-". It's up to the API caller to choose an |
| /// appropriate `Session ID` and `User Id`. They can be a random number or |
| /// some type of user and session identifiers (preferably hashed). The length |
| /// of the `Session ID` and `User ID` must not exceed 36 characters. For more |
| /// information, see the |
| /// [API interactions guide](https://cloud.google.com/dialogflow/docs/api-overview). |
| /// Note: Always use agent versions for production traffic. See |
| /// [Versions and environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2DetectIntentResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2DetectIntentResponse> detectIntent( |
| GoogleCloudDialogflowV2DetectIntentRequest request, |
| core.String session, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$session') + ':detectIntent'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2DetectIntentResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsAgentEnvironmentsUsersSessionsContextsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsAgentEnvironmentsUsersSessionsContextsResource( |
| commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates a context. |
| /// |
| /// If the specified context already exists, overrides the context. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The session to create a context for. Format: |
| /// `projects//agent/sessions/` or |
| /// `projects//agent/environments//users//sessions/`. If `Environment ID` is |
| /// not specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Context]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Context> create( |
| GoogleCloudDialogflowV2Context request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/contexts'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Context.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified context. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the context to delete. Format: |
| /// `projects//agent/sessions//contexts/` or |
| /// `projects//agent/environments//users//sessions//contexts/`. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/contexts/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> delete( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified context. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the context. Format: |
| /// `projects//agent/sessions//contexts/` or |
| /// `projects//agent/environments//users//sessions//contexts/`. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/contexts/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Context]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Context> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Context.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all contexts in the specified session. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The session to list all contexts from. Format: |
| /// `projects//agent/sessions/` or |
| /// `projects//agent/environments//users//sessions/`. If `Environment ID` is |
| /// not specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListContextsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListContextsResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/contexts'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListContextsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified context. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The unique identifier of the context. Format: |
| /// `projects//agent/sessions//contexts/`, or |
| /// `projects//agent/environments//users//sessions//contexts/`. The `Context |
| /// ID` is always converted to lowercase, may only contain characters in |
| /// a-zA-Z0-9_-% and may be at most 250 bytes long. If `Environment ID` is not |
| /// specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. The following context names are |
| /// reserved for internal use by Dialogflow. You should not use these contexts |
| /// or create contexts with these names: * `__system_counters__` * |
| /// `*_id_dialog_context` * `*_dialog_params_size` |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/contexts/\[^/\]+$`. |
| /// |
| /// [updateMask] - Optional. The mask to control which fields get updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Context]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Context> patch( |
| GoogleCloudDialogflowV2Context request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Context.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesResource( |
| commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates a session entity type. |
| /// |
| /// If the specified session entity type already exists, overrides the session |
| /// entity type. This method doesn't work with Google Assistant integration. |
| /// Contact Dialogflow support if you need to use session entities with Google |
| /// Assistant integration. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The session to create a session entity type for. |
| /// Format: `projects//agent/sessions/` or |
| /// `projects//agent/environments//users// sessions/`. If `Environment ID` is |
| /// not specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2SessionEntityType]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2SessionEntityType> create( |
| GoogleCloudDialogflowV2SessionEntityType request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/entityTypes'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2SessionEntityType.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified session entity type. |
| /// |
| /// This method doesn't work with Google Assistant integration. Contact |
| /// Dialogflow support if you need to use session entities with Google |
| /// Assistant integration. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the entity type to delete. Format: |
| /// `projects//agent/sessions//entityTypes/` or |
| /// `projects//agent/environments//users//sessions//entityTypes/`. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/entityTypes/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> delete( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified session entity type. |
| /// |
| /// This method doesn't work with Google Assistant integration. Contact |
| /// Dialogflow support if you need to use session entities with Google |
| /// Assistant integration. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the session entity type. Format: |
| /// `projects//agent/sessions//entityTypes/` or |
| /// `projects//agent/environments//users//sessions//entityTypes/`. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/entityTypes/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2SessionEntityType]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2SessionEntityType> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2SessionEntityType.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all session entity types in the specified session. |
| /// |
| /// This method doesn't work with Google Assistant integration. Contact |
| /// Dialogflow support if you need to use session entities with Google |
| /// Assistant integration. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The session to list all session entity types from. |
| /// Format: `projects//agent/sessions/` or |
| /// `projects//agent/environments//users// sessions/`. If `Environment ID` is |
| /// not specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListSessionEntityTypesResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListSessionEntityTypesResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/entityTypes'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListSessionEntityTypesResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified session entity type. |
| /// |
| /// This method doesn't work with Google Assistant integration. Contact |
| /// Dialogflow support if you need to use session entities with Google |
| /// Assistant integration. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The unique identifier of this session entity type. |
| /// Format: `projects//agent/sessions//entityTypes/`, or |
| /// `projects//agent/environments//users//sessions//entityTypes/`. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. `` must be the |
| /// display name of an existing entity type in the same agent that will be |
| /// overridden or supplemented. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/entityTypes/\[^/\]+$`. |
| /// |
| /// [updateMask] - Optional. The mask to control which fields get updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2SessionEntityType]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2SessionEntityType> patch( |
| GoogleCloudDialogflowV2SessionEntityType request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2SessionEntityType.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsAgentIntentsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsAgentIntentsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Deletes intents in the specified agent. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the agent to delete all entities types |
| /// for. Format: `projects//agent`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+/agent$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> batchDelete( |
| GoogleCloudDialogflowV2BatchDeleteIntentsRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/intents:batchDelete'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates/Creates multiple intents in the specified agent. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the agent to update or create intents in. |
| /// Format: `projects//agent`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+/agent$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> batchUpdate( |
| GoogleCloudDialogflowV2BatchUpdateIntentsRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/intents:batchUpdate'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Creates an intent in the specified agent. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The agent to create a intent for. Format: |
| /// `projects//agent`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+/agent$`. |
| /// |
| /// [intentView] - Optional. The resource view to apply to the returned |
| /// intent. |
| /// Possible string values are: |
| /// - "INTENT_VIEW_UNSPECIFIED" : Training phrases field is not populated in |
| /// the response. |
| /// - "INTENT_VIEW_FULL" : All fields are populated. |
| /// |
| /// [languageCode] - Optional. The language used to access language-specific |
| /// data. If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Intent]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Intent> create( |
| GoogleCloudDialogflowV2Intent request, |
| core.String parent, { |
| core.String? intentView, |
| core.String? languageCode, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (intentView != null) 'intentView': [intentView], |
| if (languageCode != null) 'languageCode': [languageCode], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/intents'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Intent.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified intent and its direct or indirect followup intents. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the intent to delete. If this intent has |
| /// direct or indirect followup intents, we also delete them. Format: |
| /// `projects//agent/intents/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/intents/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> delete( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified intent. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the intent. Format: |
| /// `projects//agent/intents/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/intents/\[^/\]+$`. |
| /// |
| /// [intentView] - Optional. The resource view to apply to the returned |
| /// intent. |
| /// Possible string values are: |
| /// - "INTENT_VIEW_UNSPECIFIED" : Training phrases field is not populated in |
| /// the response. |
| /// - "INTENT_VIEW_FULL" : All fields are populated. |
| /// |
| /// [languageCode] - Optional. The language used to access language-specific |
| /// data. If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Intent]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Intent> get( |
| core.String name, { |
| core.String? intentView, |
| core.String? languageCode, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (intentView != null) 'intentView': [intentView], |
| if (languageCode != null) 'languageCode': [languageCode], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Intent.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all intents in the specified agent. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The agent to list all intents from. Format: |
| /// `projects//agent` or `projects//locations//agent`. Alternatively, you can |
| /// specify the environment to list intents for. Format: |
| /// `projects//agent/environments/` or |
| /// `projects//locations//agent/environments/`. Note: training phrases of the |
| /// intents will not be returned for non-draft environment. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+/agent$`. |
| /// |
| /// [intentView] - Optional. The resource view to apply to the returned |
| /// intent. |
| /// Possible string values are: |
| /// - "INTENT_VIEW_UNSPECIFIED" : Training phrases field is not populated in |
| /// the response. |
| /// - "INTENT_VIEW_FULL" : All fields are populated. |
| /// |
| /// [languageCode] - Optional. The language used to access language-specific |
| /// data. If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListIntentsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListIntentsResponse> list( |
| core.String parent, { |
| core.String? intentView, |
| core.String? languageCode, |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (intentView != null) 'intentView': [intentView], |
| if (languageCode != null) 'languageCode': [languageCode], |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/intents'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListIntentsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified intent. |
| /// |
| /// Note: You should always train an agent prior to sending it queries. See |
| /// the |
| /// [training documentation](https://cloud.google.com/dialogflow/es/docs/training). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Optional. The unique identifier of this intent. Required for |
| /// Intents.UpdateIntent and Intents.BatchUpdateIntents methods. Format: |
| /// `projects//agent/intents/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/intents/\[^/\]+$`. |
| /// |
| /// [intentView] - Optional. The resource view to apply to the returned |
| /// intent. |
| /// Possible string values are: |
| /// - "INTENT_VIEW_UNSPECIFIED" : Training phrases field is not populated in |
| /// the response. |
| /// - "INTENT_VIEW_FULL" : All fields are populated. |
| /// |
| /// [languageCode] - Optional. The language used to access language-specific |
| /// data. If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// [updateMask] - Optional. The mask to control which fields get updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Intent]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Intent> patch( |
| GoogleCloudDialogflowV2Intent request, |
| core.String name, { |
| core.String? intentView, |
| core.String? languageCode, |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (intentView != null) 'intentView': [intentView], |
| if (languageCode != null) 'languageCode': [languageCode], |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Intent.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsAgentSessionsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsAgentSessionsContextsResource get contexts => |
| ProjectsLocationsAgentSessionsContextsResource(_requester); |
| ProjectsLocationsAgentSessionsEntityTypesResource get entityTypes => |
| ProjectsLocationsAgentSessionsEntityTypesResource(_requester); |
| |
| ProjectsLocationsAgentSessionsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Deletes all active contexts in the specified session. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the session to delete all contexts from. |
| /// Format: `projects//agent/sessions/` or |
| /// `projects//agent/environments//users//sessions/`. If `Environment ID` is |
| /// not specified we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> deleteContexts( |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/contexts'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Processes a natural language query and returns structured, actionable data |
| /// as a result. |
| /// |
| /// This method is not idempotent, because it may cause contexts and session |
| /// entity types to be updated, which in turn might affect results of future |
| /// queries. Note: Always use agent versions for production traffic. See |
| /// [Versions and environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [session] - Required. The name of the session this query is sent to. |
| /// Format: `projects//agent/sessions/`, or |
| /// `projects//agent/environments//users//sessions/`. If `Environment ID` is |
| /// not specified, we assume default 'draft' environment (`Environment ID` |
| /// might be referred to as environment name at some places). If `User ID` is |
| /// not specified, we are using "-". It's up to the API caller to choose an |
| /// appropriate `Session ID` and `User Id`. They can be a random number or |
| /// some type of user and session identifiers (preferably hashed). The length |
| /// of the `Session ID` and `User ID` must not exceed 36 characters. For more |
| /// information, see the |
| /// [API interactions guide](https://cloud.google.com/dialogflow/docs/api-overview). |
| /// Note: Always use agent versions for production traffic. See |
| /// [Versions and environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2DetectIntentResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2DetectIntentResponse> detectIntent( |
| GoogleCloudDialogflowV2DetectIntentRequest request, |
| core.String session, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$session') + ':detectIntent'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2DetectIntentResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsAgentSessionsContextsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsAgentSessionsContextsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates a context. |
| /// |
| /// If the specified context already exists, overrides the context. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The session to create a context for. Format: |
| /// `projects//agent/sessions/` or |
| /// `projects//agent/environments//users//sessions/`. If `Environment ID` is |
| /// not specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Context]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Context> create( |
| GoogleCloudDialogflowV2Context request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/contexts'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Context.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified context. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the context to delete. Format: |
| /// `projects//agent/sessions//contexts/` or |
| /// `projects//agent/environments//users//sessions//contexts/`. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+/contexts/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> delete( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified context. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the context. Format: |
| /// `projects//agent/sessions//contexts/` or |
| /// `projects//agent/environments//users//sessions//contexts/`. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+/contexts/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Context]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Context> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Context.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all contexts in the specified session. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The session to list all contexts from. Format: |
| /// `projects//agent/sessions/` or |
| /// `projects//agent/environments//users//sessions/`. If `Environment ID` is |
| /// not specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+$`. |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListContextsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListContextsResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/contexts'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListContextsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified context. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The unique identifier of the context. Format: |
| /// `projects//agent/sessions//contexts/`, or |
| /// `projects//agent/environments//users//sessions//contexts/`. The `Context |
| /// ID` is always converted to lowercase, may only contain characters in |
| /// a-zA-Z0-9_-% and may be at most 250 bytes long. If `Environment ID` is not |
| /// specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. The following context names are |
| /// reserved for internal use by Dialogflow. You should not use these contexts |
| /// or create contexts with these names: * `__system_counters__` * |
| /// `*_id_dialog_context` * `*_dialog_params_size` |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+/contexts/\[^/\]+$`. |
| /// |
| /// [updateMask] - Optional. The mask to control which fields get updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Context]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Context> patch( |
| GoogleCloudDialogflowV2Context request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Context.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsAgentSessionsEntityTypesResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsAgentSessionsEntityTypesResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates a session entity type. |
| /// |
| /// If the specified session entity type already exists, overrides the session |
| /// entity type. This method doesn't work with Google Assistant integration. |
| /// Contact Dialogflow support if you need to use session entities with Google |
| /// Assistant integration. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The session to create a session entity type for. |
| /// Format: `projects//agent/sessions/` or |
| /// `projects//agent/environments//users// sessions/`. If `Environment ID` is |
| /// not specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2SessionEntityType]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2SessionEntityType> create( |
| GoogleCloudDialogflowV2SessionEntityType request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/entityTypes'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2SessionEntityType.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified session entity type. |
| /// |
| /// This method doesn't work with Google Assistant integration. Contact |
| /// Dialogflow support if you need to use session entities with Google |
| /// Assistant integration. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the entity type to delete. Format: |
| /// `projects//agent/sessions//entityTypes/` or |
| /// `projects//agent/environments//users//sessions//entityTypes/`. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+/entityTypes/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> delete( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified session entity type. |
| /// |
| /// This method doesn't work with Google Assistant integration. Contact |
| /// Dialogflow support if you need to use session entities with Google |
| /// Assistant integration. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the session entity type. Format: |
| /// `projects//agent/sessions//entityTypes/` or |
| /// `projects//agent/environments//users//sessions//entityTypes/`. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+/entityTypes/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2SessionEntityType]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2SessionEntityType> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2SessionEntityType.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all session entity types in the specified session. |
| /// |
| /// This method doesn't work with Google Assistant integration. Contact |
| /// Dialogflow support if you need to use session entities with Google |
| /// Assistant integration. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The session to list all session entity types from. |
| /// Format: `projects//agent/sessions/` or |
| /// `projects//agent/environments//users// sessions/`. If `Environment ID` is |
| /// not specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+$`. |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListSessionEntityTypesResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListSessionEntityTypesResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/entityTypes'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListSessionEntityTypesResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified session entity type. |
| /// |
| /// This method doesn't work with Google Assistant integration. Contact |
| /// Dialogflow support if you need to use session entities with Google |
| /// Assistant integration. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The unique identifier of this session entity type. |
| /// Format: `projects//agent/sessions//entityTypes/`, or |
| /// `projects//agent/environments//users//sessions//entityTypes/`. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. `` must be the |
| /// display name of an existing entity type in the same agent that will be |
| /// overridden or supplemented. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+/entityTypes/\[^/\]+$`. |
| /// |
| /// [updateMask] - Optional. The mask to control which fields get updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2SessionEntityType]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2SessionEntityType> patch( |
| GoogleCloudDialogflowV2SessionEntityType request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2SessionEntityType.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsAgentVersionsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsAgentVersionsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates an agent version. |
| /// |
| /// The new version points to the agent instance in the "default" environment. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The agent to create a version for. Supported formats: |
| /// - `projects//agent` - `projects//locations//agent` |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+/agent$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Version]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Version> create( |
| GoogleCloudDialogflowV2Version request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/versions'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Version.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Delete the specified agent version. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the version to delete. Supported formats: - |
| /// `projects//agent/versions/` - `projects//locations//agent/versions/` |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/versions/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> delete( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified agent version. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the version. Supported formats: - |
| /// `projects//agent/versions/` - `projects//locations//agent/versions/` |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/versions/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Version]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Version> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Version.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all versions of the specified agent. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The agent to list all versions from. Supported |
| /// formats: - `projects//agent` - `projects//locations//agent` |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+/agent$`. |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListVersionsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListVersionsResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/versions'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListVersionsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified agent version. |
| /// |
| /// Note that this method does not allow you to update the state of the agent |
| /// the given version points to. It allows you to update only mutable |
| /// properties of the version resource. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Output only. The unique identifier of this agent version. |
| /// Supported formats: - `projects//agent/versions/` - |
| /// `projects//locations//agent/versions/` |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/agent/versions/\[^/\]+$`. |
| /// |
| /// [updateMask] - Required. The mask to control which fields get updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Version]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Version> patch( |
| GoogleCloudDialogflowV2Version request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Version.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsAnswerRecordsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsAnswerRecordsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Returns the list of all answer records in the specified project in reverse |
| /// chronological order. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project to list all answer records for in reverse |
| /// chronological order. Format: `projects//locations/`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. |
| /// |
| /// [filter] - Required. Filters to restrict results to specific answer |
| /// records. Filter on answer record type. Currently predicates on `type` is |
| /// supported, valid values are `ARTICLE_ANSWER`, `FAQ_ANSWER`. For more |
| /// information about filtering, see [API Filtering](https://aip.dev/160). |
| /// |
| /// [pageSize] - Optional. The maximum number of records to return in a single |
| /// page. The server may return fewer records than this. If unspecified, we |
| /// use 10. The maximum is 100. |
| /// |
| /// [pageToken] - Optional. The ListAnswerRecordsResponse.next_page_token |
| /// value returned from a previous list request used to continue listing on |
| /// the next page. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListAnswerRecordsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListAnswerRecordsResponse> list( |
| core.String parent, { |
| core.String? filter, |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (filter != null) 'filter': [filter], |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/answerRecords'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListAnswerRecordsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified answer record. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - The unique identifier of this answer record. Format: |
| /// `projects//locations//answerRecords/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/answerRecords/\[^/\]+$`. |
| /// |
| /// [updateMask] - Required. The mask to control which fields get updated. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2AnswerRecord]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2AnswerRecord> patch( |
| GoogleCloudDialogflowV2AnswerRecord request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2AnswerRecord.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsConversationProfilesResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsConversationProfilesResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates a conversation profile in the specified project. |
| /// |
| /// ConversationProfile.CreateTime and ConversationProfile.UpdateTime aren't |
| /// populated in the response. You can retrieve them via |
| /// GetConversationProfile API. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project to create a conversation profile for. |
| /// Format: `projects//locations/`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ConversationProfile]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ConversationProfile> create( |
| GoogleCloudDialogflowV2ConversationProfile request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/conversationProfiles'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ConversationProfile.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified conversation profile. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the conversation profile to delete. Format: |
| /// `projects//locations//conversationProfiles/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/conversationProfiles/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> delete( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified conversation profile. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The resource name of the conversation profile. Format: |
| /// `projects//locations//conversationProfiles/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/conversationProfiles/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ConversationProfile]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ConversationProfile> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ConversationProfile.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all conversation profiles in the specified project. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project to list all conversation profiles from. |
| /// Format: `projects//locations/`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. |
| /// |
| /// [pageSize] - The maximum number of items to return in a single page. By |
| /// default 100 and at most 1000. |
| /// |
| /// [pageToken] - The next_page_token value returned from a previous list |
| /// request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a |
| /// [GoogleCloudDialogflowV2ListConversationProfilesResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListConversationProfilesResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/conversationProfiles'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListConversationProfilesResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified conversation profile. |
| /// |
| /// ConversationProfile.CreateTime and ConversationProfile.UpdateTime aren't |
| /// populated in the response. You can retrieve them via |
| /// GetConversationProfile API. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - The unique identifier of this conversation profile. Format: |
| /// `projects//locations//conversationProfiles/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/conversationProfiles/\[^/\]+$`. |
| /// |
| /// [updateMask] - Required. The mask to control which fields to update. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ConversationProfile]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ConversationProfile> patch( |
| GoogleCloudDialogflowV2ConversationProfile request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ConversationProfile.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsConversationsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsConversationsMessagesResource get messages => |
| ProjectsLocationsConversationsMessagesResource(_requester); |
| ProjectsLocationsConversationsParticipantsResource get participants => |
| ProjectsLocationsConversationsParticipantsResource(_requester); |
| |
| ProjectsLocationsConversationsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Completes the specified conversation. |
| /// |
| /// Finished conversations are purged from the database after 30 days. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. Resource identifier of the conversation to close. |
| /// Format: `projects//locations//conversations/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/conversations/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Conversation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Conversation> complete( |
| GoogleCloudDialogflowV2CompleteConversationRequest request, |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name') + ':complete'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Conversation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Creates a new conversation. |
| /// |
| /// Conversations are auto-completed after 24 hours. Conversation Lifecycle: |
| /// There are two stages during a conversation: Automated Agent Stage and |
| /// Assist Stage. For Automated Agent Stage, there will be a dialogflow agent |
| /// responding to user queries. For Assist Stage, there's no dialogflow agent |
| /// responding to user queries. But we will provide suggestions which are |
| /// generated from conversation. If Conversation.conversation_profile is |
| /// configured for a dialogflow agent, conversation will start from `Automated |
| /// Agent Stage`, otherwise, it will start from `Assist Stage`. And during |
| /// `Automated Agent Stage`, once an Intent with Intent.live_agent_handoff is |
| /// triggered, conversation will transfer to Assist Stage. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. Resource identifier of the project creating the |
| /// conversation. Format: `projects//locations/`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. |
| /// |
| /// [conversationId] - Optional. Identifier of the conversation. Generally |
| /// it's auto generated by Google. Only set it if you cannot wait for the |
| /// response to return a auto-generated one to you. The conversation ID must |
| /// be compliant with the regression fomula "a-zA-Z*" with the characters |
| /// length in range of \[3,64\]. If the field is provided, the caller is |
| /// resposible for 1. the uniqueness of the ID, otherwise the request will be |
| /// rejected. 2. the consistency for whether to use custom ID or not under a |
| /// project to better ensure uniqueness. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Conversation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Conversation> create( |
| GoogleCloudDialogflowV2Conversation request, |
| core.String parent, { |
| core.String? conversationId, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (conversationId != null) 'conversationId': [conversationId], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/conversations'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Conversation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specific conversation. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the conversation. Format: |
| /// `projects//locations//conversations/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/conversations/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Conversation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Conversation> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Conversation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all conversations in the specified project. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project from which to list all conversation. |
| /// Format: `projects//locations/`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. |
| /// |
| /// [filter] - A filter expression that filters conversations listed in the |
| /// response. In general, the expression must specify the field name, a |
| /// comparison operator, and the value to use for filtering: - The value must |
| /// be a string, a number, or a boolean. - The comparison operator must be |
| /// either `=`,`!=`, `>`, or `<`. - To filter on multiple expressions, |
| /// separate the expressions with `AND` or `OR` (omitting both implies `AND`). |
| /// - For clarity, expressions can be enclosed in parentheses. Only |
| /// `lifecycle_state` can be filtered on in this way. For example, the |
| /// following expression only returns `COMPLETED` conversations: |
| /// `lifecycle_state = "COMPLETED"` For more information about filtering, see |
| /// [API Filtering](https://aip.dev/160). |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListConversationsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListConversationsResponse> list( |
| core.String parent, { |
| core.String? filter, |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (filter != null) 'filter': [filter], |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/conversations'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListConversationsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsConversationsMessagesResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsConversationsMessagesResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Lists messages that belong to a given conversation. |
| /// |
| /// `messages` are ordered by `create_time` in descending order. To fetch |
| /// updates without duplication, send request with filter |
| /// `create_time_epoch_microseconds > [first item's create_time of previous |
| /// request]` and empty page_token. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the conversation to list messages for. |
| /// Format: `projects//locations//conversations/` |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/conversations/\[^/\]+$`. |
| /// |
| /// [filter] - Optional. Filter on message fields. Currently predicates on |
| /// `create_time` and `create_time_epoch_microseconds` are supported. |
| /// `create_time` only support milliseconds accuracy. E.g., |
| /// `create_time_epoch_microseconds > 1551790877964485` or `create_time > |
| /// 2017-01-15T01:30:15.01Z`. For more information about filtering, see |
| /// [API Filtering](https://aip.dev/160). |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListMessagesResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListMessagesResponse> list( |
| core.String parent, { |
| core.String? filter, |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (filter != null) 'filter': [filter], |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/messages'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListMessagesResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsConversationsParticipantsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsConversationsParticipantsSuggestionsResource |
| get suggestions => |
| ProjectsLocationsConversationsParticipantsSuggestionsResource( |
| _requester); |
| |
| ProjectsLocationsConversationsParticipantsResource( |
| commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Adds a text (chat, for example), or audio (phone recording, for example) |
| /// message from a participant into the conversation. |
| /// |
| /// Note: Always use agent versions for production traffic sent to virtual |
| /// agents. See |
| /// [Versions and environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [participant] - Required. The name of the participant this text comes |
| /// from. Format: `projects//locations//conversations//participants/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/conversations/\[^/\]+/participants/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2AnalyzeContentResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2AnalyzeContentResponse> analyzeContent( |
| GoogleCloudDialogflowV2AnalyzeContentRequest request, |
| core.String participant, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$participant') + ':analyzeContent'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2AnalyzeContentResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Creates a new participant in a conversation. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. Resource identifier of the conversation adding the |
| /// participant. Format: `projects//locations//conversations/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/conversations/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Participant]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Participant> create( |
| GoogleCloudDialogflowV2Participant request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/participants'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Participant.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves a conversation participant. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the participant. Format: |
| /// `projects//locations//conversations//participants/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/conversations/\[^/\]+/participants/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Participant]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Participant> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Participant.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all participants in the specified conversation. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The conversation to list all participants from. |
| /// Format: `projects//locations//conversations/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/conversations/\[^/\]+$`. |
| /// |
| /// [pageSize] - Optional. The maximum number of items to return in a single |
| /// page. By default 100 and at most 1000. |
| /// |
| /// [pageToken] - Optional. The next_page_token value returned from a previous |
| /// list request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListParticipantsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListParticipantsResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/participants'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListParticipantsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified participant. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Optional. The unique identifier of this participant. Format: |
| /// `projects//locations//conversations//participants/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/conversations/\[^/\]+/participants/\[^/\]+$`. |
| /// |
| /// [updateMask] - Required. The mask to specify which fields to update. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Participant]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Participant> patch( |
| GoogleCloudDialogflowV2Participant request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Participant.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsConversationsParticipantsSuggestionsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsConversationsParticipantsSuggestionsResource( |
| commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Gets suggested articles for a participant based on specific historical |
| /// messages. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the participant to fetch suggestion for. |
| /// Format: `projects//locations//conversations//participants/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/conversations/\[^/\]+/participants/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2SuggestArticlesResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2SuggestArticlesResponse> suggestArticles( |
| GoogleCloudDialogflowV2SuggestArticlesRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = |
| 'v2/' + core.Uri.encodeFull('$parent') + '/suggestions:suggestArticles'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2SuggestArticlesResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Gets suggested faq answers for a participant based on specific historical |
| /// messages. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The name of the participant to fetch suggestion for. |
| /// Format: `projects//locations//conversations//participants/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/conversations/\[^/\]+/participants/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2SuggestFaqAnswersResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2SuggestFaqAnswersResponse> |
| suggestFaqAnswers( |
| GoogleCloudDialogflowV2SuggestFaqAnswersRequest request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + |
| core.Uri.encodeFull('$parent') + |
| '/suggestions:suggestFaqAnswers'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2SuggestFaqAnswersResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsKnowledgeBasesResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsKnowledgeBasesDocumentsResource get documents => |
| ProjectsLocationsKnowledgeBasesDocumentsResource(_requester); |
| |
| ProjectsLocationsKnowledgeBasesResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates a knowledge base. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project to create a knowledge base for. Format: |
| /// `projects//locations/`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2KnowledgeBase]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2KnowledgeBase> create( |
| GoogleCloudDialogflowV2KnowledgeBase request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/knowledgeBases'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2KnowledgeBase.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified knowledge base. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the knowledge base to delete. Format: |
| /// `projects//locations//knowledgeBases/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/knowledgeBases/\[^/\]+$`. |
| /// |
| /// [force] - Optional. Force deletes the knowledge base. When set to true, |
| /// any documents in the knowledge base are also deleted. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> delete( |
| core.String name, { |
| core.bool? force, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (force != null) 'force': ['${force}'], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified knowledge base. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the knowledge base to retrieve. Format |
| /// `projects//locations//knowledgeBases/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/knowledgeBases/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2KnowledgeBase]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2KnowledgeBase> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2KnowledgeBase.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all knowledge bases of the specified agent. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The project to list of knowledge bases for. Format: |
| /// `projects//locations/`. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. |
| /// |
| /// [pageSize] - The maximum number of items to return in a single page. By |
| /// default 10 and at most 100. |
| /// |
| /// [pageToken] - The next_page_token value returned from a previous list |
| /// request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListKnowledgeBasesResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListKnowledgeBasesResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/knowledgeBases'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListKnowledgeBasesResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified knowledge base. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - The knowledge base resource name. The name must be empty when |
| /// creating a knowledge base. Format: `projects//locations//knowledgeBases/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/knowledgeBases/\[^/\]+$`. |
| /// |
| /// [updateMask] - Optional. Not specified means `update all`. Currently, only |
| /// `display_name` can be updated, an InvalidArgument will be returned for |
| /// attempting to update other fields. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2KnowledgeBase]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2KnowledgeBase> patch( |
| GoogleCloudDialogflowV2KnowledgeBase request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2KnowledgeBase.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsKnowledgeBasesDocumentsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsKnowledgeBasesDocumentsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Creates a new document. |
| /// |
| /// Operation |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The knowledge base to create a document for. Format: |
| /// `projects//locations//knowledgeBases/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/knowledgeBases/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> create( |
| GoogleCloudDialogflowV2Document request, |
| core.String parent, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/documents'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deletes the specified document. |
| /// |
| /// Operation |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the document to delete. Format: |
| /// `projects//locations//knowledgeBases//documents/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/knowledgeBases/\[^/\]+/documents/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> delete( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'DELETE', |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Retrieves the specified document. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the document to retrieve. Format |
| /// `projects//locations//knowledgeBases//documents/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/knowledgeBases/\[^/\]+/documents/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2Document]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2Document> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2Document.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Returns the list of all documents of the knowledge base. |
| /// |
| /// Request parameters: |
| /// |
| /// [parent] - Required. The knowledge base to list all documents for. Format: |
| /// `projects//locations//knowledgeBases/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/knowledgeBases/\[^/\]+$`. |
| /// |
| /// [pageSize] - The maximum number of items to return in a single page. By |
| /// default 10 and at most 100. |
| /// |
| /// [pageToken] - The next_page_token value returned from a previous list |
| /// request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleCloudDialogflowV2ListDocumentsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleCloudDialogflowV2ListDocumentsResponse> list( |
| core.String parent, { |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$parent') + '/documents'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleCloudDialogflowV2ListDocumentsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the specified document. |
| /// |
| /// Operation |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Optional. The document resource name. The name must be empty when |
| /// creating a document. Format: |
| /// `projects//locations//knowledgeBases//documents/`. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/knowledgeBases/\[^/\]+/documents/\[^/\]+$`. |
| /// |
| /// [updateMask] - Optional. Not specified means `update all`. Currently, only |
| /// `display_name` can be updated, an InvalidArgument will be returned for |
| /// attempting to update other fields. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> patch( |
| GoogleCloudDialogflowV2Document request, |
| core.String name, { |
| core.String? updateMask, |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (updateMask != null) 'updateMask': [updateMask], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'PATCH', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Reloads the specified document from its specified source, content_uri or |
| /// content. |
| /// |
| /// The previously loaded content of the document will be deleted. Note: Even |
| /// when the content of the document has not changed, there still may be side |
| /// effects because of internal implementation changes. Note: The |
| /// `projects.agent.knowledgeBases.documents` resource is deprecated; only use |
| /// `projects.knowledgeBases.documents`. Operation |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - Required. The name of the document to reload. Format: |
| /// `projects//locations//knowledgeBases//documents/` |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/knowledgeBases/\[^/\]+/documents/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> reload( |
| GoogleCloudDialogflowV2ReloadDocumentRequest request, |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _body = convert.json.encode(request.toJson()); |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name') + ':reload'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| body: _body, |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsLocationsOperationsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsLocationsOperationsResource(commons.ApiRequester client) |
| : _requester = client; |
| |
| /// Starts asynchronous cancellation on a long-running operation. |
| /// |
| /// The server makes a best effort to cancel the operation, but success is not |
| /// guaranteed. If the server doesn't support this method, it returns |
| /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation |
| /// or other methods to check whether the cancellation succeeded or whether |
| /// the operation completed despite cancellation. On successful cancellation, |
| /// the operation is not deleted; instead, it becomes an operation with an |
| /// Operation.error value with a google.rpc.Status.code of 1, corresponding to |
| /// `Code.CANCELLED`. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - The name of the operation resource to be cancelled. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> cancel( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name') + ':cancel'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Gets the latest state of a long-running operation. |
| /// |
| /// Clients can use this method to poll the operation result at intervals as |
| /// recommended by the API service. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - The name of the operation resource. |
| /// Value must have pattern |
| /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Lists operations that match the specified filter in the request. |
| /// |
| /// If the server doesn't support this method, it returns `UNIMPLEMENTED`. |
| /// NOTE: the `name` binding allows API services to override the binding to |
| /// use different resource name schemes, such as `users / * /operations`. To |
| /// override the binding, API services can add a binding such as |
| /// `"/v1/{name=users / * }/operations"` to their service configuration. For |
| /// backwards compatibility, the default name includes the operations |
| /// collection id, however overriding users must ensure the name binding is |
| /// the parent resource, without the operations collection id. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - The name of the operation's parent resource. |
| /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. |
| /// |
| /// [filter] - The standard list filter. |
| /// |
| /// [pageSize] - The standard list page size. |
| /// |
| /// [pageToken] - The standard list page token. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningListOperationsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningListOperationsResponse> list( |
| core.String name, { |
| core.String? filter, |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (filter != null) 'filter': [filter], |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name') + '/operations'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningListOperationsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ProjectsOperationsResource { |
| final commons.ApiRequester _requester; |
| |
| ProjectsOperationsResource(commons.ApiRequester client) : _requester = client; |
| |
| /// Starts asynchronous cancellation on a long-running operation. |
| /// |
| /// The server makes a best effort to cancel the operation, but success is not |
| /// guaranteed. If the server doesn't support this method, it returns |
| /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation |
| /// or other methods to check whether the cancellation succeeded or whether |
| /// the operation completed despite cancellation. On successful cancellation, |
| /// the operation is not deleted; instead, it becomes an operation with an |
| /// Operation.error value with a google.rpc.Status.code of 1, corresponding to |
| /// `Code.CANCELLED`. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - The name of the operation resource to be cancelled. |
| /// Value must have pattern `^projects/\[^/\]+/operations/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleProtobufEmpty]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleProtobufEmpty> cancel( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name') + ':cancel'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'POST', |
| queryParams: _queryParams, |
| ); |
| return GoogleProtobufEmpty.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Gets the latest state of a long-running operation. |
| /// |
| /// Clients can use this method to poll the operation result at intervals as |
| /// recommended by the API service. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - The name of the operation resource. |
| /// Value must have pattern `^projects/\[^/\]+/operations/\[^/\]+$`. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningOperation]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningOperation> get( |
| core.String name, { |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name'); |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningOperation.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Lists operations that match the specified filter in the request. |
| /// |
| /// If the server doesn't support this method, it returns `UNIMPLEMENTED`. |
| /// NOTE: the `name` binding allows API services to override the binding to |
| /// use different resource name schemes, such as `users / * /operations`. To |
| /// override the binding, API services can add a binding such as |
| /// `"/v1/{name=users / * }/operations"` to their service configuration. For |
| /// backwards compatibility, the default name includes the operations |
| /// collection id, however overriding users must ensure the name binding is |
| /// the parent resource, without the operations collection id. |
| /// |
| /// Request parameters: |
| /// |
| /// [name] - The name of the operation's parent resource. |
| /// Value must have pattern `^projects/\[^/\]+$`. |
| /// |
| /// [filter] - The standard list filter. |
| /// |
| /// [pageSize] - The standard list page size. |
| /// |
| /// [pageToken] - The standard list page token. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GoogleLongrunningListOperationsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GoogleLongrunningListOperationsResponse> list( |
| core.String name, { |
| core.String? filter, |
| core.int? pageSize, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final _queryParams = <core.String, core.List<core.String>>{ |
| if (filter != null) 'filter': [filter], |
| if (pageSize != null) 'pageSize': ['${pageSize}'], |
| if (pageToken != null) 'pageToken': [pageToken], |
| if ($fields != null) 'fields': [$fields], |
| }; |
| |
| final _url = 'v2/' + core.Uri.encodeFull('$name') + '/operations'; |
| |
| final _response = await _requester.request( |
| _url, |
| 'GET', |
| queryParams: _queryParams, |
| ); |
| return GoogleLongrunningListOperationsResponse.fromJson( |
| _response as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| /// Represents the natural speech audio to be processed. |
| class GoogleCloudDialogflowCxV3AudioInput { |
| /// The natural language speech audio to be processed. |
| /// |
| /// A single request can contain up to 1 minute of speech audio data. The |
| /// transcribed text cannot contain more than 256 bytes. For non-streaming |
| /// audio detect intent, both `config` and `audio` must be provided. For |
| /// streaming audio detect intent, `config` must be provided in the first |
| /// request and `audio` must be provided in all following requests. |
| core.String? audio; |
| core.List<core.int> get audioAsBytes => convert.base64.decode(audio!); |
| |
| set audioAsBytes(core.List<core.int> _bytes) { |
| audio = |
| convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); |
| } |
| |
| /// Instructs the speech recognizer how to process the speech audio. |
| /// |
| /// Required. |
| GoogleCloudDialogflowCxV3InputAudioConfig? config; |
| |
| GoogleCloudDialogflowCxV3AudioInput({ |
| this.audio, |
| this.config, |
| }); |
| |
| GoogleCloudDialogflowCxV3AudioInput.fromJson(core.Map _json) |
| : this( |
| audio: |
| _json.containsKey('audio') ? _json['audio'] as core.String : null, |
| config: _json.containsKey('config') |
| ? GoogleCloudDialogflowCxV3InputAudioConfig.fromJson( |
| _json['config'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (audio != null) 'audio': audio!, |
| if (config != null) 'config': config!.toJson(), |
| }; |
| } |
| |
| /// Metadata returned for the TestCases.BatchRunTestCases long running |
| /// operation. |
| class GoogleCloudDialogflowCxV3BatchRunTestCasesMetadata { |
| /// The test errors. |
| core.List<GoogleCloudDialogflowCxV3TestError>? errors; |
| |
| GoogleCloudDialogflowCxV3BatchRunTestCasesMetadata({ |
| this.errors, |
| }); |
| |
| GoogleCloudDialogflowCxV3BatchRunTestCasesMetadata.fromJson(core.Map _json) |
| : this( |
| errors: _json.containsKey('errors') |
| ? (_json['errors'] as core.List) |
| .map<GoogleCloudDialogflowCxV3TestError>((value) => |
| GoogleCloudDialogflowCxV3TestError.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (errors != null) |
| 'errors': errors!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// The response message for TestCases.BatchRunTestCases. |
| class GoogleCloudDialogflowCxV3BatchRunTestCasesResponse { |
| /// The test case results. |
| /// |
| /// The detailed conversation turns are empty in this response. |
| core.List<GoogleCloudDialogflowCxV3TestCaseResult>? results; |
| |
| GoogleCloudDialogflowCxV3BatchRunTestCasesResponse({ |
| this.results, |
| }); |
| |
| GoogleCloudDialogflowCxV3BatchRunTestCasesResponse.fromJson(core.Map _json) |
| : this( |
| results: _json.containsKey('results') |
| ? (_json['results'] as core.List) |
| .map<GoogleCloudDialogflowCxV3TestCaseResult>((value) => |
| GoogleCloudDialogflowCxV3TestCaseResult.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (results != null) |
| 'results': results!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Represents a result from running a test case in an agent environment. |
| class GoogleCloudDialogflowCxV3ContinuousTestResult { |
| /// The resource name for the continuous test result. |
| /// |
| /// Format: |
| /// `projects//locations//agents//environments//continuousTestResults/`. |
| core.String? name; |
| |
| /// The result of this continuous test run, i.e. whether all the tests in this |
| /// continuous test run pass or not. |
| /// Possible string values are: |
| /// - "AGGREGATED_TEST_RESULT_UNSPECIFIED" : Not specified. Should never be |
| /// used. |
| /// - "PASSED" : All the tests passed. |
| /// - "FAILED" : At least one test did not pass. |
| core.String? result; |
| |
| /// Time when the continuous testing run starts. |
| core.String? runTime; |
| |
| /// A list of individual test case results names in this continuous test run. |
| core.List<core.String>? testCaseResults; |
| |
| GoogleCloudDialogflowCxV3ContinuousTestResult({ |
| this.name, |
| this.result, |
| this.runTime, |
| this.testCaseResults, |
| }); |
| |
| GoogleCloudDialogflowCxV3ContinuousTestResult.fromJson(core.Map _json) |
| : this( |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| result: _json.containsKey('result') |
| ? _json['result'] as core.String |
| : null, |
| runTime: _json.containsKey('runTime') |
| ? _json['runTime'] as core.String |
| : null, |
| testCaseResults: _json.containsKey('testCaseResults') |
| ? (_json['testCaseResults'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (name != null) 'name': name!, |
| if (result != null) 'result': result!, |
| if (runTime != null) 'runTime': runTime!, |
| if (testCaseResults != null) 'testCaseResults': testCaseResults!, |
| }; |
| } |
| |
| /// One interaction between a human and virtual agent. |
| /// |
| /// The human provides some input and the virtual agent provides a response. |
| class GoogleCloudDialogflowCxV3ConversationTurn { |
| /// The user input. |
| GoogleCloudDialogflowCxV3ConversationTurnUserInput? userInput; |
| |
| /// The virtual agent output. |
| GoogleCloudDialogflowCxV3ConversationTurnVirtualAgentOutput? |
| virtualAgentOutput; |
| |
| GoogleCloudDialogflowCxV3ConversationTurn({ |
| this.userInput, |
| this.virtualAgentOutput, |
| }); |
| |
| GoogleCloudDialogflowCxV3ConversationTurn.fromJson(core.Map _json) |
| : this( |
| userInput: _json.containsKey('userInput') |
| ? GoogleCloudDialogflowCxV3ConversationTurnUserInput.fromJson( |
| _json['userInput'] as core.Map<core.String, core.dynamic>) |
| : null, |
| virtualAgentOutput: _json.containsKey('virtualAgentOutput') |
| ? GoogleCloudDialogflowCxV3ConversationTurnVirtualAgentOutput |
| .fromJson(_json['virtualAgentOutput'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (userInput != null) 'userInput': userInput!.toJson(), |
| if (virtualAgentOutput != null) |
| 'virtualAgentOutput': virtualAgentOutput!.toJson(), |
| }; |
| } |
| |
| /// The input from the human user. |
| class GoogleCloudDialogflowCxV3ConversationTurnUserInput { |
| /// Whether sentiment analysis is enabled. |
| core.bool? enableSentimentAnalysis; |
| |
| /// Parameters that need to be injected into the conversation during intent |
| /// detection. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? injectedParameters; |
| |
| /// Supports text input, event input, dtmf input in the test case. |
| GoogleCloudDialogflowCxV3QueryInput? input; |
| |
| /// If webhooks should be allowed to trigger in response to the user |
| /// utterance. |
| /// |
| /// Often if parameters are injected, webhooks should not be enabled. |
| core.bool? isWebhookEnabled; |
| |
| GoogleCloudDialogflowCxV3ConversationTurnUserInput({ |
| this.enableSentimentAnalysis, |
| this.injectedParameters, |
| this.input, |
| this.isWebhookEnabled, |
| }); |
| |
| GoogleCloudDialogflowCxV3ConversationTurnUserInput.fromJson(core.Map _json) |
| : this( |
| enableSentimentAnalysis: _json.containsKey('enableSentimentAnalysis') |
| ? _json['enableSentimentAnalysis'] as core.bool |
| : null, |
| injectedParameters: _json.containsKey('injectedParameters') |
| ? (_json['injectedParameters'] |
| as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| input: _json.containsKey('input') |
| ? GoogleCloudDialogflowCxV3QueryInput.fromJson( |
| _json['input'] as core.Map<core.String, core.dynamic>) |
| : null, |
| isWebhookEnabled: _json.containsKey('isWebhookEnabled') |
| ? _json['isWebhookEnabled'] as core.bool |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (enableSentimentAnalysis != null) |
| 'enableSentimentAnalysis': enableSentimentAnalysis!, |
| if (injectedParameters != null) |
| 'injectedParameters': injectedParameters!, |
| if (input != null) 'input': input!.toJson(), |
| if (isWebhookEnabled != null) 'isWebhookEnabled': isWebhookEnabled!, |
| }; |
| } |
| |
| /// The output from the virtual agent. |
| class GoogleCloudDialogflowCxV3ConversationTurnVirtualAgentOutput { |
| /// The Page on which the utterance was spoken. |
| /// |
| /// Only name and displayName will be set. |
| GoogleCloudDialogflowCxV3Page? currentPage; |
| |
| /// Input only. |
| /// |
| /// The diagnostic info output for the turn. Required to calculate the testing |
| /// coverage. |
| /// |
| /// Required. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? diagnosticInfo; |
| |
| /// If this is part of a result conversation turn, the list of differences |
| /// between the original run and the replay for this output, if any. |
| /// |
| /// Output only. |
| core.List<GoogleCloudDialogflowCxV3TestRunDifference>? differences; |
| |
| /// The session parameters available to the bot at this point. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? sessionParameters; |
| |
| /// Response error from the agent in the test result. |
| /// |
| /// If set, other output is empty. |
| GoogleRpcStatus? status; |
| |
| /// The text responses from the agent for the turn. |
| core.List<GoogleCloudDialogflowCxV3ResponseMessageText>? textResponses; |
| |
| /// The Intent that triggered the response. |
| /// |
| /// Only name and displayName will be set. |
| GoogleCloudDialogflowCxV3Intent? triggeredIntent; |
| |
| GoogleCloudDialogflowCxV3ConversationTurnVirtualAgentOutput({ |
| this.currentPage, |
| this.diagnosticInfo, |
| this.differences, |
| this.sessionParameters, |
| this.status, |
| this.textResponses, |
| this.triggeredIntent, |
| }); |
| |
| GoogleCloudDialogflowCxV3ConversationTurnVirtualAgentOutput.fromJson( |
| core.Map _json) |
| : this( |
| currentPage: _json.containsKey('currentPage') |
| ? GoogleCloudDialogflowCxV3Page.fromJson( |
| _json['currentPage'] as core.Map<core.String, core.dynamic>) |
| : null, |
| diagnosticInfo: _json.containsKey('diagnosticInfo') |
| ? (_json['diagnosticInfo'] as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| differences: _json.containsKey('differences') |
| ? (_json['differences'] as core.List) |
| .map<GoogleCloudDialogflowCxV3TestRunDifference>((value) => |
| GoogleCloudDialogflowCxV3TestRunDifference.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| sessionParameters: _json.containsKey('sessionParameters') |
| ? (_json['sessionParameters'] |
| as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| status: _json.containsKey('status') |
| ? GoogleRpcStatus.fromJson( |
| _json['status'] as core.Map<core.String, core.dynamic>) |
| : null, |
| textResponses: _json.containsKey('textResponses') |
| ? (_json['textResponses'] as core.List) |
| .map<GoogleCloudDialogflowCxV3ResponseMessageText>((value) => |
| GoogleCloudDialogflowCxV3ResponseMessageText.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| triggeredIntent: _json.containsKey('triggeredIntent') |
| ? GoogleCloudDialogflowCxV3Intent.fromJson( |
| _json['triggeredIntent'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (currentPage != null) 'currentPage': currentPage!.toJson(), |
| if (diagnosticInfo != null) 'diagnosticInfo': diagnosticInfo!, |
| if (differences != null) |
| 'differences': differences!.map((value) => value.toJson()).toList(), |
| if (sessionParameters != null) 'sessionParameters': sessionParameters!, |
| if (status != null) 'status': status!.toJson(), |
| if (textResponses != null) |
| 'textResponses': |
| textResponses!.map((value) => value.toJson()).toList(), |
| if (triggeredIntent != null) |
| 'triggeredIntent': triggeredIntent!.toJson(), |
| }; |
| } |
| |
| /// Metadata for CreateDocument operation. |
| class GoogleCloudDialogflowCxV3CreateDocumentOperationMetadata { |
| /// The generic information of the operation. |
| GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata? genericMetadata; |
| |
| GoogleCloudDialogflowCxV3CreateDocumentOperationMetadata({ |
| this.genericMetadata, |
| }); |
| |
| GoogleCloudDialogflowCxV3CreateDocumentOperationMetadata.fromJson( |
| core.Map _json) |
| : this( |
| genericMetadata: _json.containsKey('genericMetadata') |
| ? GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata |
| .fromJson(_json['genericMetadata'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (genericMetadata != null) |
| 'genericMetadata': genericMetadata!.toJson(), |
| }; |
| } |
| |
| /// Metadata associated with the long running operation for |
| /// Versions.CreateVersion. |
| class GoogleCloudDialogflowCxV3CreateVersionOperationMetadata { |
| /// Name of the created version. |
| /// |
| /// Format: `projects//locations//agents//flows//versions/`. |
| core.String? version; |
| |
| GoogleCloudDialogflowCxV3CreateVersionOperationMetadata({ |
| this.version, |
| }); |
| |
| GoogleCloudDialogflowCxV3CreateVersionOperationMetadata.fromJson( |
| core.Map _json) |
| : this( |
| version: _json.containsKey('version') |
| ? _json['version'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (version != null) 'version': version!, |
| }; |
| } |
| |
| /// Metadata for DeleteDocument operation. |
| class GoogleCloudDialogflowCxV3DeleteDocumentOperationMetadata { |
| /// The generic information of the operation. |
| GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata? genericMetadata; |
| |
| GoogleCloudDialogflowCxV3DeleteDocumentOperationMetadata({ |
| this.genericMetadata, |
| }); |
| |
| GoogleCloudDialogflowCxV3DeleteDocumentOperationMetadata.fromJson( |
| core.Map _json) |
| : this( |
| genericMetadata: _json.containsKey('genericMetadata') |
| ? GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata |
| .fromJson(_json['genericMetadata'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (genericMetadata != null) |
| 'genericMetadata': genericMetadata!.toJson(), |
| }; |
| } |
| |
| /// Represents the input for dtmf event. |
| class GoogleCloudDialogflowCxV3DtmfInput { |
| /// The dtmf digits. |
| core.String? digits; |
| |
| /// The finish digit (if any). |
| core.String? finishDigit; |
| |
| GoogleCloudDialogflowCxV3DtmfInput({ |
| this.digits, |
| this.finishDigit, |
| }); |
| |
| GoogleCloudDialogflowCxV3DtmfInput.fromJson(core.Map _json) |
| : this( |
| digits: _json.containsKey('digits') |
| ? _json['digits'] as core.String |
| : null, |
| finishDigit: _json.containsKey('finishDigit') |
| ? _json['finishDigit'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (digits != null) 'digits': digits!, |
| if (finishDigit != null) 'finishDigit': finishDigit!, |
| }; |
| } |
| |
| /// An event handler specifies an event that can be handled during a session. |
| /// |
| /// When the specified event happens, the following actions are taken in order: |
| /// * If there is a `trigger_fulfillment` associated with the event, it will be |
| /// called. * If there is a `target_page` associated with the event, the session |
| /// will transition into the specified page. * If there is a `target_flow` |
| /// associated with the event, the session will transition into the specified |
| /// flow. |
| class GoogleCloudDialogflowCxV3EventHandler { |
| /// The name of the event to handle. |
| /// |
| /// Required. |
| core.String? event; |
| |
| /// The unique identifier of this event handler. |
| /// |
| /// Output only. |
| core.String? name; |
| |
| /// The target flow to transition to. |
| /// |
| /// Format: `projects//locations//agents//flows/`. |
| core.String? targetFlow; |
| |
| /// The target page to transition to. |
| /// |
| /// Format: `projects//locations//agents//flows//pages/`. |
| core.String? targetPage; |
| |
| /// The fulfillment to call when the event occurs. |
| /// |
| /// Handling webhook errors with a fulfillment enabled with webhook could |
| /// cause infinite loop. It is invalid to specify such fulfillment for a |
| /// handler handling webhooks. |
| GoogleCloudDialogflowCxV3Fulfillment? triggerFulfillment; |
| |
| GoogleCloudDialogflowCxV3EventHandler({ |
| this.event, |
| this.name, |
| this.targetFlow, |
| this.targetPage, |
| this.triggerFulfillment, |
| }); |
| |
| GoogleCloudDialogflowCxV3EventHandler.fromJson(core.Map _json) |
| : this( |
| event: |
| _json.containsKey('event') ? _json['event'] as core.String : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| targetFlow: _json.containsKey('targetFlow') |
| ? _json['targetFlow'] as core.String |
| : null, |
| targetPage: _json.containsKey('targetPage') |
| ? _json['targetPage'] as core.String |
| : null, |
| triggerFulfillment: _json.containsKey('triggerFulfillment') |
| ? GoogleCloudDialogflowCxV3Fulfillment.fromJson( |
| _json['triggerFulfillment'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (event != null) 'event': event!, |
| if (name != null) 'name': name!, |
| if (targetFlow != null) 'targetFlow': targetFlow!, |
| if (targetPage != null) 'targetPage': targetPage!, |
| if (triggerFulfillment != null) |
| 'triggerFulfillment': triggerFulfillment!.toJson(), |
| }; |
| } |
| |
| /// Represents the event to trigger. |
| class GoogleCloudDialogflowCxV3EventInput { |
| /// Name of the event. |
| core.String? event; |
| |
| GoogleCloudDialogflowCxV3EventInput({ |
| this.event, |
| }); |
| |
| GoogleCloudDialogflowCxV3EventInput.fromJson(core.Map _json) |
| : this( |
| event: |
| _json.containsKey('event') ? _json['event'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (event != null) 'event': event!, |
| }; |
| } |
| |
| /// The response message for Agents.ExportAgent. |
| class GoogleCloudDialogflowCxV3ExportAgentResponse { |
| /// Uncompressed raw byte content for agent. |
| core.String? agentContent; |
| core.List<core.int> get agentContentAsBytes => |
| convert.base64.decode(agentContent!); |
| |
| set agentContentAsBytes(core.List<core.int> _bytes) { |
| agentContent = |
| convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); |
| } |
| |
| /// The URI to a file containing the exported agent. |
| /// |
| /// This field is populated only if `agent_uri` is specified in |
| /// ExportAgentRequest. |
| core.String? agentUri; |
| |
| GoogleCloudDialogflowCxV3ExportAgentResponse({ |
| this.agentContent, |
| this.agentUri, |
| }); |
| |
| GoogleCloudDialogflowCxV3ExportAgentResponse.fromJson(core.Map _json) |
| : this( |
| agentContent: _json.containsKey('agentContent') |
| ? _json['agentContent'] as core.String |
| : null, |
| agentUri: _json.containsKey('agentUri') |
| ? _json['agentUri'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (agentContent != null) 'agentContent': agentContent!, |
| if (agentUri != null) 'agentUri': agentUri!, |
| }; |
| } |
| |
| /// The response message for Flows.ExportFlow. |
| class GoogleCloudDialogflowCxV3ExportFlowResponse { |
| /// Uncompressed raw byte content for flow. |
| core.String? flowContent; |
| core.List<core.int> get flowContentAsBytes => |
| convert.base64.decode(flowContent!); |
| |
| set flowContentAsBytes(core.List<core.int> _bytes) { |
| flowContent = |
| convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); |
| } |
| |
| /// The URI to a file containing the exported flow. |
| /// |
| /// This field is populated only if `flow_uri` is specified in |
| /// ExportFlowRequest. |
| core.String? flowUri; |
| |
| GoogleCloudDialogflowCxV3ExportFlowResponse({ |
| this.flowContent, |
| this.flowUri, |
| }); |
| |
| GoogleCloudDialogflowCxV3ExportFlowResponse.fromJson(core.Map _json) |
| : this( |
| flowContent: _json.containsKey('flowContent') |
| ? _json['flowContent'] as core.String |
| : null, |
| flowUri: _json.containsKey('flowUri') |
| ? _json['flowUri'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (flowContent != null) 'flowContent': flowContent!, |
| if (flowUri != null) 'flowUri': flowUri!, |
| }; |
| } |
| |
| /// Metadata returned for the TestCases.ExportTestCases long running operation. |
| /// |
| /// This message currently has no fields. |
| class GoogleCloudDialogflowCxV3ExportTestCasesMetadata { |
| GoogleCloudDialogflowCxV3ExportTestCasesMetadata(); |
| |
| GoogleCloudDialogflowCxV3ExportTestCasesMetadata.fromJson( |
| // ignore: avoid_unused_constructor_parameters |
| core.Map _json); |
| |
| core.Map<core.String, core.dynamic> toJson() => {}; |
| } |
| |
| /// The response message for TestCases.ExportTestCases. |
| class GoogleCloudDialogflowCxV3ExportTestCasesResponse { |
| /// Uncompressed raw byte content for test cases. |
| core.String? content; |
| core.List<core.int> get contentAsBytes => convert.base64.decode(content!); |
| |
| set contentAsBytes(core.List<core.int> _bytes) { |
| content = |
| convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); |
| } |
| |
| /// The URI to a file containing the exported test cases. |
| /// |
| /// This field is populated only if `gcs_uri` is specified in |
| /// ExportTestCasesRequest. |
| core.String? gcsUri; |
| |
| GoogleCloudDialogflowCxV3ExportTestCasesResponse({ |
| this.content, |
| this.gcsUri, |
| }); |
| |
| GoogleCloudDialogflowCxV3ExportTestCasesResponse.fromJson(core.Map _json) |
| : this( |
| content: _json.containsKey('content') |
| ? _json['content'] as core.String |
| : null, |
| gcsUri: _json.containsKey('gcsUri') |
| ? _json['gcsUri'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (content != null) 'content': content!, |
| if (gcsUri != null) 'gcsUri': gcsUri!, |
| }; |
| } |
| |
| /// A form is a data model that groups related parameters that can be collected |
| /// from the user. |
| /// |
| /// The process in which the agent prompts the user and collects parameter |
| /// values from the user is called form filling. A form can be added to a page. |
| /// When form filling is done, the filled parameters will be written to the |
| /// session. |
| class GoogleCloudDialogflowCxV3Form { |
| /// Parameters to collect from the user. |
| core.List<GoogleCloudDialogflowCxV3FormParameter>? parameters; |
| |
| GoogleCloudDialogflowCxV3Form({ |
| this.parameters, |
| }); |
| |
| GoogleCloudDialogflowCxV3Form.fromJson(core.Map _json) |
| : this( |
| parameters: _json.containsKey('parameters') |
| ? (_json['parameters'] as core.List) |
| .map<GoogleCloudDialogflowCxV3FormParameter>((value) => |
| GoogleCloudDialogflowCxV3FormParameter.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (parameters != null) |
| 'parameters': parameters!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Represents a form parameter. |
| class GoogleCloudDialogflowCxV3FormParameter { |
| /// The default value of an optional parameter. |
| /// |
| /// If the parameter is required, the default value will be ignored. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Object? defaultValue; |
| |
| /// The human-readable name of the parameter, unique within the form. |
| /// |
| /// Required. |
| core.String? displayName; |
| |
| /// The entity type of the parameter. |
| /// |
| /// Format: `projects/-/locations/-/agents/-/entityTypes/` for system entity |
| /// types (for example, |
| /// `projects/-/locations/-/agents/-/entityTypes/sys.date`), or |
| /// `projects//locations//agents//entityTypes/` for developer entity types. |
| /// |
| /// Required. |
| core.String? entityType; |
| |
| /// Defines fill behavior for the parameter. |
| /// |
| /// Required. |
| GoogleCloudDialogflowCxV3FormParameterFillBehavior? fillBehavior; |
| |
| /// Indicates whether the parameter represents a list of values. |
| core.bool? isList; |
| |
| /// Indicates whether the parameter content should be redacted in log. |
| /// |
| /// If redaction is enabled, the parameter content will be replaced by |
| /// parameter name during logging. Note: the parameter content is subject to |
| /// redaction if either parameter level redaction or entity type level |
| /// redaction is enabled. |
| core.bool? redact; |
| |
| /// Indicates whether the parameter is required. |
| /// |
| /// Optional parameters will not trigger prompts; however, they are filled if |
| /// the user specifies them. Required parameters must be filled before form |
| /// filling concludes. |
| core.bool? required; |
| |
| GoogleCloudDialogflowCxV3FormParameter({ |
| this.defaultValue, |
| this.displayName, |
| this.entityType, |
| this.fillBehavior, |
| this.isList, |
| this.redact, |
| this.required, |
| }); |
| |
| GoogleCloudDialogflowCxV3FormParameter.fromJson(core.Map _json) |
| : this( |
| defaultValue: _json.containsKey('defaultValue') |
| ? _json['defaultValue'] as core.Object |
| : null, |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| entityType: _json.containsKey('entityType') |
| ? _json['entityType'] as core.String |
| : null, |
| fillBehavior: _json.containsKey('fillBehavior') |
| ? GoogleCloudDialogflowCxV3FormParameterFillBehavior.fromJson( |
| _json['fillBehavior'] as core.Map<core.String, core.dynamic>) |
| : null, |
| isList: |
| _json.containsKey('isList') ? _json['isList'] as core.bool : null, |
| redact: |
| _json.containsKey('redact') ? _json['redact'] as core.bool : null, |
| required: _json.containsKey('required') |
| ? _json['required'] as core.bool |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (defaultValue != null) 'defaultValue': defaultValue!, |
| if (displayName != null) 'displayName': displayName!, |
| if (entityType != null) 'entityType': entityType!, |
| if (fillBehavior != null) 'fillBehavior': fillBehavior!.toJson(), |
| if (isList != null) 'isList': isList!, |
| if (redact != null) 'redact': redact!, |
| if (required != null) 'required': required!, |
| }; |
| } |
| |
| /// Configuration for how the filling of a parameter should be handled. |
| class GoogleCloudDialogflowCxV3FormParameterFillBehavior { |
| /// The fulfillment to provide the initial prompt that the agent can present |
| /// to the user in order to fill the parameter. |
| /// |
| /// Required. |
| GoogleCloudDialogflowCxV3Fulfillment? initialPromptFulfillment; |
| |
| /// The handlers for parameter-level events, used to provide reprompt for the |
| /// parameter or transition to a different page/flow. |
| /// |
| /// The supported events are: * `sys.no-match-`, where N can be from 1 to 6 * |
| /// `sys.no-match-default` * `sys.no-input-`, where N can be from 1 to 6 * |
| /// `sys.no-input-default` * `sys.invalid-parameter` |
| /// `initial_prompt_fulfillment` provides the first prompt for the parameter. |
| /// If the user's response does not fill the parameter, a no-match/no-input |
| /// event will be triggered, and the fulfillment associated with the |
| /// `sys.no-match-1`/`sys.no-input-1` handler (if defined) will be called to |
| /// provide a prompt. The `sys.no-match-2`/`sys.no-input-2` handler (if |
| /// defined) will respond to the next no-match/no-input event, and so on. A |
| /// `sys.no-match-default` or `sys.no-input-default` handler will be used to |
| /// handle all following no-match/no-input events after all numbered |
| /// no-match/no-input handlers for the parameter are consumed. A |
| /// `sys.invalid-parameter` handler can be defined to handle the case where |
| /// the parameter values have been `invalidated` by webhook. For example, if |
| /// the user's response fill the parameter, however the parameter was |
| /// invalidated by webhook, the fulfillment associated with the |
| /// `sys.invalid-parameter` handler (if defined) will be called to provide a |
| /// prompt. If the event handler for the corresponding event can't be found on |
| /// the parameter, `initial_prompt_fulfillment` will be re-prompted. |
| core.List<GoogleCloudDialogflowCxV3EventHandler>? repromptEventHandlers; |
| |
| GoogleCloudDialogflowCxV3FormParameterFillBehavior({ |
| this.initialPromptFulfillment, |
| this.repromptEventHandlers, |
| }); |
| |
| GoogleCloudDialogflowCxV3FormParameterFillBehavior.fromJson(core.Map _json) |
| : this( |
| initialPromptFulfillment: |
| _json.containsKey('initialPromptFulfillment') |
| ? GoogleCloudDialogflowCxV3Fulfillment.fromJson( |
| _json['initialPromptFulfillment'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| repromptEventHandlers: _json.containsKey('repromptEventHandlers') |
| ? (_json['repromptEventHandlers'] as core.List) |
| .map<GoogleCloudDialogflowCxV3EventHandler>((value) => |
| GoogleCloudDialogflowCxV3EventHandler.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (initialPromptFulfillment != null) |
| 'initialPromptFulfillment': initialPromptFulfillment!.toJson(), |
| if (repromptEventHandlers != null) |
| 'repromptEventHandlers': |
| repromptEventHandlers!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// A fulfillment can do one or more of the following actions at the same time: |
| /// * Generate rich message responses. |
| /// |
| /// * Set parameter values. * Call the webhook. Fulfillments can be called at |
| /// various stages in the Page or Form lifecycle. For example, when a |
| /// DetectIntentRequest drives a session to enter a new page, the page's entry |
| /// fulfillment can add a static response to the QueryResult in the returning |
| /// DetectIntentResponse, call the webhook (for example, to load user data from |
| /// a database), or both. |
| class GoogleCloudDialogflowCxV3Fulfillment { |
| /// Conditional cases for this fulfillment. |
| core.List<GoogleCloudDialogflowCxV3FulfillmentConditionalCases>? |
| conditionalCases; |
| |
| /// The list of rich message responses to present to the user. |
| core.List<GoogleCloudDialogflowCxV3ResponseMessage>? messages; |
| |
| /// Whether Dialogflow should return currently queued fulfillment response |
| /// messages in streaming APIs. |
| /// |
| /// If a webhook is specified, it happens before Dialogflow invokes webhook. |
| /// Warning: 1) This flag only affects streaming API. Responses are still |
| /// queued and returned once in non-streaming API. 2) The flag can be enabled |
| /// in any fulfillment but only the first 3 partial responses will be |
| /// returned. You may only want to apply it to fulfillments that have slow |
| /// webhooks. |
| core.bool? returnPartialResponses; |
| |
| /// Set parameter values before executing the webhook. |
| core.List<GoogleCloudDialogflowCxV3FulfillmentSetParameterAction>? |
| setParameterActions; |
| |
| /// The tag used by the webhook to identify which fulfillment is being called. |
| /// |
| /// This field is required if `webhook` is specified. |
| core.String? tag; |
| |
| /// The webhook to call. |
| /// |
| /// Format: `projects//locations//agents//webhooks/`. |
| core.String? webhook; |
| |
| GoogleCloudDialogflowCxV3Fulfillment({ |
| this.conditionalCases, |
| this.messages, |
| this.returnPartialResponses, |
| this.setParameterActions, |
| this.tag, |
| this.webhook, |
| }); |
| |
| GoogleCloudDialogflowCxV3Fulfillment.fromJson(core.Map _json) |
| : this( |
| conditionalCases: _json.containsKey('conditionalCases') |
| ? (_json['conditionalCases'] as core.List) |
| .map<GoogleCloudDialogflowCxV3FulfillmentConditionalCases>( |
| (value) => |
| GoogleCloudDialogflowCxV3FulfillmentConditionalCases |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| messages: _json.containsKey('messages') |
| ? (_json['messages'] as core.List) |
| .map<GoogleCloudDialogflowCxV3ResponseMessage>((value) => |
| GoogleCloudDialogflowCxV3ResponseMessage.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| returnPartialResponses: _json.containsKey('returnPartialResponses') |
| ? _json['returnPartialResponses'] as core.bool |
| : null, |
| setParameterActions: _json.containsKey('setParameterActions') |
| ? (_json['setParameterActions'] as core.List) |
| .map<GoogleCloudDialogflowCxV3FulfillmentSetParameterAction>( |
| (value) => |
| GoogleCloudDialogflowCxV3FulfillmentSetParameterAction |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| tag: _json.containsKey('tag') ? _json['tag'] as core.String : null, |
| webhook: _json.containsKey('webhook') |
| ? _json['webhook'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (conditionalCases != null) |
| 'conditionalCases': |
| conditionalCases!.map((value) => value.toJson()).toList(), |
| if (messages != null) |
| 'messages': messages!.map((value) => value.toJson()).toList(), |
| if (returnPartialResponses != null) |
| 'returnPartialResponses': returnPartialResponses!, |
| if (setParameterActions != null) |
| 'setParameterActions': |
| setParameterActions!.map((value) => value.toJson()).toList(), |
| if (tag != null) 'tag': tag!, |
| if (webhook != null) 'webhook': webhook!, |
| }; |
| } |
| |
| /// A list of cascading if-else conditions. |
| /// |
| /// Cases are mutually exclusive. The first one with a matching condition is |
| /// selected, all the rest ignored. |
| class GoogleCloudDialogflowCxV3FulfillmentConditionalCases { |
| /// A list of cascading if-else conditions. |
| core.List<GoogleCloudDialogflowCxV3FulfillmentConditionalCasesCase>? cases; |
| |
| GoogleCloudDialogflowCxV3FulfillmentConditionalCases({ |
| this.cases, |
| }); |
| |
| GoogleCloudDialogflowCxV3FulfillmentConditionalCases.fromJson(core.Map _json) |
| : this( |
| cases: _json.containsKey('cases') |
| ? (_json['cases'] as core.List) |
| .map<GoogleCloudDialogflowCxV3FulfillmentConditionalCasesCase>( |
| (value) => |
| GoogleCloudDialogflowCxV3FulfillmentConditionalCasesCase |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (cases != null) |
| 'cases': cases!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Each case has a Boolean condition. |
| /// |
| /// When it is evaluated to be True, the corresponding messages will be selected |
| /// and evaluated recursively. |
| class GoogleCloudDialogflowCxV3FulfillmentConditionalCasesCase { |
| /// A list of case content. |
| core.List< |
| GoogleCloudDialogflowCxV3FulfillmentConditionalCasesCaseCaseContent>? |
| caseContent; |
| |
| /// The condition to activate and select this case. |
| /// |
| /// Empty means the condition is always true. The condition is evaluated |
| /// against form parameters or session parameters. See the |
| /// [conditions reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). |
| core.String? condition; |
| |
| GoogleCloudDialogflowCxV3FulfillmentConditionalCasesCase({ |
| this.caseContent, |
| this.condition, |
| }); |
| |
| GoogleCloudDialogflowCxV3FulfillmentConditionalCasesCase.fromJson( |
| core.Map _json) |
| : this( |
| caseContent: _json.containsKey('caseContent') |
| ? (_json['caseContent'] as core.List) |
| .map<GoogleCloudDialogflowCxV3FulfillmentConditionalCasesCaseCaseContent>( |
| (value) => |
| GoogleCloudDialogflowCxV3FulfillmentConditionalCasesCaseCaseContent |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| condition: _json.containsKey('condition') |
| ? _json['condition'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (caseContent != null) |
| 'caseContent': caseContent!.map((value) => value.toJson()).toList(), |
| if (condition != null) 'condition': condition!, |
| }; |
| } |
| |
| /// The list of messages or conditional cases to activate for this case. |
| class GoogleCloudDialogflowCxV3FulfillmentConditionalCasesCaseCaseContent { |
| /// Additional cases to be evaluated. |
| GoogleCloudDialogflowCxV3FulfillmentConditionalCases? additionalCases; |
| |
| /// Returned message. |
| GoogleCloudDialogflowCxV3ResponseMessage? message; |
| |
| GoogleCloudDialogflowCxV3FulfillmentConditionalCasesCaseCaseContent({ |
| this.additionalCases, |
| this.message, |
| }); |
| |
| GoogleCloudDialogflowCxV3FulfillmentConditionalCasesCaseCaseContent.fromJson( |
| core.Map _json) |
| : this( |
| additionalCases: _json.containsKey('additionalCases') |
| ? GoogleCloudDialogflowCxV3FulfillmentConditionalCases.fromJson( |
| _json['additionalCases'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| message: _json.containsKey('message') |
| ? GoogleCloudDialogflowCxV3ResponseMessage.fromJson( |
| _json['message'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (additionalCases != null) |
| 'additionalCases': additionalCases!.toJson(), |
| if (message != null) 'message': message!.toJson(), |
| }; |
| } |
| |
| /// Setting a parameter value. |
| class GoogleCloudDialogflowCxV3FulfillmentSetParameterAction { |
| /// Display name of the parameter. |
| core.String? parameter; |
| |
| /// The new value of the parameter. |
| /// |
| /// A null value clears the parameter. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Object? value; |
| |
| GoogleCloudDialogflowCxV3FulfillmentSetParameterAction({ |
| this.parameter, |
| this.value, |
| }); |
| |
| GoogleCloudDialogflowCxV3FulfillmentSetParameterAction.fromJson( |
| core.Map _json) |
| : this( |
| parameter: _json.containsKey('parameter') |
| ? _json['parameter'] as core.String |
| : null, |
| value: |
| _json.containsKey('value') ? _json['value'] as core.Object : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (parameter != null) 'parameter': parameter!, |
| if (value != null) 'value': value!, |
| }; |
| } |
| |
| /// Metadata in google::longrunning::Operation for Knowledge operations. |
| class GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata { |
| /// The current state of this operation. |
| /// |
| /// Required. Output only. |
| /// Possible string values are: |
| /// - "STATE_UNSPECIFIED" : State unspecified. |
| /// - "PENDING" : The operation has been created. |
| /// - "RUNNING" : The operation is currently running. |
| /// - "DONE" : The operation is done, either cancelled or completed. |
| core.String? state; |
| |
| GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata({ |
| this.state, |
| }); |
| |
| GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata.fromJson( |
| core.Map _json) |
| : this( |
| state: |
| _json.containsKey('state') ? _json['state'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (state != null) 'state': state!, |
| }; |
| } |
| |
| /// Metadata for ImportDocuments operation. |
| class GoogleCloudDialogflowCxV3ImportDocumentsOperationMetadata { |
| /// The generic information of the operation. |
| GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata? genericMetadata; |
| |
| GoogleCloudDialogflowCxV3ImportDocumentsOperationMetadata({ |
| this.genericMetadata, |
| }); |
| |
| GoogleCloudDialogflowCxV3ImportDocumentsOperationMetadata.fromJson( |
| core.Map _json) |
| : this( |
| genericMetadata: _json.containsKey('genericMetadata') |
| ? GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata |
| .fromJson(_json['genericMetadata'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (genericMetadata != null) |
| 'genericMetadata': genericMetadata!.toJson(), |
| }; |
| } |
| |
| /// Response message for Documents.ImportDocuments. |
| class GoogleCloudDialogflowCxV3ImportDocumentsResponse { |
| /// Includes details about skipped documents or any other warnings. |
| core.List<GoogleRpcStatus>? warnings; |
| |
| GoogleCloudDialogflowCxV3ImportDocumentsResponse({ |
| this.warnings, |
| }); |
| |
| GoogleCloudDialogflowCxV3ImportDocumentsResponse.fromJson(core.Map _json) |
| : this( |
| warnings: _json.containsKey('warnings') |
| ? (_json['warnings'] as core.List) |
| .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (warnings != null) |
| 'warnings': warnings!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// The response message for Flows.ImportFlow. |
| class GoogleCloudDialogflowCxV3ImportFlowResponse { |
| /// The unique identifier of the new flow. |
| /// |
| /// Format: `projects//locations//agents//flows/`. |
| core.String? flow; |
| |
| GoogleCloudDialogflowCxV3ImportFlowResponse({ |
| this.flow, |
| }); |
| |
| GoogleCloudDialogflowCxV3ImportFlowResponse.fromJson(core.Map _json) |
| : this( |
| flow: _json.containsKey('flow') ? _json['flow'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (flow != null) 'flow': flow!, |
| }; |
| } |
| |
| /// Metadata returned for the TestCases.ImportTestCases long running operation. |
| class GoogleCloudDialogflowCxV3ImportTestCasesMetadata { |
| /// Errors for failed test cases. |
| core.List<GoogleCloudDialogflowCxV3TestCaseError>? errors; |
| |
| GoogleCloudDialogflowCxV3ImportTestCasesMetadata({ |
| this.errors, |
| }); |
| |
| GoogleCloudDialogflowCxV3ImportTestCasesMetadata.fromJson(core.Map _json) |
| : this( |
| errors: _json.containsKey('errors') |
| ? (_json['errors'] as core.List) |
| .map<GoogleCloudDialogflowCxV3TestCaseError>((value) => |
| GoogleCloudDialogflowCxV3TestCaseError.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (errors != null) |
| 'errors': errors!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// The response message for TestCases.ImportTestCases. |
| class GoogleCloudDialogflowCxV3ImportTestCasesResponse { |
| /// The unique identifiers of the new test cases. |
| /// |
| /// Format: `projects//locations//agents//testCases/`. |
| core.List<core.String>? names; |
| |
| GoogleCloudDialogflowCxV3ImportTestCasesResponse({ |
| this.names, |
| }); |
| |
| GoogleCloudDialogflowCxV3ImportTestCasesResponse.fromJson(core.Map _json) |
| : this( |
| names: _json.containsKey('names') |
| ? (_json['names'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (names != null) 'names': names!, |
| }; |
| } |
| |
| /// Instructs the speech recognizer on how to process the audio content. |
| class GoogleCloudDialogflowCxV3InputAudioConfig { |
| /// Audio encoding of the audio content to process. |
| /// |
| /// Required. |
| /// Possible string values are: |
| /// - "AUDIO_ENCODING_UNSPECIFIED" : Not specified. |
| /// - "AUDIO_ENCODING_LINEAR_16" : Uncompressed 16-bit signed little-endian |
| /// samples (Linear PCM). |
| /// - "AUDIO_ENCODING_FLAC" : |
| /// \[`FLAC`\](https://xiph.org/flac/documentation.html) (Free Lossless Audio |
| /// Codec) is the recommended encoding because it is lossless (therefore |
| /// recognition is not compromised) and requires only about half the bandwidth |
| /// of `LINEAR16`. `FLAC` stream encoding supports 16-bit and 24-bit samples, |
| /// however, not all fields in `STREAMINFO` are supported. |
| /// - "AUDIO_ENCODING_MULAW" : 8-bit samples that compand 14-bit audio samples |
| /// using G.711 PCMU/mu-law. |
| /// - "AUDIO_ENCODING_AMR" : Adaptive Multi-Rate Narrowband codec. |
| /// `sample_rate_hertz` must be 8000. |
| /// - "AUDIO_ENCODING_AMR_WB" : Adaptive Multi-Rate Wideband codec. |
| /// `sample_rate_hertz` must be 16000. |
| /// - "AUDIO_ENCODING_OGG_OPUS" : Opus encoded audio frames in Ogg container |
| /// ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be |
| /// 16000. |
| /// - "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE" : Although the use of lossy |
| /// encodings is not recommended, if a very low bitrate encoding is required, |
| /// `OGG_OPUS` is highly preferred over Speex encoding. The |
| /// [Speex](https://speex.org/) encoding supported by Dialogflow API has a |
| /// header byte in each block, as in MIME type |
| /// `audio/x-speex-with-header-byte`. It is a variant of the RTP Speex |
| /// encoding defined in [RFC 5574](https://tools.ietf.org/html/rfc5574). The |
| /// stream is a sequence of blocks, one block per RTP packet. Each block |
| /// starts with a byte containing the length of the block, in bytes, followed |
| /// by one or more frames of Speex data, padded to an integral number of bytes |
| /// (octets) as specified in RFC 5574. In other words, each RTP header is |
| /// replaced with a single byte containing the block length. Only Speex |
| /// wideband is supported. `sample_rate_hertz` must be 16000. |
| core.String? audioEncoding; |
| |
| /// If `true`, Dialogflow returns SpeechWordInfo in StreamingRecognitionResult |
| /// with information about the recognized speech words, e.g. start and end |
| /// time offsets. |
| /// |
| /// If false or unspecified, Speech doesn't return any word-level information. |
| /// |
| /// Optional. |
| core.bool? enableWordInfo; |
| |
| /// Which Speech model to select for the given request. |
| /// |
| /// Select the model best suited to your domain to get best results. If a |
| /// model is not explicitly specified, then we auto-select a model based on |
| /// the parameters in the InputAudioConfig. If enhanced speech model is |
| /// enabled for the agent and an enhanced version of the specified model for |
| /// the language does not exist, then the speech is recognized using the |
| /// standard version of the specified model. Refer to |
| /// [Cloud Speech API documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) |
| /// for more details. |
| /// |
| /// Optional. |
| core.String? model; |
| |
| /// Which variant of the Speech model to use. |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "SPEECH_MODEL_VARIANT_UNSPECIFIED" : No model variant specified. In this |
| /// case Dialogflow defaults to USE_BEST_AVAILABLE. |
| /// - "USE_BEST_AVAILABLE" : Use the best available variant of the Speech |
| /// model that the caller is eligible for. Please see the |
| /// [Dialogflow docs](https://cloud.google.com/dialogflow/docs/data-logging) |
| /// for how to make your project eligible for enhanced models. |
| /// - "USE_STANDARD" : Use standard model variant even if an enhanced model is |
| /// available. See the |
| /// [Cloud Speech documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) |
| /// for details about enhanced models. |
| /// - "USE_ENHANCED" : Use an enhanced model variant: * If an enhanced variant |
| /// does not exist for the given model and request language, Dialogflow falls |
| /// back to the standard variant. The |
| /// [Cloud Speech documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) |
| /// describes which models have enhanced variants. * If the API caller isn't |
| /// eligible for enhanced models, Dialogflow returns an error. Please see the |
| /// [Dialogflow docs](https://cloud.google.com/dialogflow/docs/data-logging) |
| /// for how to make your project eligible. |
| core.String? modelVariant; |
| |
| /// A list of strings containing words and phrases that the speech recognizer |
| /// should recognize with higher likelihood. |
| /// |
| /// See |
| /// [the Cloud Speech documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) |
| /// for more details. |
| /// |
| /// Optional. |
| core.List<core.String>? phraseHints; |
| |
| /// Sample rate (in Hertz) of the audio content sent in the query. |
| /// |
| /// Refer to |
| /// [Cloud Speech API documentation](https://cloud.google.com/speech-to-text/docs/basics) |
| /// for more details. |
| core.int? sampleRateHertz; |
| |
| /// If `false` (default), recognition does not cease until the client closes |
| /// the stream. |
| /// |
| /// If `true`, the recognizer will detect a single spoken utterance in input |
| /// audio. Recognition ceases when it detects the audio's voice has stopped or |
| /// paused. In this case, once a detected intent is received, the client |
| /// should close the stream and start a new request with a new stream as |
| /// needed. Note: This setting is relevant only for streaming methods. |
| /// |
| /// Optional. |
| core.bool? singleUtterance; |
| |
| GoogleCloudDialogflowCxV3InputAudioConfig({ |
| this.audioEncoding, |
| this.enableWordInfo, |
| this.model, |
| this.modelVariant, |
| this.phraseHints, |
| this.sampleRateHertz, |
| this.singleUtterance, |
| }); |
| |
| GoogleCloudDialogflowCxV3InputAudioConfig.fromJson(core.Map _json) |
| : this( |
| audioEncoding: _json.containsKey('audioEncoding') |
| ? _json['audioEncoding'] as core.String |
| : null, |
| enableWordInfo: _json.containsKey('enableWordInfo') |
| ? _json['enableWordInfo'] as core.bool |
| : null, |
| model: |
| _json.containsKey('model') ? _json['model'] as core.String : null, |
| modelVariant: _json.containsKey('modelVariant') |
| ? _json['modelVariant'] as core.String |
| : null, |
| phraseHints: _json.containsKey('phraseHints') |
| ? (_json['phraseHints'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| sampleRateHertz: _json.containsKey('sampleRateHertz') |
| ? _json['sampleRateHertz'] as core.int |
| : null, |
| singleUtterance: _json.containsKey('singleUtterance') |
| ? _json['singleUtterance'] as core.bool |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (audioEncoding != null) 'audioEncoding': audioEncoding!, |
| if (enableWordInfo != null) 'enableWordInfo': enableWordInfo!, |
| if (model != null) 'model': model!, |
| if (modelVariant != null) 'modelVariant': modelVariant!, |
| if (phraseHints != null) 'phraseHints': phraseHints!, |
| if (sampleRateHertz != null) 'sampleRateHertz': sampleRateHertz!, |
| if (singleUtterance != null) 'singleUtterance': singleUtterance!, |
| }; |
| } |
| |
| /// An intent represents a user's intent to interact with a conversational |
| /// agent. |
| /// |
| /// You can provide information for the Dialogflow API to use to match user |
| /// input to an intent by adding training phrases (i.e., examples of user input) |
| /// to your intent. |
| class GoogleCloudDialogflowCxV3Intent { |
| /// Human readable description for better understanding an intent like its |
| /// scope, content, result etc. |
| /// |
| /// Maximum character limit: 140 characters. |
| core.String? description; |
| |
| /// The human-readable name of the intent, unique within the agent. |
| /// |
| /// Required. |
| core.String? displayName; |
| |
| /// Indicates whether this is a fallback intent. |
| /// |
| /// Currently only default fallback intent is allowed in the agent, which is |
| /// added upon agent creation. Adding training phrases to fallback intent is |
| /// useful in the case of requests that are mistakenly matched, since training |
| /// phrases assigned to fallback intents act as negative examples that |
| /// triggers no-match event. |
| core.bool? isFallback; |
| |
| /// The key/value metadata to label an intent. |
| /// |
| /// Labels can contain lowercase letters, digits and the symbols '-' and '_'. |
| /// International characters are allowed, including letters from unicase |
| /// alphabets. Keys must start with a letter. Keys and values can be no longer |
| /// than 63 characters and no more than 128 bytes. Prefix "sys-" is reserved |
| /// for Dialogflow defined labels. Currently allowed Dialogflow defined labels |
| /// include: * sys-head * sys-contextual The above labels do not require |
| /// value. "sys-head" means the intent is a head intent. "sys.contextual" |
| /// means the intent is a contextual intent. |
| core.Map<core.String, core.String>? labels; |
| |
| /// The unique identifier of the intent. |
| /// |
| /// Required for the Intents.UpdateIntent method. Intents.CreateIntent |
| /// populates the name automatically. Format: |
| /// `projects//locations//agents//intents/`. |
| core.String? name; |
| |
| /// The collection of parameters associated with the intent. |
| core.List<GoogleCloudDialogflowCxV3IntentParameter>? parameters; |
| |
| /// The priority of this intent. |
| /// |
| /// Higher numbers represent higher priorities. - If the supplied value is |
| /// unspecified or 0, the service translates the value to 500,000, which |
| /// corresponds to the `Normal` priority in the console. - If the supplied |
| /// value is negative, the intent is ignored in runtime detect intent |
| /// requests. |
| core.int? priority; |
| |
| /// The collection of training phrases the agent is trained on to identify the |
| /// intent. |
| core.List<GoogleCloudDialogflowCxV3IntentTrainingPhrase>? trainingPhrases; |
| |
| GoogleCloudDialogflowCxV3Intent({ |
| this.description, |
| this.displayName, |
| this.isFallback, |
| this.labels, |
| this.name, |
| this.parameters, |
| this.priority, |
| this.trainingPhrases, |
| }); |
| |
| GoogleCloudDialogflowCxV3Intent.fromJson(core.Map _json) |
| : this( |
| description: _json.containsKey('description') |
| ? _json['description'] as core.String |
| : null, |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| isFallback: _json.containsKey('isFallback') |
| ? _json['isFallback'] as core.bool |
| : null, |
| labels: _json.containsKey('labels') |
| ? (_json['labels'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.String, |
| ), |
| ) |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| parameters: _json.containsKey('parameters') |
| ? (_json['parameters'] as core.List) |
| .map<GoogleCloudDialogflowCxV3IntentParameter>((value) => |
| GoogleCloudDialogflowCxV3IntentParameter.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| priority: _json.containsKey('priority') |
| ? _json['priority'] as core.int |
| : null, |
| trainingPhrases: _json.containsKey('trainingPhrases') |
| ? (_json['trainingPhrases'] as core.List) |
| .map<GoogleCloudDialogflowCxV3IntentTrainingPhrase>((value) => |
| GoogleCloudDialogflowCxV3IntentTrainingPhrase.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (description != null) 'description': description!, |
| if (displayName != null) 'displayName': displayName!, |
| if (isFallback != null) 'isFallback': isFallback!, |
| if (labels != null) 'labels': labels!, |
| if (name != null) 'name': name!, |
| if (parameters != null) |
| 'parameters': parameters!.map((value) => value.toJson()).toList(), |
| if (priority != null) 'priority': priority!, |
| if (trainingPhrases != null) |
| 'trainingPhrases': |
| trainingPhrases!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Represents the intent to trigger programmatically rather than as a result of |
| /// natural language processing. |
| class GoogleCloudDialogflowCxV3IntentInput { |
| /// The unique identifier of the intent. |
| /// |
| /// Format: `projects//locations//agents//intents/`. |
| /// |
| /// Required. |
| core.String? intent; |
| |
| GoogleCloudDialogflowCxV3IntentInput({ |
| this.intent, |
| }); |
| |
| GoogleCloudDialogflowCxV3IntentInput.fromJson(core.Map _json) |
| : this( |
| intent: _json.containsKey('intent') |
| ? _json['intent'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (intent != null) 'intent': intent!, |
| }; |
| } |
| |
| /// Represents an intent parameter. |
| class GoogleCloudDialogflowCxV3IntentParameter { |
| /// The entity type of the parameter. |
| /// |
| /// Format: `projects/-/locations/-/agents/-/entityTypes/` for system entity |
| /// types (for example, |
| /// `projects/-/locations/-/agents/-/entityTypes/sys.date`), or |
| /// `projects//locations//agents//entityTypes/` for developer entity types. |
| /// |
| /// Required. |
| core.String? entityType; |
| |
| /// The unique identifier of the parameter. |
| /// |
| /// This field is used by training phrases to annotate their parts. |
| /// |
| /// Required. |
| core.String? id; |
| |
| /// Indicates whether the parameter represents a list of values. |
| core.bool? isList; |
| |
| /// Indicates whether the parameter content should be redacted in log. |
| /// |
| /// If redaction is enabled, the parameter content will be replaced by |
| /// parameter name during logging. Note: the parameter content is subject to |
| /// redaction if either parameter level redaction or entity type level |
| /// redaction is enabled. |
| core.bool? redact; |
| |
| GoogleCloudDialogflowCxV3IntentParameter({ |
| this.entityType, |
| this.id, |
| this.isList, |
| this.redact, |
| }); |
| |
| GoogleCloudDialogflowCxV3IntentParameter.fromJson(core.Map _json) |
| : this( |
| entityType: _json.containsKey('entityType') |
| ? _json['entityType'] as core.String |
| : null, |
| id: _json.containsKey('id') ? _json['id'] as core.String : null, |
| isList: |
| _json.containsKey('isList') ? _json['isList'] as core.bool : null, |
| redact: |
| _json.containsKey('redact') ? _json['redact'] as core.bool : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (entityType != null) 'entityType': entityType!, |
| if (id != null) 'id': id!, |
| if (isList != null) 'isList': isList!, |
| if (redact != null) 'redact': redact!, |
| }; |
| } |
| |
| /// Represents an example that the agent is trained on to identify the intent. |
| class GoogleCloudDialogflowCxV3IntentTrainingPhrase { |
| /// The unique identifier of the training phrase. |
| /// |
| /// Output only. |
| core.String? id; |
| |
| /// The ordered list of training phrase parts. |
| /// |
| /// The parts are concatenated in order to form the training phrase. Note: The |
| /// API does not automatically annotate training phrases like the Dialogflow |
| /// Console does. Note: Do not forget to include whitespace at part |
| /// boundaries, so the training phrase is well formatted when the parts are |
| /// concatenated. If the training phrase does not need to be annotated with |
| /// parameters, you just need a single part with only the Part.text field set. |
| /// If you want to annotate the training phrase, you must create multiple |
| /// parts, where the fields of each part are populated in one of two ways: - |
| /// `Part.text` is set to a part of the phrase that has no parameters. - |
| /// `Part.text` is set to a part of the phrase that you want to annotate, and |
| /// the `parameter_id` field is set. |
| /// |
| /// Required. |
| core.List<GoogleCloudDialogflowCxV3IntentTrainingPhrasePart>? parts; |
| |
| /// Indicates how many times this example was added to the intent. |
| core.int? repeatCount; |
| |
| GoogleCloudDialogflowCxV3IntentTrainingPhrase({ |
| this.id, |
| this.parts, |
| this.repeatCount, |
| }); |
| |
| GoogleCloudDialogflowCxV3IntentTrainingPhrase.fromJson(core.Map _json) |
| : this( |
| id: _json.containsKey('id') ? _json['id'] as core.String : null, |
| parts: _json.containsKey('parts') |
| ? (_json['parts'] as core.List) |
| .map<GoogleCloudDialogflowCxV3IntentTrainingPhrasePart>( |
| (value) => |
| GoogleCloudDialogflowCxV3IntentTrainingPhrasePart |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| repeatCount: _json.containsKey('repeatCount') |
| ? _json['repeatCount'] as core.int |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (id != null) 'id': id!, |
| if (parts != null) |
| 'parts': parts!.map((value) => value.toJson()).toList(), |
| if (repeatCount != null) 'repeatCount': repeatCount!, |
| }; |
| } |
| |
| /// Represents a part of a training phrase. |
| class GoogleCloudDialogflowCxV3IntentTrainingPhrasePart { |
| /// The parameter used to annotate this part of the training phrase. |
| /// |
| /// This field is required for annotated parts of the training phrase. |
| core.String? parameterId; |
| |
| /// The text for this part. |
| /// |
| /// Required. |
| core.String? text; |
| |
| GoogleCloudDialogflowCxV3IntentTrainingPhrasePart({ |
| this.parameterId, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowCxV3IntentTrainingPhrasePart.fromJson(core.Map _json) |
| : this( |
| parameterId: _json.containsKey('parameterId') |
| ? _json['parameterId'] as core.String |
| : null, |
| text: _json.containsKey('text') ? _json['text'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (parameterId != null) 'parameterId': parameterId!, |
| if (text != null) 'text': text!, |
| }; |
| } |
| |
| /// A Dialogflow CX conversation (session) can be described and visualized as a |
| /// state machine. |
| /// |
| /// The states of a CX session are represented by pages. For each flow, you |
| /// define many pages, where your combined pages can handle a complete |
| /// conversation on the topics the flow is designed for. At any given moment, |
| /// exactly one page is the current page, the current page is considered active, |
| /// and the flow associated with that page is considered active. Every flow has |
| /// a special start page. When a flow initially becomes active, the start page |
| /// page becomes the current page. For each conversational turn, the current |
| /// page will either stay the same or transition to another page. You configure |
| /// each page to collect information from the end-user that is relevant for the |
| /// conversational state represented by the page. For more information, see the |
| /// [Page guide](https://cloud.google.com/dialogflow/cx/docs/concept/page). |
| class GoogleCloudDialogflowCxV3Page { |
| /// The human-readable name of the page, unique within the agent. |
| /// |
| /// Required. |
| core.String? displayName; |
| |
| /// The fulfillment to call when the session is entering the page. |
| GoogleCloudDialogflowCxV3Fulfillment? entryFulfillment; |
| |
| /// Handlers associated with the page to handle events such as webhook errors, |
| /// no match or no input. |
| core.List<GoogleCloudDialogflowCxV3EventHandler>? eventHandlers; |
| |
| /// The form associated with the page, used for collecting parameters relevant |
| /// to the page. |
| GoogleCloudDialogflowCxV3Form? form; |
| |
| /// The unique identifier of the page. |
| /// |
| /// Required for the Pages.UpdatePage method. Pages.CreatePage populates the |
| /// name automatically. Format: `projects//locations//agents//flows//pages/`. |
| core.String? name; |
| |
| /// Ordered list of `TransitionRouteGroups` associated with the page. |
| /// |
| /// Transition route groups must be unique within a page. * If multiple |
| /// transition routes within a page scope refer to the same intent, then the |
| /// precedence order is: page's transition route -> page's transition route |
| /// group -> flow's transition routes. * If multiple transition route groups |
| /// within a page contain the same intent, then the first group in the ordered |
| /// list takes precedence. |
| /// Format:`projects//locations//agents//flows//transitionRouteGroups/`. |
| core.List<core.String>? transitionRouteGroups; |
| |
| /// A list of transitions for the transition rules of this page. |
| /// |
| /// They route the conversation to another page in the same flow, or another |
| /// flow. When we are in a certain page, the TransitionRoutes are evalauted in |
| /// the following order: * TransitionRoutes defined in the page with intent |
| /// specified. * TransitionRoutes defined in the transition route groups with |
| /// intent specified. * TransitionRoutes defined in flow with intent |
| /// specified. * TransitionRoutes defined in the transition route groups with |
| /// intent specified. * TransitionRoutes defined in the page with only |
| /// condition specified. * TransitionRoutes defined in the transition route |
| /// groups with only condition specified. |
| core.List<GoogleCloudDialogflowCxV3TransitionRoute>? transitionRoutes; |
| |
| GoogleCloudDialogflowCxV3Page({ |
| this.displayName, |
| this.entryFulfillment, |
| this.eventHandlers, |
| this.form, |
| this.name, |
| this.transitionRouteGroups, |
| this.transitionRoutes, |
| }); |
| |
| GoogleCloudDialogflowCxV3Page.fromJson(core.Map _json) |
| : this( |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| entryFulfillment: _json.containsKey('entryFulfillment') |
| ? GoogleCloudDialogflowCxV3Fulfillment.fromJson( |
| _json['entryFulfillment'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| eventHandlers: _json.containsKey('eventHandlers') |
| ? (_json['eventHandlers'] as core.List) |
| .map<GoogleCloudDialogflowCxV3EventHandler>((value) => |
| GoogleCloudDialogflowCxV3EventHandler.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| form: _json.containsKey('form') |
| ? GoogleCloudDialogflowCxV3Form.fromJson( |
| _json['form'] as core.Map<core.String, core.dynamic>) |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| transitionRouteGroups: _json.containsKey('transitionRouteGroups') |
| ? (_json['transitionRouteGroups'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| transitionRoutes: _json.containsKey('transitionRoutes') |
| ? (_json['transitionRoutes'] as core.List) |
| .map<GoogleCloudDialogflowCxV3TransitionRoute>((value) => |
| GoogleCloudDialogflowCxV3TransitionRoute.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (displayName != null) 'displayName': displayName!, |
| if (entryFulfillment != null) |
| 'entryFulfillment': entryFulfillment!.toJson(), |
| if (eventHandlers != null) |
| 'eventHandlers': |
| eventHandlers!.map((value) => value.toJson()).toList(), |
| if (form != null) 'form': form!.toJson(), |
| if (name != null) 'name': name!, |
| if (transitionRouteGroups != null) |
| 'transitionRouteGroups': transitionRouteGroups!, |
| if (transitionRoutes != null) |
| 'transitionRoutes': |
| transitionRoutes!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Represents page information communicated to and from the webhook. |
| class GoogleCloudDialogflowCxV3PageInfo { |
| /// Always present for WebhookRequest. |
| /// |
| /// Ignored for WebhookResponse. The unique identifier of the current page. |
| /// Format: `projects//locations//agents//flows//pages/`. |
| core.String? currentPage; |
| |
| /// Optional for both WebhookRequest and WebhookResponse. |
| /// |
| /// Information about the form. |
| GoogleCloudDialogflowCxV3PageInfoFormInfo? formInfo; |
| |
| GoogleCloudDialogflowCxV3PageInfo({ |
| this.currentPage, |
| this.formInfo, |
| }); |
| |
| GoogleCloudDialogflowCxV3PageInfo.fromJson(core.Map _json) |
| : this( |
| currentPage: _json.containsKey('currentPage') |
| ? _json['currentPage'] as core.String |
| : null, |
| formInfo: _json.containsKey('formInfo') |
| ? GoogleCloudDialogflowCxV3PageInfoFormInfo.fromJson( |
| _json['formInfo'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (currentPage != null) 'currentPage': currentPage!, |
| if (formInfo != null) 'formInfo': formInfo!.toJson(), |
| }; |
| } |
| |
| /// Represents form information. |
| class GoogleCloudDialogflowCxV3PageInfoFormInfo { |
| /// Optional for both WebhookRequest and WebhookResponse. |
| /// |
| /// The parameters contained in the form. Note that the webhook cannot add or |
| /// remove any form parameter. |
| core.List<GoogleCloudDialogflowCxV3PageInfoFormInfoParameterInfo>? |
| parameterInfo; |
| |
| GoogleCloudDialogflowCxV3PageInfoFormInfo({ |
| this.parameterInfo, |
| }); |
| |
| GoogleCloudDialogflowCxV3PageInfoFormInfo.fromJson(core.Map _json) |
| : this( |
| parameterInfo: _json.containsKey('parameterInfo') |
| ? (_json['parameterInfo'] as core.List) |
| .map<GoogleCloudDialogflowCxV3PageInfoFormInfoParameterInfo>( |
| (value) => |
| GoogleCloudDialogflowCxV3PageInfoFormInfoParameterInfo |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (parameterInfo != null) |
| 'parameterInfo': |
| parameterInfo!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Represents parameter information. |
| class GoogleCloudDialogflowCxV3PageInfoFormInfoParameterInfo { |
| /// Always present for WebhookRequest. |
| /// |
| /// Required for WebhookResponse. The human-readable name of the parameter, |
| /// unique within the form. This field cannot be modified by the webhook. |
| core.String? displayName; |
| |
| /// Optional for WebhookRequest. |
| /// |
| /// Ignored for WebhookResponse. Indicates if the parameter value was just |
| /// collected on the last conversation turn. |
| core.bool? justCollected; |
| |
| /// Optional for both WebhookRequest and WebhookResponse. |
| /// |
| /// Indicates whether the parameter is required. Optional parameters will not |
| /// trigger prompts; however, they are filled if the user specifies them. |
| /// Required parameters must be filled before form filling concludes. |
| core.bool? required; |
| |
| /// Always present for WebhookRequest. |
| /// |
| /// Required for WebhookResponse. The state of the parameter. This field can |
| /// be set to INVALID by the webhook to invalidate the parameter; other values |
| /// set by the webhook will be ignored. |
| /// Possible string values are: |
| /// - "PARAMETER_STATE_UNSPECIFIED" : Not specified. This value should be |
| /// never used. |
| /// - "EMPTY" : Indicates that the parameter does not have a value. |
| /// - "INVALID" : Indicates that the parameter value is invalid. This field |
| /// can be used by the webhook to invalidate the parameter and ask the server |
| /// to collect it from the user again. |
| /// - "FILLED" : Indicates that the parameter has a value. |
| core.String? state; |
| |
| /// Optional for both WebhookRequest and WebhookResponse. |
| /// |
| /// The value of the parameter. This field can be set by the webhook to change |
| /// the parameter value. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Object? value; |
| |
| GoogleCloudDialogflowCxV3PageInfoFormInfoParameterInfo({ |
| this.displayName, |
| this.justCollected, |
| this.required, |
| this.state, |
| this.value, |
| }); |
| |
| GoogleCloudDialogflowCxV3PageInfoFormInfoParameterInfo.fromJson( |
| core.Map _json) |
| : this( |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| justCollected: _json.containsKey('justCollected') |
| ? _json['justCollected'] as core.bool |
| : null, |
| required: _json.containsKey('required') |
| ? _json['required'] as core.bool |
| : null, |
| state: |
| _json.containsKey('state') ? _json['state'] as core.String : null, |
| value: |
| _json.containsKey('value') ? _json['value'] as core.Object : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (displayName != null) 'displayName': displayName!, |
| if (justCollected != null) 'justCollected': justCollected!, |
| if (required != null) 'required': required!, |
| if (state != null) 'state': state!, |
| if (value != null) 'value': value!, |
| }; |
| } |
| |
| /// Represents the query input. |
| /// |
| /// It can contain one of: 1. A conversational query in the form of text. 2. An |
| /// intent query that specifies which intent to trigger. 3. Natural language |
| /// speech audio to be processed. 4. An event to be triggered. |
| class GoogleCloudDialogflowCxV3QueryInput { |
| /// The natural language speech audio to be processed. |
| GoogleCloudDialogflowCxV3AudioInput? audio; |
| |
| /// The DTMF event to be handled. |
| GoogleCloudDialogflowCxV3DtmfInput? dtmf; |
| |
| /// The event to be triggered. |
| GoogleCloudDialogflowCxV3EventInput? event; |
| |
| /// The intent to be triggered. |
| GoogleCloudDialogflowCxV3IntentInput? intent; |
| |
| /// The language of the input. |
| /// |
| /// See |
| /// [Language Support](https://cloud.google.com/dialogflow/cx/docs/reference/language) |
| /// for a list of the currently supported language codes. Note that queries in |
| /// the same session do not necessarily need to specify the same language. |
| /// |
| /// Required. |
| core.String? languageCode; |
| |
| /// The natural language text to be processed. |
| GoogleCloudDialogflowCxV3TextInput? text; |
| |
| GoogleCloudDialogflowCxV3QueryInput({ |
| this.audio, |
| this.dtmf, |
| this.event, |
| this.intent, |
| this.languageCode, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowCxV3QueryInput.fromJson(core.Map _json) |
| : this( |
| audio: _json.containsKey('audio') |
| ? GoogleCloudDialogflowCxV3AudioInput.fromJson( |
| _json['audio'] as core.Map<core.String, core.dynamic>) |
| : null, |
| dtmf: _json.containsKey('dtmf') |
| ? GoogleCloudDialogflowCxV3DtmfInput.fromJson( |
| _json['dtmf'] as core.Map<core.String, core.dynamic>) |
| : null, |
| event: _json.containsKey('event') |
| ? GoogleCloudDialogflowCxV3EventInput.fromJson( |
| _json['event'] as core.Map<core.String, core.dynamic>) |
| : null, |
| intent: _json.containsKey('intent') |
| ? GoogleCloudDialogflowCxV3IntentInput.fromJson( |
| _json['intent'] as core.Map<core.String, core.dynamic>) |
| : null, |
| languageCode: _json.containsKey('languageCode') |
| ? _json['languageCode'] as core.String |
| : null, |
| text: _json.containsKey('text') |
| ? GoogleCloudDialogflowCxV3TextInput.fromJson( |
| _json['text'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (audio != null) 'audio': audio!.toJson(), |
| if (dtmf != null) 'dtmf': dtmf!.toJson(), |
| if (event != null) 'event': event!.toJson(), |
| if (intent != null) 'intent': intent!.toJson(), |
| if (languageCode != null) 'languageCode': languageCode!, |
| if (text != null) 'text': text!.toJson(), |
| }; |
| } |
| |
| /// Metadata for ReloadDocument operation. |
| class GoogleCloudDialogflowCxV3ReloadDocumentOperationMetadata { |
| /// The generic information of the operation. |
| GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata? genericMetadata; |
| |
| GoogleCloudDialogflowCxV3ReloadDocumentOperationMetadata({ |
| this.genericMetadata, |
| }); |
| |
| GoogleCloudDialogflowCxV3ReloadDocumentOperationMetadata.fromJson( |
| core.Map _json) |
| : this( |
| genericMetadata: _json.containsKey('genericMetadata') |
| ? GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata |
| .fromJson(_json['genericMetadata'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (genericMetadata != null) |
| 'genericMetadata': genericMetadata!.toJson(), |
| }; |
| } |
| |
| /// Represents a response message that can be returned by a conversational |
| /// agent. |
| /// |
| /// Response messages are also used for output audio synthesis. The approach is |
| /// as follows: * If at least one OutputAudioText response is present, then all |
| /// OutputAudioText responses are linearly concatenated, and the result is used |
| /// for output audio synthesis. * If the OutputAudioText responses are a mixture |
| /// of text and SSML, then the concatenated result is treated as SSML; |
| /// otherwise, the result is treated as either text or SSML as appropriate. The |
| /// agent designer should ideally use either text or SSML consistently |
| /// throughout the bot design. * Otherwise, all Text responses are linearly |
| /// concatenated, and the result is used for output audio synthesis. This |
| /// approach allows for more sophisticated user experience scenarios, where the |
| /// text displayed to the user may differ from what is heard. |
| class GoogleCloudDialogflowCxV3ResponseMessage { |
| /// Indicates that the conversation succeeded. |
| GoogleCloudDialogflowCxV3ResponseMessageConversationSuccess? |
| conversationSuccess; |
| |
| /// A signal that indicates the interaction with the Dialogflow agent has |
| /// ended. |
| /// |
| /// This message is generated by Dialogflow only when the conversation reaches |
| /// `END_SESSION` page. It is not supposed to be defined by the user. It's |
| /// guaranteed that there is at most one such message in each response. |
| /// |
| /// Output only. |
| GoogleCloudDialogflowCxV3ResponseMessageEndInteraction? endInteraction; |
| |
| /// Hands off conversation to a human agent. |
| GoogleCloudDialogflowCxV3ResponseMessageLiveAgentHandoff? liveAgentHandoff; |
| |
| /// An audio response message composed of both the synthesized Dialogflow |
| /// agent responses and responses defined via play_audio. |
| /// |
| /// This message is generated by Dialogflow only and not supposed to be |
| /// defined by the user. |
| /// |
| /// Output only. |
| GoogleCloudDialogflowCxV3ResponseMessageMixedAudio? mixedAudio; |
| |
| /// A text or ssml response that is preferentially used for TTS output audio |
| /// synthesis, as described in the comment on the ResponseMessage message. |
| GoogleCloudDialogflowCxV3ResponseMessageOutputAudioText? outputAudioText; |
| |
| /// Returns a response containing a custom, platform-specific payload. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? payload; |
| |
| /// Signal that the client should play an audio clip hosted at a |
| /// client-specific URI. |
| /// |
| /// Dialogflow uses this to construct mixed_audio. However, Dialogflow itself |
| /// does not try to read or process the URI in any way. |
| GoogleCloudDialogflowCxV3ResponseMessagePlayAudio? playAudio; |
| |
| /// Returns a text response. |
| GoogleCloudDialogflowCxV3ResponseMessageText? text; |
| |
| GoogleCloudDialogflowCxV3ResponseMessage({ |
| this.conversationSuccess, |
| this.endInteraction, |
| this.liveAgentHandoff, |
| this.mixedAudio, |
| this.outputAudioText, |
| this.payload, |
| this.playAudio, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowCxV3ResponseMessage.fromJson(core.Map _json) |
| : this( |
| conversationSuccess: _json.containsKey('conversationSuccess') |
| ? GoogleCloudDialogflowCxV3ResponseMessageConversationSuccess |
| .fromJson(_json['conversationSuccess'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| endInteraction: _json.containsKey('endInteraction') |
| ? GoogleCloudDialogflowCxV3ResponseMessageEndInteraction.fromJson( |
| _json['endInteraction'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| liveAgentHandoff: _json.containsKey('liveAgentHandoff') |
| ? GoogleCloudDialogflowCxV3ResponseMessageLiveAgentHandoff |
| .fromJson(_json['liveAgentHandoff'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| mixedAudio: _json.containsKey('mixedAudio') |
| ? GoogleCloudDialogflowCxV3ResponseMessageMixedAudio.fromJson( |
| _json['mixedAudio'] as core.Map<core.String, core.dynamic>) |
| : null, |
| outputAudioText: _json.containsKey('outputAudioText') |
| ? GoogleCloudDialogflowCxV3ResponseMessageOutputAudioText |
| .fromJson(_json['outputAudioText'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| payload: _json.containsKey('payload') |
| ? (_json['payload'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| playAudio: _json.containsKey('playAudio') |
| ? GoogleCloudDialogflowCxV3ResponseMessagePlayAudio.fromJson( |
| _json['playAudio'] as core.Map<core.String, core.dynamic>) |
| : null, |
| text: _json.containsKey('text') |
| ? GoogleCloudDialogflowCxV3ResponseMessageText.fromJson( |
| _json['text'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (conversationSuccess != null) |
| 'conversationSuccess': conversationSuccess!.toJson(), |
| if (endInteraction != null) 'endInteraction': endInteraction!.toJson(), |
| if (liveAgentHandoff != null) |
| 'liveAgentHandoff': liveAgentHandoff!.toJson(), |
| if (mixedAudio != null) 'mixedAudio': mixedAudio!.toJson(), |
| if (outputAudioText != null) |
| 'outputAudioText': outputAudioText!.toJson(), |
| if (payload != null) 'payload': payload!, |
| if (playAudio != null) 'playAudio': playAudio!.toJson(), |
| if (text != null) 'text': text!.toJson(), |
| }; |
| } |
| |
| /// Indicates that the conversation succeeded, i.e., the bot handled the issue |
| /// that the customer talked to it about. |
| /// |
| /// Dialogflow only uses this to determine which conversations should be counted |
| /// as successful and doesn't process the metadata in this message in any way. |
| /// Note that Dialogflow also considers conversations that get to the |
| /// conversation end page as successful even if they don't return |
| /// ConversationSuccess. You may set this, for example: * In the |
| /// entry_fulfillment of a Page if entering the page indicates that the |
| /// conversation succeeded. * In a webhook response when you determine that you |
| /// handled the customer issue. |
| class GoogleCloudDialogflowCxV3ResponseMessageConversationSuccess { |
| /// Custom metadata. |
| /// |
| /// Dialogflow doesn't impose any structure on this. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? metadata; |
| |
| GoogleCloudDialogflowCxV3ResponseMessageConversationSuccess({ |
| this.metadata, |
| }); |
| |
| GoogleCloudDialogflowCxV3ResponseMessageConversationSuccess.fromJson( |
| core.Map _json) |
| : this( |
| metadata: _json.containsKey('metadata') |
| ? (_json['metadata'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (metadata != null) 'metadata': metadata!, |
| }; |
| } |
| |
| /// Indicates that interaction with the Dialogflow agent has ended. |
| /// |
| /// This message is generated by Dialogflow only and not supposed to be defined |
| /// by the user. |
| class GoogleCloudDialogflowCxV3ResponseMessageEndInteraction { |
| GoogleCloudDialogflowCxV3ResponseMessageEndInteraction(); |
| |
| GoogleCloudDialogflowCxV3ResponseMessageEndInteraction.fromJson( |
| // ignore: avoid_unused_constructor_parameters |
| core.Map _json); |
| |
| core.Map<core.String, core.dynamic> toJson() => {}; |
| } |
| |
| /// Indicates that the conversation should be handed off to a live agent. |
| /// |
| /// Dialogflow only uses this to determine which conversations were handed off |
| /// to a human agent for measurement purposes. What else to do with this signal |
| /// is up to you and your handoff procedures. You may set this, for example: * |
| /// In the entry_fulfillment of a Page if entering the page indicates something |
| /// went extremely wrong in the conversation. * In a webhook response when you |
| /// determine that the customer issue can only be handled by a human. |
| class GoogleCloudDialogflowCxV3ResponseMessageLiveAgentHandoff { |
| /// Custom metadata for your handoff procedure. |
| /// |
| /// Dialogflow doesn't impose any structure on this. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? metadata; |
| |
| GoogleCloudDialogflowCxV3ResponseMessageLiveAgentHandoff({ |
| this.metadata, |
| }); |
| |
| GoogleCloudDialogflowCxV3ResponseMessageLiveAgentHandoff.fromJson( |
| core.Map _json) |
| : this( |
| metadata: _json.containsKey('metadata') |
| ? (_json['metadata'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (metadata != null) 'metadata': metadata!, |
| }; |
| } |
| |
| /// Represents an audio message that is composed of both segments synthesized |
| /// from the Dialogflow agent prompts and ones hosted externally at the |
| /// specified URIs. |
| /// |
| /// The external URIs are specified via play_audio. This message is generated by |
| /// Dialogflow only and not supposed to be defined by the user. |
| class GoogleCloudDialogflowCxV3ResponseMessageMixedAudio { |
| /// Segments this audio response is composed of. |
| core.List<GoogleCloudDialogflowCxV3ResponseMessageMixedAudioSegment>? |
| segments; |
| |
| GoogleCloudDialogflowCxV3ResponseMessageMixedAudio({ |
| this.segments, |
| }); |
| |
| GoogleCloudDialogflowCxV3ResponseMessageMixedAudio.fromJson(core.Map _json) |
| : this( |
| segments: _json.containsKey('segments') |
| ? (_json['segments'] as core.List) |
| .map<GoogleCloudDialogflowCxV3ResponseMessageMixedAudioSegment>( |
| (value) => |
| GoogleCloudDialogflowCxV3ResponseMessageMixedAudioSegment |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (segments != null) |
| 'segments': segments!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Represents one segment of audio. |
| class GoogleCloudDialogflowCxV3ResponseMessageMixedAudioSegment { |
| /// Whether the playback of this segment can be interrupted by the end user's |
| /// speech and the client should then start the next Dialogflow request. |
| /// |
| /// Output only. |
| core.bool? allowPlaybackInterruption; |
| |
| /// Raw audio synthesized from the Dialogflow agent's response using the |
| /// output config specified in the request. |
| core.String? audio; |
| core.List<core.int> get audioAsBytes => convert.base64.decode(audio!); |
| |
| set audioAsBytes(core.List<core.int> _bytes) { |
| audio = |
| convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); |
| } |
| |
| /// Client-specific URI that points to an audio clip accessible to the client. |
| /// |
| /// Dialogflow does not impose any validation on it. |
| core.String? uri; |
| |
| GoogleCloudDialogflowCxV3ResponseMessageMixedAudioSegment({ |
| this.allowPlaybackInterruption, |
| this.audio, |
| this.uri, |
| }); |
| |
| GoogleCloudDialogflowCxV3ResponseMessageMixedAudioSegment.fromJson( |
| core.Map _json) |
| : this( |
| allowPlaybackInterruption: |
| _json.containsKey('allowPlaybackInterruption') |
| ? _json['allowPlaybackInterruption'] as core.bool |
| : null, |
| audio: |
| _json.containsKey('audio') ? _json['audio'] as core.String : null, |
| uri: _json.containsKey('uri') ? _json['uri'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (allowPlaybackInterruption != null) |
| 'allowPlaybackInterruption': allowPlaybackInterruption!, |
| if (audio != null) 'audio': audio!, |
| if (uri != null) 'uri': uri!, |
| }; |
| } |
| |
| /// A text or ssml response that is preferentially used for TTS output audio |
| /// synthesis, as described in the comment on the ResponseMessage message. |
| class GoogleCloudDialogflowCxV3ResponseMessageOutputAudioText { |
| /// Whether the playback of this message can be interrupted by the end user's |
| /// speech and the client can then starts the next Dialogflow request. |
| /// |
| /// Output only. |
| core.bool? allowPlaybackInterruption; |
| |
| /// The SSML text to be synthesized. |
| /// |
| /// For more information, see \[SSML\](/speech/text-to-speech/docs/ssml). |
| core.String? ssml; |
| |
| /// The raw text to be synthesized. |
| core.String? text; |
| |
| GoogleCloudDialogflowCxV3ResponseMessageOutputAudioText({ |
| this.allowPlaybackInterruption, |
| this.ssml, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowCxV3ResponseMessageOutputAudioText.fromJson( |
| core.Map _json) |
| : this( |
| allowPlaybackInterruption: |
| _json.containsKey('allowPlaybackInterruption') |
| ? _json['allowPlaybackInterruption'] as core.bool |
| : null, |
| ssml: _json.containsKey('ssml') ? _json['ssml'] as core.String : null, |
| text: _json.containsKey('text') ? _json['text'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (allowPlaybackInterruption != null) |
| 'allowPlaybackInterruption': allowPlaybackInterruption!, |
| if (ssml != null) 'ssml': ssml!, |
| if (text != null) 'text': text!, |
| }; |
| } |
| |
| /// Specifies an audio clip to be played by the client as part of the response. |
| class GoogleCloudDialogflowCxV3ResponseMessagePlayAudio { |
| /// Whether the playback of this message can be interrupted by the end user's |
| /// speech and the client can then starts the next Dialogflow request. |
| /// |
| /// Output only. |
| core.bool? allowPlaybackInterruption; |
| |
| /// URI of the audio clip. |
| /// |
| /// Dialogflow does not impose any validation on this value. It is specific to |
| /// the client that reads it. |
| /// |
| /// Required. |
| core.String? audioUri; |
| |
| GoogleCloudDialogflowCxV3ResponseMessagePlayAudio({ |
| this.allowPlaybackInterruption, |
| this.audioUri, |
| }); |
| |
| GoogleCloudDialogflowCxV3ResponseMessagePlayAudio.fromJson(core.Map _json) |
| : this( |
| allowPlaybackInterruption: |
| _json.containsKey('allowPlaybackInterruption') |
| ? _json['allowPlaybackInterruption'] as core.bool |
| : null, |
| audioUri: _json.containsKey('audioUri') |
| ? _json['audioUri'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (allowPlaybackInterruption != null) |
| 'allowPlaybackInterruption': allowPlaybackInterruption!, |
| if (audioUri != null) 'audioUri': audioUri!, |
| }; |
| } |
| |
| /// The text response message. |
| class GoogleCloudDialogflowCxV3ResponseMessageText { |
| /// Whether the playback of this message can be interrupted by the end user's |
| /// speech and the client can then starts the next Dialogflow request. |
| /// |
| /// Output only. |
| core.bool? allowPlaybackInterruption; |
| |
| /// A collection of text responses. |
| /// |
| /// Required. |
| core.List<core.String>? text; |
| |
| GoogleCloudDialogflowCxV3ResponseMessageText({ |
| this.allowPlaybackInterruption, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowCxV3ResponseMessageText.fromJson(core.Map _json) |
| : this( |
| allowPlaybackInterruption: |
| _json.containsKey('allowPlaybackInterruption') |
| ? _json['allowPlaybackInterruption'] as core.bool |
| : null, |
| text: _json.containsKey('text') |
| ? (_json['text'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (allowPlaybackInterruption != null) |
| 'allowPlaybackInterruption': allowPlaybackInterruption!, |
| if (text != null) 'text': text!, |
| }; |
| } |
| |
| /// Metadata returned for the Environments.RunContinuousTest long running |
| /// operation. |
| class GoogleCloudDialogflowCxV3RunContinuousTestMetadata { |
| /// The test errors. |
| core.List<GoogleCloudDialogflowCxV3TestError>? errors; |
| |
| GoogleCloudDialogflowCxV3RunContinuousTestMetadata({ |
| this.errors, |
| }); |
| |
| GoogleCloudDialogflowCxV3RunContinuousTestMetadata.fromJson(core.Map _json) |
| : this( |
| errors: _json.containsKey('errors') |
| ? (_json['errors'] as core.List) |
| .map<GoogleCloudDialogflowCxV3TestError>((value) => |
| GoogleCloudDialogflowCxV3TestError.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (errors != null) |
| 'errors': errors!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// The response message for Environments.RunContinuousTest. |
| class GoogleCloudDialogflowCxV3RunContinuousTestResponse { |
| /// The result for a continuous test run. |
| GoogleCloudDialogflowCxV3ContinuousTestResult? continuousTestResult; |
| |
| GoogleCloudDialogflowCxV3RunContinuousTestResponse({ |
| this.continuousTestResult, |
| }); |
| |
| GoogleCloudDialogflowCxV3RunContinuousTestResponse.fromJson(core.Map _json) |
| : this( |
| continuousTestResult: _json.containsKey('continuousTestResult') |
| ? GoogleCloudDialogflowCxV3ContinuousTestResult.fromJson( |
| _json['continuousTestResult'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (continuousTestResult != null) |
| 'continuousTestResult': continuousTestResult!.toJson(), |
| }; |
| } |
| |
| /// Metadata returned for the TestCases.RunTestCase long running operation. |
| /// |
| /// This message currently has no fields. |
| class GoogleCloudDialogflowCxV3RunTestCaseMetadata { |
| GoogleCloudDialogflowCxV3RunTestCaseMetadata(); |
| |
| GoogleCloudDialogflowCxV3RunTestCaseMetadata.fromJson( |
| // ignore: avoid_unused_constructor_parameters |
| core.Map _json); |
| |
| core.Map<core.String, core.dynamic> toJson() => {}; |
| } |
| |
| /// The response message for TestCases.RunTestCase. |
| class GoogleCloudDialogflowCxV3RunTestCaseResponse { |
| /// The result. |
| GoogleCloudDialogflowCxV3TestCaseResult? result; |
| |
| GoogleCloudDialogflowCxV3RunTestCaseResponse({ |
| this.result, |
| }); |
| |
| GoogleCloudDialogflowCxV3RunTestCaseResponse.fromJson(core.Map _json) |
| : this( |
| result: _json.containsKey('result') |
| ? GoogleCloudDialogflowCxV3TestCaseResult.fromJson( |
| _json['result'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (result != null) 'result': result!.toJson(), |
| }; |
| } |
| |
| /// Represents session information communicated to and from the webhook. |
| class GoogleCloudDialogflowCxV3SessionInfo { |
| /// Optional for WebhookRequest. |
| /// |
| /// Optional for WebhookResponse. All parameters collected from forms and |
| /// intents during the session. Parameters can be created, updated, or removed |
| /// by the webhook. To remove a parameter from the session, the webhook should |
| /// explicitly set the parameter value to null in WebhookResponse. The map is |
| /// keyed by parameters' display names. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? parameters; |
| |
| /// Always present for WebhookRequest. |
| /// |
| /// Ignored for WebhookResponse. The unique identifier of the session. This |
| /// field can be used by the webhook to identify a session. Format: |
| /// `projects//locations//agents//sessions/` or |
| /// `projects//locations//agents//environments//sessions/` if environment is |
| /// specified. |
| core.String? session; |
| |
| GoogleCloudDialogflowCxV3SessionInfo({ |
| this.parameters, |
| this.session, |
| }); |
| |
| GoogleCloudDialogflowCxV3SessionInfo.fromJson(core.Map _json) |
| : this( |
| parameters: _json.containsKey('parameters') |
| ? (_json['parameters'] as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| session: _json.containsKey('session') |
| ? _json['session'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (parameters != null) 'parameters': parameters!, |
| if (session != null) 'session': session!, |
| }; |
| } |
| |
| /// Represents a test case. |
| class GoogleCloudDialogflowCxV3TestCase { |
| /// When the test was created. |
| /// |
| /// Output only. |
| core.String? creationTime; |
| |
| /// The human-readable name of the test case, unique within the agent. |
| /// |
| /// Limit of 200 characters. |
| /// |
| /// Required. |
| core.String? displayName; |
| |
| /// The latest test result. |
| GoogleCloudDialogflowCxV3TestCaseResult? lastTestResult; |
| |
| /// The unique identifier of the test case. |
| /// |
| /// TestCases.CreateTestCase will populate the name automatically. Otherwise |
| /// use format: `projects//locations//agents/ /testCases/`. |
| core.String? name; |
| |
| /// Additional freeform notes about the test case. |
| /// |
| /// Limit of 400 characters. |
| core.String? notes; |
| |
| /// Tags are short descriptions that users may apply to test cases for |
| /// organizational and filtering purposes. |
| /// |
| /// Each tag should start with "#" and has a limit of 30 characters. |
| core.List<core.String>? tags; |
| |
| /// The conversation turns uttered when the test case was created, in |
| /// chronological order. |
| /// |
| /// These include the canonical set of agent utterances that should occur when |
| /// the agent is working properly. |
| core.List<GoogleCloudDialogflowCxV3ConversationTurn>? |
| testCaseConversationTurns; |
| |
| /// Config for the test case. |
| GoogleCloudDialogflowCxV3TestConfig? testConfig; |
| |
| GoogleCloudDialogflowCxV3TestCase({ |
| this.creationTime, |
| this.displayName, |
| this.lastTestResult, |
| this.name, |
| this.notes, |
| this.tags, |
| this.testCaseConversationTurns, |
| this.testConfig, |
| }); |
| |
| GoogleCloudDialogflowCxV3TestCase.fromJson(core.Map _json) |
| : this( |
| creationTime: _json.containsKey('creationTime') |
| ? _json['creationTime'] as core.String |
| : null, |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| lastTestResult: _json.containsKey('lastTestResult') |
| ? GoogleCloudDialogflowCxV3TestCaseResult.fromJson( |
| _json['lastTestResult'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| notes: |
| _json.containsKey('notes') ? _json['notes'] as core.String : null, |
| tags: _json.containsKey('tags') |
| ? (_json['tags'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| testCaseConversationTurns: |
| _json.containsKey('testCaseConversationTurns') |
| ? (_json['testCaseConversationTurns'] as core.List) |
| .map<GoogleCloudDialogflowCxV3ConversationTurn>((value) => |
| GoogleCloudDialogflowCxV3ConversationTurn.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| testConfig: _json.containsKey('testConfig') |
| ? GoogleCloudDialogflowCxV3TestConfig.fromJson( |
| _json['testConfig'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (creationTime != null) 'creationTime': creationTime!, |
| if (displayName != null) 'displayName': displayName!, |
| if (lastTestResult != null) 'lastTestResult': lastTestResult!.toJson(), |
| if (name != null) 'name': name!, |
| if (notes != null) 'notes': notes!, |
| if (tags != null) 'tags': tags!, |
| if (testCaseConversationTurns != null) |
| 'testCaseConversationTurns': testCaseConversationTurns! |
| .map((value) => value.toJson()) |
| .toList(), |
| if (testConfig != null) 'testConfig': testConfig!.toJson(), |
| }; |
| } |
| |
| /// Error info for importing a test. |
| class GoogleCloudDialogflowCxV3TestCaseError { |
| /// The status associated with the test case. |
| GoogleRpcStatus? status; |
| |
| /// The test case. |
| GoogleCloudDialogflowCxV3TestCase? testCase; |
| |
| GoogleCloudDialogflowCxV3TestCaseError({ |
| this.status, |
| this.testCase, |
| }); |
| |
| GoogleCloudDialogflowCxV3TestCaseError.fromJson(core.Map _json) |
| : this( |
| status: _json.containsKey('status') |
| ? GoogleRpcStatus.fromJson( |
| _json['status'] as core.Map<core.String, core.dynamic>) |
| : null, |
| testCase: _json.containsKey('testCase') |
| ? GoogleCloudDialogflowCxV3TestCase.fromJson( |
| _json['testCase'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (status != null) 'status': status!.toJson(), |
| if (testCase != null) 'testCase': testCase!.toJson(), |
| }; |
| } |
| |
| /// Represents a result from running a test case in an agent environment. |
| class GoogleCloudDialogflowCxV3TestCaseResult { |
| /// The conversation turns uttered during the test case replay in |
| /// chronological order. |
| core.List<GoogleCloudDialogflowCxV3ConversationTurn>? conversationTurns; |
| |
| /// Environment where the test was run. |
| /// |
| /// If not set, it indicates the draft environment. |
| core.String? environment; |
| |
| /// The resource name for the test case result. |
| /// |
| /// Format: `projects//locations//agents//testCases/ /results/`. |
| core.String? name; |
| |
| /// Whether the test case passed in the agent environment. |
| /// Possible string values are: |
| /// - "TEST_RESULT_UNSPECIFIED" : Not specified. Should never be used. |
| /// - "PASSED" : The test passed. |
| /// - "FAILED" : The test did not pass. |
| core.String? testResult; |
| |
| /// The time that the test was run. |
| core.String? testTime; |
| |
| GoogleCloudDialogflowCxV3TestCaseResult({ |
| this.conversationTurns, |
| this.environment, |
| this.name, |
| this.testResult, |
| this.testTime, |
| }); |
| |
| GoogleCloudDialogflowCxV3TestCaseResult.fromJson(core.Map _json) |
| : this( |
| conversationTurns: _json.containsKey('conversationTurns') |
| ? (_json['conversationTurns'] as core.List) |
| .map<GoogleCloudDialogflowCxV3ConversationTurn>((value) => |
| GoogleCloudDialogflowCxV3ConversationTurn.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| environment: _json.containsKey('environment') |
| ? _json['environment'] as core.String |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| testResult: _json.containsKey('testResult') |
| ? _json['testResult'] as core.String |
| : null, |
| testTime: _json.containsKey('testTime') |
| ? _json['testTime'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (conversationTurns != null) |
| 'conversationTurns': |
| conversationTurns!.map((value) => value.toJson()).toList(), |
| if (environment != null) 'environment': environment!, |
| if (name != null) 'name': name!, |
| if (testResult != null) 'testResult': testResult!, |
| if (testTime != null) 'testTime': testTime!, |
| }; |
| } |
| |
| /// Represents configurations for a test case. |
| class GoogleCloudDialogflowCxV3TestConfig { |
| /// Flow name. |
| /// |
| /// If not set, default start flow is assumed. Format: |
| /// `projects//locations//agents//flows/`. |
| core.String? flow; |
| |
| /// Session parameters to be compared when calculating differences. |
| core.List<core.String>? trackingParameters; |
| |
| GoogleCloudDialogflowCxV3TestConfig({ |
| this.flow, |
| this.trackingParameters, |
| }); |
| |
| GoogleCloudDialogflowCxV3TestConfig.fromJson(core.Map _json) |
| : this( |
| flow: _json.containsKey('flow') ? _json['flow'] as core.String : null, |
| trackingParameters: _json.containsKey('trackingParameters') |
| ? (_json['trackingParameters'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (flow != null) 'flow': flow!, |
| if (trackingParameters != null) |
| 'trackingParameters': trackingParameters!, |
| }; |
| } |
| |
| /// Error info for running a test. |
| class GoogleCloudDialogflowCxV3TestError { |
| /// The status associated with the test. |
| GoogleRpcStatus? status; |
| |
| /// The test case resource name. |
| core.String? testCase; |
| |
| /// The timestamp when the test was completed. |
| core.String? testTime; |
| |
| GoogleCloudDialogflowCxV3TestError({ |
| this.status, |
| this.testCase, |
| this.testTime, |
| }); |
| |
| GoogleCloudDialogflowCxV3TestError.fromJson(core.Map _json) |
| : this( |
| status: _json.containsKey('status') |
| ? GoogleRpcStatus.fromJson( |
| _json['status'] as core.Map<core.String, core.dynamic>) |
| : null, |
| testCase: _json.containsKey('testCase') |
| ? _json['testCase'] as core.String |
| : null, |
| testTime: _json.containsKey('testTime') |
| ? _json['testTime'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (status != null) 'status': status!.toJson(), |
| if (testCase != null) 'testCase': testCase!, |
| if (testTime != null) 'testTime': testTime!, |
| }; |
| } |
| |
| /// The description of differences between original and replayed agent output. |
| class GoogleCloudDialogflowCxV3TestRunDifference { |
| /// A description of the diff, showing the actual output vs expected output. |
| core.String? description; |
| |
| /// The type of diff. |
| /// Possible string values are: |
| /// - "DIFF_TYPE_UNSPECIFIED" : Should never be used. |
| /// - "INTENT" : The intent. |
| /// - "PAGE" : The page. |
| /// - "PARAMETERS" : The parameters. |
| /// - "UTTERANCE" : The message utterance. |
| core.String? type; |
| |
| GoogleCloudDialogflowCxV3TestRunDifference({ |
| this.description, |
| this.type, |
| }); |
| |
| GoogleCloudDialogflowCxV3TestRunDifference.fromJson(core.Map _json) |
| : this( |
| description: _json.containsKey('description') |
| ? _json['description'] as core.String |
| : null, |
| type: _json.containsKey('type') ? _json['type'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (description != null) 'description': description!, |
| if (type != null) 'type': type!, |
| }; |
| } |
| |
| /// Represents the natural language text to be processed. |
| class GoogleCloudDialogflowCxV3TextInput { |
| /// The UTF-8 encoded natural language text to be processed. |
| /// |
| /// Text length must not exceed 256 characters. |
| /// |
| /// Required. |
| core.String? text; |
| |
| GoogleCloudDialogflowCxV3TextInput({ |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowCxV3TextInput.fromJson(core.Map _json) |
| : this( |
| text: _json.containsKey('text') ? _json['text'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (text != null) 'text': text!, |
| }; |
| } |
| |
| /// A transition route specifies a intent that can be matched and/or a data |
| /// condition that can be evaluated during a session. |
| /// |
| /// When a specified transition is matched, the following actions are taken in |
| /// order: * If there is a `trigger_fulfillment` associated with the transition, |
| /// it will be called. * If there is a `target_page` associated with the |
| /// transition, the session will transition into the specified page. * If there |
| /// is a `target_flow` associated with the transition, the session will |
| /// transition into the specified flow. |
| class GoogleCloudDialogflowCxV3TransitionRoute { |
| /// The condition to evaluate against form parameters or session parameters. |
| /// |
| /// See the |
| /// [conditions reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). |
| /// At least one of `intent` or `condition` must be specified. When both |
| /// `intent` and `condition` are specified, the transition can only happen |
| /// when both are fulfilled. |
| core.String? condition; |
| |
| /// The unique identifier of an Intent. |
| /// |
| /// Format: `projects//locations//agents//intents/`. Indicates that the |
| /// transition can only happen when the given intent is matched. At least one |
| /// of `intent` or `condition` must be specified. When both `intent` and |
| /// `condition` are specified, the transition can only happen when both are |
| /// fulfilled. |
| core.String? intent; |
| |
| /// The unique identifier of this transition route. |
| /// |
| /// Output only. |
| core.String? name; |
| |
| /// The target flow to transition to. |
| /// |
| /// Format: `projects//locations//agents//flows/`. |
| core.String? targetFlow; |
| |
| /// The target page to transition to. |
| /// |
| /// Format: `projects//locations//agents//flows//pages/`. |
| core.String? targetPage; |
| |
| /// The fulfillment to call when the condition is satisfied. |
| /// |
| /// At least one of `trigger_fulfillment` and `target` must be specified. When |
| /// both are defined, `trigger_fulfillment` is executed first. |
| GoogleCloudDialogflowCxV3Fulfillment? triggerFulfillment; |
| |
| GoogleCloudDialogflowCxV3TransitionRoute({ |
| this.condition, |
| this.intent, |
| this.name, |
| this.targetFlow, |
| this.targetPage, |
| this.triggerFulfillment, |
| }); |
| |
| GoogleCloudDialogflowCxV3TransitionRoute.fromJson(core.Map _json) |
| : this( |
| condition: _json.containsKey('condition') |
| ? _json['condition'] as core.String |
| : null, |
| intent: _json.containsKey('intent') |
| ? _json['intent'] as core.String |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| targetFlow: _json.containsKey('targetFlow') |
| ? _json['targetFlow'] as core.String |
| : null, |
| targetPage: _json.containsKey('targetPage') |
| ? _json['targetPage'] as core.String |
| : null, |
| triggerFulfillment: _json.containsKey('triggerFulfillment') |
| ? GoogleCloudDialogflowCxV3Fulfillment.fromJson( |
| _json['triggerFulfillment'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (condition != null) 'condition': condition!, |
| if (intent != null) 'intent': intent!, |
| if (name != null) 'name': name!, |
| if (targetFlow != null) 'targetFlow': targetFlow!, |
| if (targetPage != null) 'targetPage': targetPage!, |
| if (triggerFulfillment != null) |
| 'triggerFulfillment': triggerFulfillment!.toJson(), |
| }; |
| } |
| |
| /// Metadata for UpdateDocument operation. |
| class GoogleCloudDialogflowCxV3UpdateDocumentOperationMetadata { |
| /// The generic information of the operation. |
| GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata? genericMetadata; |
| |
| GoogleCloudDialogflowCxV3UpdateDocumentOperationMetadata({ |
| this.genericMetadata, |
| }); |
| |
| GoogleCloudDialogflowCxV3UpdateDocumentOperationMetadata.fromJson( |
| core.Map _json) |
| : this( |
| genericMetadata: _json.containsKey('genericMetadata') |
| ? GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata |
| .fromJson(_json['genericMetadata'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (genericMetadata != null) |
| 'genericMetadata': genericMetadata!.toJson(), |
| }; |
| } |
| |
| /// The request message for a webhook call. |
| /// |
| /// The request is sent as a JSON object and the field names will be presented |
| /// in camel cases. |
| class GoogleCloudDialogflowCxV3WebhookRequest { |
| /// Always present. |
| /// |
| /// The unique identifier of the DetectIntentResponse that will be returned to |
| /// the API caller. |
| core.String? detectIntentResponseId; |
| |
| /// Always present. |
| /// |
| /// Information about the fulfillment that triggered this webhook call. |
| GoogleCloudDialogflowCxV3WebhookRequestFulfillmentInfo? fulfillmentInfo; |
| |
| /// Information about the last matched intent. |
| GoogleCloudDialogflowCxV3WebhookRequestIntentInfo? intentInfo; |
| |
| /// The language code specified in the original request. |
| core.String? languageCode; |
| |
| /// The list of rich message responses to present to the user. |
| /// |
| /// Webhook can choose to append or replace this list in |
| /// WebhookResponse.fulfillment_response; |
| core.List<GoogleCloudDialogflowCxV3ResponseMessage>? messages; |
| |
| /// Information about page status. |
| GoogleCloudDialogflowCxV3PageInfo? pageInfo; |
| |
| /// Custom data set in QueryParameters.payload. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? payload; |
| |
| /// The sentiment analysis result of the current user request. |
| /// |
| /// The field is filled when sentiment analysis is configured to be enabled |
| /// for the request. |
| GoogleCloudDialogflowCxV3WebhookRequestSentimentAnalysisResult? |
| sentimentAnalysisResult; |
| |
| /// Information about session status. |
| GoogleCloudDialogflowCxV3SessionInfo? sessionInfo; |
| |
| /// If natural language text was provided as input, this field will contain a |
| /// copy of the text. |
| core.String? text; |
| |
| /// If natural language speech audio was provided as input, this field will |
| /// contain the transcript for the audio. |
| core.String? transcript; |
| |
| /// If an event was provided as input, this field will contain the name of the |
| /// event. |
| core.String? triggerEvent; |
| |
| /// If an intent was provided as input, this field will contain a copy of the |
| /// intent identifier. |
| /// |
| /// Format: `projects//locations//agents//intents/`. |
| core.String? triggerIntent; |
| |
| GoogleCloudDialogflowCxV3WebhookRequest({ |
| this.detectIntentResponseId, |
| this.fulfillmentInfo, |
| this.intentInfo, |
| this.languageCode, |
| this.messages, |
| this.pageInfo, |
| this.payload, |
| this.sentimentAnalysisResult, |
| this.sessionInfo, |
| this.text, |
| this.transcript, |
| this.triggerEvent, |
| this.triggerIntent, |
| }); |
| |
| GoogleCloudDialogflowCxV3WebhookRequest.fromJson(core.Map _json) |
| : this( |
| detectIntentResponseId: _json.containsKey('detectIntentResponseId') |
| ? _json['detectIntentResponseId'] as core.String |
| : null, |
| fulfillmentInfo: _json.containsKey('fulfillmentInfo') |
| ? GoogleCloudDialogflowCxV3WebhookRequestFulfillmentInfo.fromJson( |
| _json['fulfillmentInfo'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| intentInfo: _json.containsKey('intentInfo') |
| ? GoogleCloudDialogflowCxV3WebhookRequestIntentInfo.fromJson( |
| _json['intentInfo'] as core.Map<core.String, core.dynamic>) |
| : null, |
| languageCode: _json.containsKey('languageCode') |
| ? _json['languageCode'] as core.String |
| : null, |
| messages: _json.containsKey('messages') |
| ? (_json['messages'] as core.List) |
| .map<GoogleCloudDialogflowCxV3ResponseMessage>((value) => |
| GoogleCloudDialogflowCxV3ResponseMessage.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| pageInfo: _json.containsKey('pageInfo') |
| ? GoogleCloudDialogflowCxV3PageInfo.fromJson( |
| _json['pageInfo'] as core.Map<core.String, core.dynamic>) |
| : null, |
| payload: _json.containsKey('payload') |
| ? (_json['payload'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| sentimentAnalysisResult: _json.containsKey('sentimentAnalysisResult') |
| ? GoogleCloudDialogflowCxV3WebhookRequestSentimentAnalysisResult |
| .fromJson(_json['sentimentAnalysisResult'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| sessionInfo: _json.containsKey('sessionInfo') |
| ? GoogleCloudDialogflowCxV3SessionInfo.fromJson( |
| _json['sessionInfo'] as core.Map<core.String, core.dynamic>) |
| : null, |
| text: _json.containsKey('text') ? _json['text'] as core.String : null, |
| transcript: _json.containsKey('transcript') |
| ? _json['transcript'] as core.String |
| : null, |
| triggerEvent: _json.containsKey('triggerEvent') |
| ? _json['triggerEvent'] as core.String |
| : null, |
| triggerIntent: _json.containsKey('triggerIntent') |
| ? _json['triggerIntent'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (detectIntentResponseId != null) |
| 'detectIntentResponseId': detectIntentResponseId!, |
| if (fulfillmentInfo != null) |
| 'fulfillmentInfo': fulfillmentInfo!.toJson(), |
| if (intentInfo != null) 'intentInfo': intentInfo!.toJson(), |
| if (languageCode != null) 'languageCode': languageCode!, |
| if (messages != null) |
| 'messages': messages!.map((value) => value.toJson()).toList(), |
| if (pageInfo != null) 'pageInfo': pageInfo!.toJson(), |
| if (payload != null) 'payload': payload!, |
| if (sentimentAnalysisResult != null) |
| 'sentimentAnalysisResult': sentimentAnalysisResult!.toJson(), |
| if (sessionInfo != null) 'sessionInfo': sessionInfo!.toJson(), |
| if (text != null) 'text': text!, |
| if (transcript != null) 'transcript': transcript!, |
| if (triggerEvent != null) 'triggerEvent': triggerEvent!, |
| if (triggerIntent != null) 'triggerIntent': triggerIntent!, |
| }; |
| } |
| |
| /// Represents fulfillment information communicated to the webhook. |
| class GoogleCloudDialogflowCxV3WebhookRequestFulfillmentInfo { |
| /// Always present. |
| /// |
| /// The tag used to identify which fulfillment is being called. |
| core.String? tag; |
| |
| GoogleCloudDialogflowCxV3WebhookRequestFulfillmentInfo({ |
| this.tag, |
| }); |
| |
| GoogleCloudDialogflowCxV3WebhookRequestFulfillmentInfo.fromJson( |
| core.Map _json) |
| : this( |
| tag: _json.containsKey('tag') ? _json['tag'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (tag != null) 'tag': tag!, |
| }; |
| } |
| |
| /// Represents intent information communicated to the webhook. |
| class GoogleCloudDialogflowCxV3WebhookRequestIntentInfo { |
| /// The confidence of the matched intent. |
| /// |
| /// Values range from 0.0 (completely uncertain) to 1.0 (completely certain). |
| core.double? confidence; |
| |
| /// Always present. |
| /// |
| /// The display name of the last matched intent. |
| core.String? displayName; |
| |
| /// Always present. |
| /// |
| /// The unique identifier of the last matched intent. Format: |
| /// `projects//locations//agents//intents/`. |
| core.String? lastMatchedIntent; |
| |
| /// Parameters identified as a result of intent matching. |
| /// |
| /// This is a map of the name of the identified parameter to the value of the |
| /// parameter identified from the user's utterance. All parameters defined in |
| /// the matched intent that are identified will be surfaced here. |
| core.Map<core.String, |
| GoogleCloudDialogflowCxV3WebhookRequestIntentInfoIntentParameterValue>? |
| parameters; |
| |
| GoogleCloudDialogflowCxV3WebhookRequestIntentInfo({ |
| this.confidence, |
| this.displayName, |
| this.lastMatchedIntent, |
| this.parameters, |
| }); |
| |
| GoogleCloudDialogflowCxV3WebhookRequestIntentInfo.fromJson(core.Map _json) |
| : this( |
| confidence: _json.containsKey('confidence') |
| ? (_json['confidence'] as core.num).toDouble() |
| : null, |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| lastMatchedIntent: _json.containsKey('lastMatchedIntent') |
| ? _json['lastMatchedIntent'] as core.String |
| : null, |
| parameters: _json.containsKey('parameters') |
| ? (_json['parameters'] as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| GoogleCloudDialogflowCxV3WebhookRequestIntentInfoIntentParameterValue |
| .fromJson(item as core.Map<core.String, core.dynamic>), |
| ), |
| ) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (confidence != null) 'confidence': confidence!, |
| if (displayName != null) 'displayName': displayName!, |
| if (lastMatchedIntent != null) 'lastMatchedIntent': lastMatchedIntent!, |
| if (parameters != null) |
| 'parameters': |
| parameters!.map((key, item) => core.MapEntry(key, item.toJson())), |
| }; |
| } |
| |
| /// Represents a value for an intent parameter. |
| class GoogleCloudDialogflowCxV3WebhookRequestIntentInfoIntentParameterValue { |
| /// Always present. |
| /// |
| /// Original text value extracted from user utterance. |
| core.String? originalValue; |
| |
| /// Always present. |
| /// |
| /// Structured value for the parameter extracted from user utterance. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Object? resolvedValue; |
| |
| GoogleCloudDialogflowCxV3WebhookRequestIntentInfoIntentParameterValue({ |
| this.originalValue, |
| this.resolvedValue, |
| }); |
| |
| GoogleCloudDialogflowCxV3WebhookRequestIntentInfoIntentParameterValue.fromJson( |
| core.Map _json) |
| : this( |
| originalValue: _json.containsKey('originalValue') |
| ? _json['originalValue'] as core.String |
| : null, |
| resolvedValue: _json.containsKey('resolvedValue') |
| ? _json['resolvedValue'] as core.Object |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (originalValue != null) 'originalValue': originalValue!, |
| if (resolvedValue != null) 'resolvedValue': resolvedValue!, |
| }; |
| } |
| |
| /// Represents the result of sentiment analysis. |
| class GoogleCloudDialogflowCxV3WebhookRequestSentimentAnalysisResult { |
| /// A non-negative number in the \[0, +inf) range, which represents the |
| /// absolute magnitude of sentiment, regardless of score (positive or |
| /// negative). |
| core.double? magnitude; |
| |
| /// Sentiment score between -1.0 (negative sentiment) and 1.0 (positive |
| /// sentiment). |
| core.double? score; |
| |
| GoogleCloudDialogflowCxV3WebhookRequestSentimentAnalysisResult({ |
| this.magnitude, |
| this.score, |
| }); |
| |
| GoogleCloudDialogflowCxV3WebhookRequestSentimentAnalysisResult.fromJson( |
| core.Map _json) |
| : this( |
| magnitude: _json.containsKey('magnitude') |
| ? (_json['magnitude'] as core.num).toDouble() |
| : null, |
| score: _json.containsKey('score') |
| ? (_json['score'] as core.num).toDouble() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (magnitude != null) 'magnitude': magnitude!, |
| if (score != null) 'score': score!, |
| }; |
| } |
| |
| /// The response message for a webhook call. |
| class GoogleCloudDialogflowCxV3WebhookResponse { |
| /// The fulfillment response to send to the user. |
| /// |
| /// This field can be omitted by the webhook if it does not intend to send any |
| /// response to the user. |
| GoogleCloudDialogflowCxV3WebhookResponseFulfillmentResponse? |
| fulfillmentResponse; |
| |
| /// Information about page status. |
| /// |
| /// This field can be omitted by the webhook if it does not intend to modify |
| /// page status. |
| GoogleCloudDialogflowCxV3PageInfo? pageInfo; |
| |
| /// Value to append directly to QueryResult.webhook_payloads. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? payload; |
| |
| /// Information about session status. |
| /// |
| /// This field can be omitted by the webhook if it does not intend to modify |
| /// session status. |
| GoogleCloudDialogflowCxV3SessionInfo? sessionInfo; |
| |
| /// The target flow to transition to. |
| /// |
| /// Format: `projects//locations//agents//flows/`. |
| core.String? targetFlow; |
| |
| /// The target page to transition to. |
| /// |
| /// Format: `projects//locations//agents//flows//pages/`. |
| core.String? targetPage; |
| |
| GoogleCloudDialogflowCxV3WebhookResponse({ |
| this.fulfillmentResponse, |
| this.pageInfo, |
| this.payload, |
| this.sessionInfo, |
| this.targetFlow, |
| this.targetPage, |
| }); |
| |
| GoogleCloudDialogflowCxV3WebhookResponse.fromJson(core.Map _json) |
| : this( |
| fulfillmentResponse: _json.containsKey('fulfillmentResponse') |
| ? GoogleCloudDialogflowCxV3WebhookResponseFulfillmentResponse |
| .fromJson(_json['fulfillmentResponse'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| pageInfo: _json.containsKey('pageInfo') |
| ? GoogleCloudDialogflowCxV3PageInfo.fromJson( |
| _json['pageInfo'] as core.Map<core.String, core.dynamic>) |
| : null, |
| payload: _json.containsKey('payload') |
| ? (_json['payload'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| sessionInfo: _json.containsKey('sessionInfo') |
| ? GoogleCloudDialogflowCxV3SessionInfo.fromJson( |
| _json['sessionInfo'] as core.Map<core.String, core.dynamic>) |
| : null, |
| targetFlow: _json.containsKey('targetFlow') |
| ? _json['targetFlow'] as core.String |
| : null, |
| targetPage: _json.containsKey('targetPage') |
| ? _json['targetPage'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (fulfillmentResponse != null) |
| 'fulfillmentResponse': fulfillmentResponse!.toJson(), |
| if (pageInfo != null) 'pageInfo': pageInfo!.toJson(), |
| if (payload != null) 'payload': payload!, |
| if (sessionInfo != null) 'sessionInfo': sessionInfo!.toJson(), |
| if (targetFlow != null) 'targetFlow': targetFlow!, |
| if (targetPage != null) 'targetPage': targetPage!, |
| }; |
| } |
| |
| /// Represents a fulfillment response to the user. |
| class GoogleCloudDialogflowCxV3WebhookResponseFulfillmentResponse { |
| /// Merge behavior for `messages`. |
| /// Possible string values are: |
| /// - "MERGE_BEHAVIOR_UNSPECIFIED" : Not specified. `APPEND` will be used. |
| /// - "APPEND" : `messages` will be appended to the list of messages waiting |
| /// to be sent to the user. |
| /// - "REPLACE" : `messages` will replace the list of messages waiting to be |
| /// sent to the user. |
| core.String? mergeBehavior; |
| |
| /// The list of rich message responses to present to the user. |
| core.List<GoogleCloudDialogflowCxV3ResponseMessage>? messages; |
| |
| GoogleCloudDialogflowCxV3WebhookResponseFulfillmentResponse({ |
| this.mergeBehavior, |
| this.messages, |
| }); |
| |
| GoogleCloudDialogflowCxV3WebhookResponseFulfillmentResponse.fromJson( |
| core.Map _json) |
| : this( |
| mergeBehavior: _json.containsKey('mergeBehavior') |
| ? _json['mergeBehavior'] as core.String |
| : null, |
| messages: _json.containsKey('messages') |
| ? (_json['messages'] as core.List) |
| .map<GoogleCloudDialogflowCxV3ResponseMessage>((value) => |
| GoogleCloudDialogflowCxV3ResponseMessage.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (mergeBehavior != null) 'mergeBehavior': mergeBehavior!, |
| if (messages != null) |
| 'messages': messages!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Represents the natural speech audio to be processed. |
| class GoogleCloudDialogflowCxV3beta1AudioInput { |
| /// The natural language speech audio to be processed. |
| /// |
| /// A single request can contain up to 1 minute of speech audio data. The |
| /// transcribed text cannot contain more than 256 bytes. For non-streaming |
| /// audio detect intent, both `config` and `audio` must be provided. For |
| /// streaming audio detect intent, `config` must be provided in the first |
| /// request and `audio` must be provided in all following requests. |
| core.String? audio; |
| core.List<core.int> get audioAsBytes => convert.base64.decode(audio!); |
| |
| set audioAsBytes(core.List<core.int> _bytes) { |
| audio = |
| convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); |
| } |
| |
| /// Instructs the speech recognizer how to process the speech audio. |
| /// |
| /// Required. |
| GoogleCloudDialogflowCxV3beta1InputAudioConfig? config; |
| |
| GoogleCloudDialogflowCxV3beta1AudioInput({ |
| this.audio, |
| this.config, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1AudioInput.fromJson(core.Map _json) |
| : this( |
| audio: |
| _json.containsKey('audio') ? _json['audio'] as core.String : null, |
| config: _json.containsKey('config') |
| ? GoogleCloudDialogflowCxV3beta1InputAudioConfig.fromJson( |
| _json['config'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (audio != null) 'audio': audio!, |
| if (config != null) 'config': config!.toJson(), |
| }; |
| } |
| |
| /// Metadata returned for the TestCases.BatchRunTestCases long running |
| /// operation. |
| class GoogleCloudDialogflowCxV3beta1BatchRunTestCasesMetadata { |
| /// The test errors. |
| core.List<GoogleCloudDialogflowCxV3beta1TestError>? errors; |
| |
| GoogleCloudDialogflowCxV3beta1BatchRunTestCasesMetadata({ |
| this.errors, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1BatchRunTestCasesMetadata.fromJson( |
| core.Map _json) |
| : this( |
| errors: _json.containsKey('errors') |
| ? (_json['errors'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1TestError>((value) => |
| GoogleCloudDialogflowCxV3beta1TestError.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (errors != null) |
| 'errors': errors!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// The response message for TestCases.BatchRunTestCases. |
| class GoogleCloudDialogflowCxV3beta1BatchRunTestCasesResponse { |
| /// The test case results. |
| /// |
| /// The detailed conversation turns are empty in this response. |
| core.List<GoogleCloudDialogflowCxV3beta1TestCaseResult>? results; |
| |
| GoogleCloudDialogflowCxV3beta1BatchRunTestCasesResponse({ |
| this.results, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1BatchRunTestCasesResponse.fromJson( |
| core.Map _json) |
| : this( |
| results: _json.containsKey('results') |
| ? (_json['results'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1TestCaseResult>((value) => |
| GoogleCloudDialogflowCxV3beta1TestCaseResult.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (results != null) |
| 'results': results!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Represents a result from running a test case in an agent environment. |
| class GoogleCloudDialogflowCxV3beta1ContinuousTestResult { |
| /// The resource name for the continuous test result. |
| /// |
| /// Format: |
| /// `projects//locations//agents//environments//continuousTestResults/`. |
| core.String? name; |
| |
| /// The result of this continuous test run, i.e. whether all the tests in this |
| /// continuous test run pass or not. |
| /// Possible string values are: |
| /// - "AGGREGATED_TEST_RESULT_UNSPECIFIED" : Not specified. Should never be |
| /// used. |
| /// - "PASSED" : All the tests passed. |
| /// - "FAILED" : At least one test did not pass. |
| core.String? result; |
| |
| /// Time when the continuous testing run starts. |
| core.String? runTime; |
| |
| /// A list of individual test case results names in this continuous test run. |
| core.List<core.String>? testCaseResults; |
| |
| GoogleCloudDialogflowCxV3beta1ContinuousTestResult({ |
| this.name, |
| this.result, |
| this.runTime, |
| this.testCaseResults, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1ContinuousTestResult.fromJson(core.Map _json) |
| : this( |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| result: _json.containsKey('result') |
| ? _json['result'] as core.String |
| : null, |
| runTime: _json.containsKey('runTime') |
| ? _json['runTime'] as core.String |
| : null, |
| testCaseResults: _json.containsKey('testCaseResults') |
| ? (_json['testCaseResults'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (name != null) 'name': name!, |
| if (result != null) 'result': result!, |
| if (runTime != null) 'runTime': runTime!, |
| if (testCaseResults != null) 'testCaseResults': testCaseResults!, |
| }; |
| } |
| |
| /// One interaction between a human and virtual agent. |
| /// |
| /// The human provides some input and the virtual agent provides a response. |
| class GoogleCloudDialogflowCxV3beta1ConversationTurn { |
| /// The user input. |
| GoogleCloudDialogflowCxV3beta1ConversationTurnUserInput? userInput; |
| |
| /// The virtual agent output. |
| GoogleCloudDialogflowCxV3beta1ConversationTurnVirtualAgentOutput? |
| virtualAgentOutput; |
| |
| GoogleCloudDialogflowCxV3beta1ConversationTurn({ |
| this.userInput, |
| this.virtualAgentOutput, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1ConversationTurn.fromJson(core.Map _json) |
| : this( |
| userInput: _json.containsKey('userInput') |
| ? GoogleCloudDialogflowCxV3beta1ConversationTurnUserInput |
| .fromJson( |
| _json['userInput'] as core.Map<core.String, core.dynamic>) |
| : null, |
| virtualAgentOutput: _json.containsKey('virtualAgentOutput') |
| ? GoogleCloudDialogflowCxV3beta1ConversationTurnVirtualAgentOutput |
| .fromJson(_json['virtualAgentOutput'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (userInput != null) 'userInput': userInput!.toJson(), |
| if (virtualAgentOutput != null) |
| 'virtualAgentOutput': virtualAgentOutput!.toJson(), |
| }; |
| } |
| |
| /// The input from the human user. |
| class GoogleCloudDialogflowCxV3beta1ConversationTurnUserInput { |
| /// Whether sentiment analysis is enabled. |
| core.bool? enableSentimentAnalysis; |
| |
| /// Parameters that need to be injected into the conversation during intent |
| /// detection. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? injectedParameters; |
| |
| /// Supports text input, event input, dtmf input in the test case. |
| GoogleCloudDialogflowCxV3beta1QueryInput? input; |
| |
| /// If webhooks should be allowed to trigger in response to the user |
| /// utterance. |
| /// |
| /// Often if parameters are injected, webhooks should not be enabled. |
| core.bool? isWebhookEnabled; |
| |
| GoogleCloudDialogflowCxV3beta1ConversationTurnUserInput({ |
| this.enableSentimentAnalysis, |
| this.injectedParameters, |
| this.input, |
| this.isWebhookEnabled, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1ConversationTurnUserInput.fromJson( |
| core.Map _json) |
| : this( |
| enableSentimentAnalysis: _json.containsKey('enableSentimentAnalysis') |
| ? _json['enableSentimentAnalysis'] as core.bool |
| : null, |
| injectedParameters: _json.containsKey('injectedParameters') |
| ? (_json['injectedParameters'] |
| as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| input: _json.containsKey('input') |
| ? GoogleCloudDialogflowCxV3beta1QueryInput.fromJson( |
| _json['input'] as core.Map<core.String, core.dynamic>) |
| : null, |
| isWebhookEnabled: _json.containsKey('isWebhookEnabled') |
| ? _json['isWebhookEnabled'] as core.bool |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (enableSentimentAnalysis != null) |
| 'enableSentimentAnalysis': enableSentimentAnalysis!, |
| if (injectedParameters != null) |
| 'injectedParameters': injectedParameters!, |
| if (input != null) 'input': input!.toJson(), |
| if (isWebhookEnabled != null) 'isWebhookEnabled': isWebhookEnabled!, |
| }; |
| } |
| |
| /// The output from the virtual agent. |
| class GoogleCloudDialogflowCxV3beta1ConversationTurnVirtualAgentOutput { |
| /// The Page on which the utterance was spoken. |
| /// |
| /// Only name and displayName will be set. |
| GoogleCloudDialogflowCxV3beta1Page? currentPage; |
| |
| /// Input only. |
| /// |
| /// The diagnostic info output for the turn. Required to calculate the testing |
| /// coverage. |
| /// |
| /// Required. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? diagnosticInfo; |
| |
| /// If this is part of a result conversation turn, the list of differences |
| /// between the original run and the replay for this output, if any. |
| /// |
| /// Output only. |
| core.List<GoogleCloudDialogflowCxV3beta1TestRunDifference>? differences; |
| |
| /// The session parameters available to the bot at this point. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? sessionParameters; |
| |
| /// Response error from the agent in the test result. |
| /// |
| /// If set, other output is empty. |
| GoogleRpcStatus? status; |
| |
| /// The text responses from the agent for the turn. |
| core.List<GoogleCloudDialogflowCxV3beta1ResponseMessageText>? textResponses; |
| |
| /// The Intent that triggered the response. |
| /// |
| /// Only name and displayName will be set. |
| GoogleCloudDialogflowCxV3beta1Intent? triggeredIntent; |
| |
| GoogleCloudDialogflowCxV3beta1ConversationTurnVirtualAgentOutput({ |
| this.currentPage, |
| this.diagnosticInfo, |
| this.differences, |
| this.sessionParameters, |
| this.status, |
| this.textResponses, |
| this.triggeredIntent, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1ConversationTurnVirtualAgentOutput.fromJson( |
| core.Map _json) |
| : this( |
| currentPage: _json.containsKey('currentPage') |
| ? GoogleCloudDialogflowCxV3beta1Page.fromJson( |
| _json['currentPage'] as core.Map<core.String, core.dynamic>) |
| : null, |
| diagnosticInfo: _json.containsKey('diagnosticInfo') |
| ? (_json['diagnosticInfo'] as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| differences: _json.containsKey('differences') |
| ? (_json['differences'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1TestRunDifference>( |
| (value) => GoogleCloudDialogflowCxV3beta1TestRunDifference |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| sessionParameters: _json.containsKey('sessionParameters') |
| ? (_json['sessionParameters'] |
| as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| status: _json.containsKey('status') |
| ? GoogleRpcStatus.fromJson( |
| _json['status'] as core.Map<core.String, core.dynamic>) |
| : null, |
| textResponses: _json.containsKey('textResponses') |
| ? (_json['textResponses'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1ResponseMessageText>( |
| (value) => |
| GoogleCloudDialogflowCxV3beta1ResponseMessageText |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| triggeredIntent: _json.containsKey('triggeredIntent') |
| ? GoogleCloudDialogflowCxV3beta1Intent.fromJson( |
| _json['triggeredIntent'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (currentPage != null) 'currentPage': currentPage!.toJson(), |
| if (diagnosticInfo != null) 'diagnosticInfo': diagnosticInfo!, |
| if (differences != null) |
| 'differences': differences!.map((value) => value.toJson()).toList(), |
| if (sessionParameters != null) 'sessionParameters': sessionParameters!, |
| if (status != null) 'status': status!.toJson(), |
| if (textResponses != null) |
| 'textResponses': |
| textResponses!.map((value) => value.toJson()).toList(), |
| if (triggeredIntent != null) |
| 'triggeredIntent': triggeredIntent!.toJson(), |
| }; |
| } |
| |
| /// Metadata for CreateDocument operation. |
| class GoogleCloudDialogflowCxV3beta1CreateDocumentOperationMetadata { |
| /// The generic information of the operation. |
| GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata? |
| genericMetadata; |
| |
| GoogleCloudDialogflowCxV3beta1CreateDocumentOperationMetadata({ |
| this.genericMetadata, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1CreateDocumentOperationMetadata.fromJson( |
| core.Map _json) |
| : this( |
| genericMetadata: _json.containsKey('genericMetadata') |
| ? GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata |
| .fromJson(_json['genericMetadata'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (genericMetadata != null) |
| 'genericMetadata': genericMetadata!.toJson(), |
| }; |
| } |
| |
| /// Metadata associated with the long running operation for |
| /// Versions.CreateVersion. |
| class GoogleCloudDialogflowCxV3beta1CreateVersionOperationMetadata { |
| /// Name of the created version. |
| /// |
| /// Format: `projects//locations//agents//flows//versions/`. |
| core.String? version; |
| |
| GoogleCloudDialogflowCxV3beta1CreateVersionOperationMetadata({ |
| this.version, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1CreateVersionOperationMetadata.fromJson( |
| core.Map _json) |
| : this( |
| version: _json.containsKey('version') |
| ? _json['version'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (version != null) 'version': version!, |
| }; |
| } |
| |
| /// Metadata for DeleteDocument operation. |
| class GoogleCloudDialogflowCxV3beta1DeleteDocumentOperationMetadata { |
| /// The generic information of the operation. |
| GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata? |
| genericMetadata; |
| |
| GoogleCloudDialogflowCxV3beta1DeleteDocumentOperationMetadata({ |
| this.genericMetadata, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1DeleteDocumentOperationMetadata.fromJson( |
| core.Map _json) |
| : this( |
| genericMetadata: _json.containsKey('genericMetadata') |
| ? GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata |
| .fromJson(_json['genericMetadata'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (genericMetadata != null) |
| 'genericMetadata': genericMetadata!.toJson(), |
| }; |
| } |
| |
| /// Represents the input for dtmf event. |
| class GoogleCloudDialogflowCxV3beta1DtmfInput { |
| /// The dtmf digits. |
| core.String? digits; |
| |
| /// The finish digit (if any). |
| core.String? finishDigit; |
| |
| GoogleCloudDialogflowCxV3beta1DtmfInput({ |
| this.digits, |
| this.finishDigit, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1DtmfInput.fromJson(core.Map _json) |
| : this( |
| digits: _json.containsKey('digits') |
| ? _json['digits'] as core.String |
| : null, |
| finishDigit: _json.containsKey('finishDigit') |
| ? _json['finishDigit'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (digits != null) 'digits': digits!, |
| if (finishDigit != null) 'finishDigit': finishDigit!, |
| }; |
| } |
| |
| /// An event handler specifies an event that can be handled during a session. |
| /// |
| /// When the specified event happens, the following actions are taken in order: |
| /// * If there is a `trigger_fulfillment` associated with the event, it will be |
| /// called. * If there is a `target_page` associated with the event, the session |
| /// will transition into the specified page. * If there is a `target_flow` |
| /// associated with the event, the session will transition into the specified |
| /// flow. |
| class GoogleCloudDialogflowCxV3beta1EventHandler { |
| /// The name of the event to handle. |
| /// |
| /// Required. |
| core.String? event; |
| |
| /// The unique identifier of this event handler. |
| /// |
| /// Output only. |
| core.String? name; |
| |
| /// The target flow to transition to. |
| /// |
| /// Format: `projects//locations//agents//flows/`. |
| core.String? targetFlow; |
| |
| /// The target page to transition to. |
| /// |
| /// Format: `projects//locations//agents//flows//pages/`. |
| core.String? targetPage; |
| |
| /// The fulfillment to call when the event occurs. |
| /// |
| /// Handling webhook errors with a fulfillment enabled with webhook could |
| /// cause infinite loop. It is invalid to specify such fulfillment for a |
| /// handler handling webhooks. |
| GoogleCloudDialogflowCxV3beta1Fulfillment? triggerFulfillment; |
| |
| GoogleCloudDialogflowCxV3beta1EventHandler({ |
| this.event, |
| this.name, |
| this.targetFlow, |
| this.targetPage, |
| this.triggerFulfillment, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1EventHandler.fromJson(core.Map _json) |
| : this( |
| event: |
| _json.containsKey('event') ? _json['event'] as core.String : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| targetFlow: _json.containsKey('targetFlow') |
| ? _json['targetFlow'] as core.String |
| : null, |
| targetPage: _json.containsKey('targetPage') |
| ? _json['targetPage'] as core.String |
| : null, |
| triggerFulfillment: _json.containsKey('triggerFulfillment') |
| ? GoogleCloudDialogflowCxV3beta1Fulfillment.fromJson( |
| _json['triggerFulfillment'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (event != null) 'event': event!, |
| if (name != null) 'name': name!, |
| if (targetFlow != null) 'targetFlow': targetFlow!, |
| if (targetPage != null) 'targetPage': targetPage!, |
| if (triggerFulfillment != null) |
| 'triggerFulfillment': triggerFulfillment!.toJson(), |
| }; |
| } |
| |
| /// Represents the event to trigger. |
| class GoogleCloudDialogflowCxV3beta1EventInput { |
| /// Name of the event. |
| core.String? event; |
| |
| GoogleCloudDialogflowCxV3beta1EventInput({ |
| this.event, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1EventInput.fromJson(core.Map _json) |
| : this( |
| event: |
| _json.containsKey('event') ? _json['event'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (event != null) 'event': event!, |
| }; |
| } |
| |
| /// The response message for Agents.ExportAgent. |
| class GoogleCloudDialogflowCxV3beta1ExportAgentResponse { |
| /// Uncompressed raw byte content for agent. |
| core.String? agentContent; |
| core.List<core.int> get agentContentAsBytes => |
| convert.base64.decode(agentContent!); |
| |
| set agentContentAsBytes(core.List<core.int> _bytes) { |
| agentContent = |
| convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); |
| } |
| |
| /// The URI to a file containing the exported agent. |
| /// |
| /// This field is populated only if `agent_uri` is specified in |
| /// ExportAgentRequest. |
| core.String? agentUri; |
| |
| GoogleCloudDialogflowCxV3beta1ExportAgentResponse({ |
| this.agentContent, |
| this.agentUri, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1ExportAgentResponse.fromJson(core.Map _json) |
| : this( |
| agentContent: _json.containsKey('agentContent') |
| ? _json['agentContent'] as core.String |
| : null, |
| agentUri: _json.containsKey('agentUri') |
| ? _json['agentUri'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (agentContent != null) 'agentContent': agentContent!, |
| if (agentUri != null) 'agentUri': agentUri!, |
| }; |
| } |
| |
| /// The response message for Flows.ExportFlow. |
| class GoogleCloudDialogflowCxV3beta1ExportFlowResponse { |
| /// Uncompressed raw byte content for flow. |
| core.String? flowContent; |
| core.List<core.int> get flowContentAsBytes => |
| convert.base64.decode(flowContent!); |
| |
| set flowContentAsBytes(core.List<core.int> _bytes) { |
| flowContent = |
| convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); |
| } |
| |
| /// The URI to a file containing the exported flow. |
| /// |
| /// This field is populated only if `flow_uri` is specified in |
| /// ExportFlowRequest. |
| core.String? flowUri; |
| |
| GoogleCloudDialogflowCxV3beta1ExportFlowResponse({ |
| this.flowContent, |
| this.flowUri, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1ExportFlowResponse.fromJson(core.Map _json) |
| : this( |
| flowContent: _json.containsKey('flowContent') |
| ? _json['flowContent'] as core.String |
| : null, |
| flowUri: _json.containsKey('flowUri') |
| ? _json['flowUri'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (flowContent != null) 'flowContent': flowContent!, |
| if (flowUri != null) 'flowUri': flowUri!, |
| }; |
| } |
| |
| /// Metadata returned for the TestCases.ExportTestCases long running operation. |
| /// |
| /// This message currently has no fields. |
| class GoogleCloudDialogflowCxV3beta1ExportTestCasesMetadata { |
| GoogleCloudDialogflowCxV3beta1ExportTestCasesMetadata(); |
| |
| GoogleCloudDialogflowCxV3beta1ExportTestCasesMetadata.fromJson( |
| // ignore: avoid_unused_constructor_parameters |
| core.Map _json); |
| |
| core.Map<core.String, core.dynamic> toJson() => {}; |
| } |
| |
| /// The response message for TestCases.ExportTestCases. |
| class GoogleCloudDialogflowCxV3beta1ExportTestCasesResponse { |
| /// Uncompressed raw byte content for test cases. |
| core.String? content; |
| core.List<core.int> get contentAsBytes => convert.base64.decode(content!); |
| |
| set contentAsBytes(core.List<core.int> _bytes) { |
| content = |
| convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); |
| } |
| |
| /// The URI to a file containing the exported test cases. |
| /// |
| /// This field is populated only if `gcs_uri` is specified in |
| /// ExportTestCasesRequest. |
| core.String? gcsUri; |
| |
| GoogleCloudDialogflowCxV3beta1ExportTestCasesResponse({ |
| this.content, |
| this.gcsUri, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1ExportTestCasesResponse.fromJson(core.Map _json) |
| : this( |
| content: _json.containsKey('content') |
| ? _json['content'] as core.String |
| : null, |
| gcsUri: _json.containsKey('gcsUri') |
| ? _json['gcsUri'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (content != null) 'content': content!, |
| if (gcsUri != null) 'gcsUri': gcsUri!, |
| }; |
| } |
| |
| /// A form is a data model that groups related parameters that can be collected |
| /// from the user. |
| /// |
| /// The process in which the agent prompts the user and collects parameter |
| /// values from the user is called form filling. A form can be added to a page. |
| /// When form filling is done, the filled parameters will be written to the |
| /// session. |
| class GoogleCloudDialogflowCxV3beta1Form { |
| /// Parameters to collect from the user. |
| core.List<GoogleCloudDialogflowCxV3beta1FormParameter>? parameters; |
| |
| GoogleCloudDialogflowCxV3beta1Form({ |
| this.parameters, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1Form.fromJson(core.Map _json) |
| : this( |
| parameters: _json.containsKey('parameters') |
| ? (_json['parameters'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1FormParameter>((value) => |
| GoogleCloudDialogflowCxV3beta1FormParameter.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (parameters != null) |
| 'parameters': parameters!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Represents a form parameter. |
| class GoogleCloudDialogflowCxV3beta1FormParameter { |
| /// The default value of an optional parameter. |
| /// |
| /// If the parameter is required, the default value will be ignored. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Object? defaultValue; |
| |
| /// The human-readable name of the parameter, unique within the form. |
| /// |
| /// Required. |
| core.String? displayName; |
| |
| /// The entity type of the parameter. |
| /// |
| /// Format: `projects/-/locations/-/agents/-/entityTypes/` for system entity |
| /// types (for example, |
| /// `projects/-/locations/-/agents/-/entityTypes/sys.date`), or |
| /// `projects//locations//agents//entityTypes/` for developer entity types. |
| /// |
| /// Required. |
| core.String? entityType; |
| |
| /// Defines fill behavior for the parameter. |
| /// |
| /// Required. |
| GoogleCloudDialogflowCxV3beta1FormParameterFillBehavior? fillBehavior; |
| |
| /// Indicates whether the parameter represents a list of values. |
| core.bool? isList; |
| |
| /// Indicates whether the parameter content should be redacted in log. |
| /// |
| /// If redaction is enabled, the parameter content will be replaced by |
| /// parameter name during logging. Note: the parameter content is subject to |
| /// redaction if either parameter level redaction or entity type level |
| /// redaction is enabled. |
| core.bool? redact; |
| |
| /// Indicates whether the parameter is required. |
| /// |
| /// Optional parameters will not trigger prompts; however, they are filled if |
| /// the user specifies them. Required parameters must be filled before form |
| /// filling concludes. |
| core.bool? required; |
| |
| GoogleCloudDialogflowCxV3beta1FormParameter({ |
| this.defaultValue, |
| this.displayName, |
| this.entityType, |
| this.fillBehavior, |
| this.isList, |
| this.redact, |
| this.required, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1FormParameter.fromJson(core.Map _json) |
| : this( |
| defaultValue: _json.containsKey('defaultValue') |
| ? _json['defaultValue'] as core.Object |
| : null, |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| entityType: _json.containsKey('entityType') |
| ? _json['entityType'] as core.String |
| : null, |
| fillBehavior: _json.containsKey('fillBehavior') |
| ? GoogleCloudDialogflowCxV3beta1FormParameterFillBehavior |
| .fromJson(_json['fillBehavior'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| isList: |
| _json.containsKey('isList') ? _json['isList'] as core.bool : null, |
| redact: |
| _json.containsKey('redact') ? _json['redact'] as core.bool : null, |
| required: _json.containsKey('required') |
| ? _json['required'] as core.bool |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (defaultValue != null) 'defaultValue': defaultValue!, |
| if (displayName != null) 'displayName': displayName!, |
| if (entityType != null) 'entityType': entityType!, |
| if (fillBehavior != null) 'fillBehavior': fillBehavior!.toJson(), |
| if (isList != null) 'isList': isList!, |
| if (redact != null) 'redact': redact!, |
| if (required != null) 'required': required!, |
| }; |
| } |
| |
| /// Configuration for how the filling of a parameter should be handled. |
| class GoogleCloudDialogflowCxV3beta1FormParameterFillBehavior { |
| /// The fulfillment to provide the initial prompt that the agent can present |
| /// to the user in order to fill the parameter. |
| /// |
| /// Required. |
| GoogleCloudDialogflowCxV3beta1Fulfillment? initialPromptFulfillment; |
| |
| /// The handlers for parameter-level events, used to provide reprompt for the |
| /// parameter or transition to a different page/flow. |
| /// |
| /// The supported events are: * `sys.no-match-`, where N can be from 1 to 6 * |
| /// `sys.no-match-default` * `sys.no-input-`, where N can be from 1 to 6 * |
| /// `sys.no-input-default` * `sys.invalid-parameter` |
| /// `initial_prompt_fulfillment` provides the first prompt for the parameter. |
| /// If the user's response does not fill the parameter, a no-match/no-input |
| /// event will be triggered, and the fulfillment associated with the |
| /// `sys.no-match-1`/`sys.no-input-1` handler (if defined) will be called to |
| /// provide a prompt. The `sys.no-match-2`/`sys.no-input-2` handler (if |
| /// defined) will respond to the next no-match/no-input event, and so on. A |
| /// `sys.no-match-default` or `sys.no-input-default` handler will be used to |
| /// handle all following no-match/no-input events after all numbered |
| /// no-match/no-input handlers for the parameter are consumed. A |
| /// `sys.invalid-parameter` handler can be defined to handle the case where |
| /// the parameter values have been `invalidated` by webhook. For example, if |
| /// the user's response fill the parameter, however the parameter was |
| /// invalidated by webhook, the fulfillment associated with the |
| /// `sys.invalid-parameter` handler (if defined) will be called to provide a |
| /// prompt. If the event handler for the corresponding event can't be found on |
| /// the parameter, `initial_prompt_fulfillment` will be re-prompted. |
| core.List<GoogleCloudDialogflowCxV3beta1EventHandler>? repromptEventHandlers; |
| |
| GoogleCloudDialogflowCxV3beta1FormParameterFillBehavior({ |
| this.initialPromptFulfillment, |
| this.repromptEventHandlers, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1FormParameterFillBehavior.fromJson( |
| core.Map _json) |
| : this( |
| initialPromptFulfillment: |
| _json.containsKey('initialPromptFulfillment') |
| ? GoogleCloudDialogflowCxV3beta1Fulfillment.fromJson( |
| _json['initialPromptFulfillment'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| repromptEventHandlers: _json.containsKey('repromptEventHandlers') |
| ? (_json['repromptEventHandlers'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1EventHandler>((value) => |
| GoogleCloudDialogflowCxV3beta1EventHandler.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (initialPromptFulfillment != null) |
| 'initialPromptFulfillment': initialPromptFulfillment!.toJson(), |
| if (repromptEventHandlers != null) |
| 'repromptEventHandlers': |
| repromptEventHandlers!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// A fulfillment can do one or more of the following actions at the same time: |
| /// * Generate rich message responses. |
| /// |
| /// * Set parameter values. * Call the webhook. Fulfillments can be called at |
| /// various stages in the Page or Form lifecycle. For example, when a |
| /// DetectIntentRequest drives a session to enter a new page, the page's entry |
| /// fulfillment can add a static response to the QueryResult in the returning |
| /// DetectIntentResponse, call the webhook (for example, to load user data from |
| /// a database), or both. |
| class GoogleCloudDialogflowCxV3beta1Fulfillment { |
| /// Conditional cases for this fulfillment. |
| core.List<GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCases>? |
| conditionalCases; |
| |
| /// The list of rich message responses to present to the user. |
| core.List<GoogleCloudDialogflowCxV3beta1ResponseMessage>? messages; |
| |
| /// Whether Dialogflow should return currently queued fulfillment response |
| /// messages in streaming APIs. |
| /// |
| /// If a webhook is specified, it happens before Dialogflow invokes webhook. |
| /// Warning: 1) This flag only affects streaming API. Responses are still |
| /// queued and returned once in non-streaming API. 2) The flag can be enabled |
| /// in any fulfillment but only the first 3 partial responses will be |
| /// returned. You may only want to apply it to fulfillments that have slow |
| /// webhooks. |
| core.bool? returnPartialResponses; |
| |
| /// Set parameter values before executing the webhook. |
| core.List<GoogleCloudDialogflowCxV3beta1FulfillmentSetParameterAction>? |
| setParameterActions; |
| |
| /// The tag used by the webhook to identify which fulfillment is being called. |
| /// |
| /// This field is required if `webhook` is specified. |
| core.String? tag; |
| |
| /// The webhook to call. |
| /// |
| /// Format: `projects//locations//agents//webhooks/`. |
| core.String? webhook; |
| |
| GoogleCloudDialogflowCxV3beta1Fulfillment({ |
| this.conditionalCases, |
| this.messages, |
| this.returnPartialResponses, |
| this.setParameterActions, |
| this.tag, |
| this.webhook, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1Fulfillment.fromJson(core.Map _json) |
| : this( |
| conditionalCases: _json.containsKey('conditionalCases') |
| ? (_json['conditionalCases'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCases>( |
| (value) => |
| GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCases |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| messages: _json.containsKey('messages') |
| ? (_json['messages'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1ResponseMessage>((value) => |
| GoogleCloudDialogflowCxV3beta1ResponseMessage.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| returnPartialResponses: _json.containsKey('returnPartialResponses') |
| ? _json['returnPartialResponses'] as core.bool |
| : null, |
| setParameterActions: _json.containsKey('setParameterActions') |
| ? (_json['setParameterActions'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1FulfillmentSetParameterAction>( |
| (value) => |
| GoogleCloudDialogflowCxV3beta1FulfillmentSetParameterAction |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| tag: _json.containsKey('tag') ? _json['tag'] as core.String : null, |
| webhook: _json.containsKey('webhook') |
| ? _json['webhook'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (conditionalCases != null) |
| 'conditionalCases': |
| conditionalCases!.map((value) => value.toJson()).toList(), |
| if (messages != null) |
| 'messages': messages!.map((value) => value.toJson()).toList(), |
| if (returnPartialResponses != null) |
| 'returnPartialResponses': returnPartialResponses!, |
| if (setParameterActions != null) |
| 'setParameterActions': |
| setParameterActions!.map((value) => value.toJson()).toList(), |
| if (tag != null) 'tag': tag!, |
| if (webhook != null) 'webhook': webhook!, |
| }; |
| } |
| |
| /// A list of cascading if-else conditions. |
| /// |
| /// Cases are mutually exclusive. The first one with a matching condition is |
| /// selected, all the rest ignored. |
| class GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCases { |
| /// A list of cascading if-else conditions. |
| core.List<GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCase>? |
| cases; |
| |
| GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCases({ |
| this.cases, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCases.fromJson( |
| core.Map _json) |
| : this( |
| cases: _json.containsKey('cases') |
| ? (_json['cases'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCase>( |
| (value) => |
| GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCase |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (cases != null) |
| 'cases': cases!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Each case has a Boolean condition. |
| /// |
| /// When it is evaluated to be True, the corresponding messages will be selected |
| /// and evaluated recursively. |
| class GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCase { |
| /// A list of case content. |
| core.List< |
| GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCaseCaseContent>? |
| caseContent; |
| |
| /// The condition to activate and select this case. |
| /// |
| /// Empty means the condition is always true. The condition is evaluated |
| /// against form parameters or session parameters. See the |
| /// [conditions reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). |
| core.String? condition; |
| |
| GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCase({ |
| this.caseContent, |
| this.condition, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCase.fromJson( |
| core.Map _json) |
| : this( |
| caseContent: _json.containsKey('caseContent') |
| ? (_json['caseContent'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCaseCaseContent>( |
| (value) => |
| GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCaseCaseContent |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| condition: _json.containsKey('condition') |
| ? _json['condition'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (caseContent != null) |
| 'caseContent': caseContent!.map((value) => value.toJson()).toList(), |
| if (condition != null) 'condition': condition!, |
| }; |
| } |
| |
| /// The list of messages or conditional cases to activate for this case. |
| class GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCaseCaseContent { |
| /// Additional cases to be evaluated. |
| GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCases? additionalCases; |
| |
| /// Returned message. |
| GoogleCloudDialogflowCxV3beta1ResponseMessage? message; |
| |
| GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCaseCaseContent({ |
| this.additionalCases, |
| this.message, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCaseCaseContent.fromJson( |
| core.Map _json) |
| : this( |
| additionalCases: _json.containsKey('additionalCases') |
| ? GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCases |
| .fromJson(_json['additionalCases'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| message: _json.containsKey('message') |
| ? GoogleCloudDialogflowCxV3beta1ResponseMessage.fromJson( |
| _json['message'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (additionalCases != null) |
| 'additionalCases': additionalCases!.toJson(), |
| if (message != null) 'message': message!.toJson(), |
| }; |
| } |
| |
| /// Setting a parameter value. |
| class GoogleCloudDialogflowCxV3beta1FulfillmentSetParameterAction { |
| /// Display name of the parameter. |
| core.String? parameter; |
| |
| /// The new value of the parameter. |
| /// |
| /// A null value clears the parameter. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Object? value; |
| |
| GoogleCloudDialogflowCxV3beta1FulfillmentSetParameterAction({ |
| this.parameter, |
| this.value, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1FulfillmentSetParameterAction.fromJson( |
| core.Map _json) |
| : this( |
| parameter: _json.containsKey('parameter') |
| ? _json['parameter'] as core.String |
| : null, |
| value: |
| _json.containsKey('value') ? _json['value'] as core.Object : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (parameter != null) 'parameter': parameter!, |
| if (value != null) 'value': value!, |
| }; |
| } |
| |
| /// Metadata in google::longrunning::Operation for Knowledge operations. |
| class GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata { |
| /// The current state of this operation. |
| /// |
| /// Required. Output only. |
| /// Possible string values are: |
| /// - "STATE_UNSPECIFIED" : State unspecified. |
| /// - "PENDING" : The operation has been created. |
| /// - "RUNNING" : The operation is currently running. |
| /// - "DONE" : The operation is done, either cancelled or completed. |
| core.String? state; |
| |
| GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata({ |
| this.state, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata.fromJson( |
| core.Map _json) |
| : this( |
| state: |
| _json.containsKey('state') ? _json['state'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (state != null) 'state': state!, |
| }; |
| } |
| |
| /// Metadata for ImportDocuments operation. |
| class GoogleCloudDialogflowCxV3beta1ImportDocumentsOperationMetadata { |
| /// The generic information of the operation. |
| GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata? |
| genericMetadata; |
| |
| GoogleCloudDialogflowCxV3beta1ImportDocumentsOperationMetadata({ |
| this.genericMetadata, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1ImportDocumentsOperationMetadata.fromJson( |
| core.Map _json) |
| : this( |
| genericMetadata: _json.containsKey('genericMetadata') |
| ? GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata |
| .fromJson(_json['genericMetadata'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (genericMetadata != null) |
| 'genericMetadata': genericMetadata!.toJson(), |
| }; |
| } |
| |
| /// Response message for Documents.ImportDocuments. |
| class GoogleCloudDialogflowCxV3beta1ImportDocumentsResponse { |
| /// Includes details about skipped documents or any other warnings. |
| core.List<GoogleRpcStatus>? warnings; |
| |
| GoogleCloudDialogflowCxV3beta1ImportDocumentsResponse({ |
| this.warnings, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1ImportDocumentsResponse.fromJson(core.Map _json) |
| : this( |
| warnings: _json.containsKey('warnings') |
| ? (_json['warnings'] as core.List) |
| .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (warnings != null) |
| 'warnings': warnings!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// The response message for Flows.ImportFlow. |
| class GoogleCloudDialogflowCxV3beta1ImportFlowResponse { |
| /// The unique identifier of the new flow. |
| /// |
| /// Format: `projects//locations//agents//flows/`. |
| core.String? flow; |
| |
| GoogleCloudDialogflowCxV3beta1ImportFlowResponse({ |
| this.flow, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1ImportFlowResponse.fromJson(core.Map _json) |
| : this( |
| flow: _json.containsKey('flow') ? _json['flow'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (flow != null) 'flow': flow!, |
| }; |
| } |
| |
| /// Metadata returned for the TestCases.ImportTestCases long running operation. |
| class GoogleCloudDialogflowCxV3beta1ImportTestCasesMetadata { |
| /// Errors for failed test cases. |
| core.List<GoogleCloudDialogflowCxV3beta1TestCaseError>? errors; |
| |
| GoogleCloudDialogflowCxV3beta1ImportTestCasesMetadata({ |
| this.errors, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1ImportTestCasesMetadata.fromJson(core.Map _json) |
| : this( |
| errors: _json.containsKey('errors') |
| ? (_json['errors'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1TestCaseError>((value) => |
| GoogleCloudDialogflowCxV3beta1TestCaseError.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (errors != null) |
| 'errors': errors!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// The response message for TestCases.ImportTestCases. |
| class GoogleCloudDialogflowCxV3beta1ImportTestCasesResponse { |
| /// The unique identifiers of the new test cases. |
| /// |
| /// Format: `projects//locations//agents//testCases/`. |
| core.List<core.String>? names; |
| |
| GoogleCloudDialogflowCxV3beta1ImportTestCasesResponse({ |
| this.names, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1ImportTestCasesResponse.fromJson(core.Map _json) |
| : this( |
| names: _json.containsKey('names') |
| ? (_json['names'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (names != null) 'names': names!, |
| }; |
| } |
| |
| /// Instructs the speech recognizer on how to process the audio content. |
| class GoogleCloudDialogflowCxV3beta1InputAudioConfig { |
| /// Audio encoding of the audio content to process. |
| /// |
| /// Required. |
| /// Possible string values are: |
| /// - "AUDIO_ENCODING_UNSPECIFIED" : Not specified. |
| /// - "AUDIO_ENCODING_LINEAR_16" : Uncompressed 16-bit signed little-endian |
| /// samples (Linear PCM). |
| /// - "AUDIO_ENCODING_FLAC" : |
| /// \[`FLAC`\](https://xiph.org/flac/documentation.html) (Free Lossless Audio |
| /// Codec) is the recommended encoding because it is lossless (therefore |
| /// recognition is not compromised) and requires only about half the bandwidth |
| /// of `LINEAR16`. `FLAC` stream encoding supports 16-bit and 24-bit samples, |
| /// however, not all fields in `STREAMINFO` are supported. |
| /// - "AUDIO_ENCODING_MULAW" : 8-bit samples that compand 14-bit audio samples |
| /// using G.711 PCMU/mu-law. |
| /// - "AUDIO_ENCODING_AMR" : Adaptive Multi-Rate Narrowband codec. |
| /// `sample_rate_hertz` must be 8000. |
| /// - "AUDIO_ENCODING_AMR_WB" : Adaptive Multi-Rate Wideband codec. |
| /// `sample_rate_hertz` must be 16000. |
| /// - "AUDIO_ENCODING_OGG_OPUS" : Opus encoded audio frames in Ogg container |
| /// ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be |
| /// 16000. |
| /// - "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE" : Although the use of lossy |
| /// encodings is not recommended, if a very low bitrate encoding is required, |
| /// `OGG_OPUS` is highly preferred over Speex encoding. The |
| /// [Speex](https://speex.org/) encoding supported by Dialogflow API has a |
| /// header byte in each block, as in MIME type |
| /// `audio/x-speex-with-header-byte`. It is a variant of the RTP Speex |
| /// encoding defined in [RFC 5574](https://tools.ietf.org/html/rfc5574). The |
| /// stream is a sequence of blocks, one block per RTP packet. Each block |
| /// starts with a byte containing the length of the block, in bytes, followed |
| /// by one or more frames of Speex data, padded to an integral number of bytes |
| /// (octets) as specified in RFC 5574. In other words, each RTP header is |
| /// replaced with a single byte containing the block length. Only Speex |
| /// wideband is supported. `sample_rate_hertz` must be 16000. |
| core.String? audioEncoding; |
| |
| /// If `true`, Dialogflow returns SpeechWordInfo in StreamingRecognitionResult |
| /// with information about the recognized speech words, e.g. start and end |
| /// time offsets. |
| /// |
| /// If false or unspecified, Speech doesn't return any word-level information. |
| /// |
| /// Optional. |
| core.bool? enableWordInfo; |
| |
| /// Which Speech model to select for the given request. |
| /// |
| /// Select the model best suited to your domain to get best results. If a |
| /// model is not explicitly specified, then we auto-select a model based on |
| /// the parameters in the InputAudioConfig. If enhanced speech model is |
| /// enabled for the agent and an enhanced version of the specified model for |
| /// the language does not exist, then the speech is recognized using the |
| /// standard version of the specified model. Refer to |
| /// [Cloud Speech API documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) |
| /// for more details. |
| /// |
| /// Optional. |
| core.String? model; |
| |
| /// Which variant of the Speech model to use. |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "SPEECH_MODEL_VARIANT_UNSPECIFIED" : No model variant specified. In this |
| /// case Dialogflow defaults to USE_BEST_AVAILABLE. |
| /// - "USE_BEST_AVAILABLE" : Use the best available variant of the Speech |
| /// model that the caller is eligible for. Please see the |
| /// [Dialogflow docs](https://cloud.google.com/dialogflow/docs/data-logging) |
| /// for how to make your project eligible for enhanced models. |
| /// - "USE_STANDARD" : Use standard model variant even if an enhanced model is |
| /// available. See the |
| /// [Cloud Speech documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) |
| /// for details about enhanced models. |
| /// - "USE_ENHANCED" : Use an enhanced model variant: * If an enhanced variant |
| /// does not exist for the given model and request language, Dialogflow falls |
| /// back to the standard variant. The |
| /// [Cloud Speech documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) |
| /// describes which models have enhanced variants. * If the API caller isn't |
| /// eligible for enhanced models, Dialogflow returns an error. Please see the |
| /// [Dialogflow docs](https://cloud.google.com/dialogflow/docs/data-logging) |
| /// for how to make your project eligible. |
| core.String? modelVariant; |
| |
| /// A list of strings containing words and phrases that the speech recognizer |
| /// should recognize with higher likelihood. |
| /// |
| /// See |
| /// [the Cloud Speech documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) |
| /// for more details. |
| /// |
| /// Optional. |
| core.List<core.String>? phraseHints; |
| |
| /// Sample rate (in Hertz) of the audio content sent in the query. |
| /// |
| /// Refer to |
| /// [Cloud Speech API documentation](https://cloud.google.com/speech-to-text/docs/basics) |
| /// for more details. |
| core.int? sampleRateHertz; |
| |
| /// If `false` (default), recognition does not cease until the client closes |
| /// the stream. |
| /// |
| /// If `true`, the recognizer will detect a single spoken utterance in input |
| /// audio. Recognition ceases when it detects the audio's voice has stopped or |
| /// paused. In this case, once a detected intent is received, the client |
| /// should close the stream and start a new request with a new stream as |
| /// needed. Note: This setting is relevant only for streaming methods. |
| /// |
| /// Optional. |
| core.bool? singleUtterance; |
| |
| GoogleCloudDialogflowCxV3beta1InputAudioConfig({ |
| this.audioEncoding, |
| this.enableWordInfo, |
| this.model, |
| this.modelVariant, |
| this.phraseHints, |
| this.sampleRateHertz, |
| this.singleUtterance, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1InputAudioConfig.fromJson(core.Map _json) |
| : this( |
| audioEncoding: _json.containsKey('audioEncoding') |
| ? _json['audioEncoding'] as core.String |
| : null, |
| enableWordInfo: _json.containsKey('enableWordInfo') |
| ? _json['enableWordInfo'] as core.bool |
| : null, |
| model: |
| _json.containsKey('model') ? _json['model'] as core.String : null, |
| modelVariant: _json.containsKey('modelVariant') |
| ? _json['modelVariant'] as core.String |
| : null, |
| phraseHints: _json.containsKey('phraseHints') |
| ? (_json['phraseHints'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| sampleRateHertz: _json.containsKey('sampleRateHertz') |
| ? _json['sampleRateHertz'] as core.int |
| : null, |
| singleUtterance: _json.containsKey('singleUtterance') |
| ? _json['singleUtterance'] as core.bool |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (audioEncoding != null) 'audioEncoding': audioEncoding!, |
| if (enableWordInfo != null) 'enableWordInfo': enableWordInfo!, |
| if (model != null) 'model': model!, |
| if (modelVariant != null) 'modelVariant': modelVariant!, |
| if (phraseHints != null) 'phraseHints': phraseHints!, |
| if (sampleRateHertz != null) 'sampleRateHertz': sampleRateHertz!, |
| if (singleUtterance != null) 'singleUtterance': singleUtterance!, |
| }; |
| } |
| |
| /// An intent represents a user's intent to interact with a conversational |
| /// agent. |
| /// |
| /// You can provide information for the Dialogflow API to use to match user |
| /// input to an intent by adding training phrases (i.e., examples of user input) |
| /// to your intent. |
| class GoogleCloudDialogflowCxV3beta1Intent { |
| /// Human readable description for better understanding an intent like its |
| /// scope, content, result etc. |
| /// |
| /// Maximum character limit: 140 characters. |
| core.String? description; |
| |
| /// The human-readable name of the intent, unique within the agent. |
| /// |
| /// Required. |
| core.String? displayName; |
| |
| /// Indicates whether this is a fallback intent. |
| /// |
| /// Currently only default fallback intent is allowed in the agent, which is |
| /// added upon agent creation. Adding training phrases to fallback intent is |
| /// useful in the case of requests that are mistakenly matched, since training |
| /// phrases assigned to fallback intents act as negative examples that |
| /// triggers no-match event. |
| core.bool? isFallback; |
| |
| /// The key/value metadata to label an intent. |
| /// |
| /// Labels can contain lowercase letters, digits and the symbols '-' and '_'. |
| /// International characters are allowed, including letters from unicase |
| /// alphabets. Keys must start with a letter. Keys and values can be no longer |
| /// than 63 characters and no more than 128 bytes. Prefix "sys-" is reserved |
| /// for Dialogflow defined labels. Currently allowed Dialogflow defined labels |
| /// include: * sys-head * sys-contextual The above labels do not require |
| /// value. "sys-head" means the intent is a head intent. "sys-contextual" |
| /// means the intent is a contextual intent. |
| core.Map<core.String, core.String>? labels; |
| |
| /// The unique identifier of the intent. |
| /// |
| /// Required for the Intents.UpdateIntent method. Intents.CreateIntent |
| /// populates the name automatically. Format: |
| /// `projects//locations//agents//intents/`. |
| core.String? name; |
| |
| /// The collection of parameters associated with the intent. |
| core.List<GoogleCloudDialogflowCxV3beta1IntentParameter>? parameters; |
| |
| /// The priority of this intent. |
| /// |
| /// Higher numbers represent higher priorities. - If the supplied value is |
| /// unspecified or 0, the service translates the value to 500,000, which |
| /// corresponds to the `Normal` priority in the console. - If the supplied |
| /// value is negative, the intent is ignored in runtime detect intent |
| /// requests. |
| core.int? priority; |
| |
| /// The collection of training phrases the agent is trained on to identify the |
| /// intent. |
| core.List<GoogleCloudDialogflowCxV3beta1IntentTrainingPhrase>? |
| trainingPhrases; |
| |
| GoogleCloudDialogflowCxV3beta1Intent({ |
| this.description, |
| this.displayName, |
| this.isFallback, |
| this.labels, |
| this.name, |
| this.parameters, |
| this.priority, |
| this.trainingPhrases, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1Intent.fromJson(core.Map _json) |
| : this( |
| description: _json.containsKey('description') |
| ? _json['description'] as core.String |
| : null, |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| isFallback: _json.containsKey('isFallback') |
| ? _json['isFallback'] as core.bool |
| : null, |
| labels: _json.containsKey('labels') |
| ? (_json['labels'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.String, |
| ), |
| ) |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| parameters: _json.containsKey('parameters') |
| ? (_json['parameters'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1IntentParameter>((value) => |
| GoogleCloudDialogflowCxV3beta1IntentParameter.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| priority: _json.containsKey('priority') |
| ? _json['priority'] as core.int |
| : null, |
| trainingPhrases: _json.containsKey('trainingPhrases') |
| ? (_json['trainingPhrases'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1IntentTrainingPhrase>( |
| (value) => |
| GoogleCloudDialogflowCxV3beta1IntentTrainingPhrase |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (description != null) 'description': description!, |
| if (displayName != null) 'displayName': displayName!, |
| if (isFallback != null) 'isFallback': isFallback!, |
| if (labels != null) 'labels': labels!, |
| if (name != null) 'name': name!, |
| if (parameters != null) |
| 'parameters': parameters!.map((value) => value.toJson()).toList(), |
| if (priority != null) 'priority': priority!, |
| if (trainingPhrases != null) |
| 'trainingPhrases': |
| trainingPhrases!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Represents the intent to trigger programmatically rather than as a result of |
| /// natural language processing. |
| class GoogleCloudDialogflowCxV3beta1IntentInput { |
| /// The unique identifier of the intent. |
| /// |
| /// Format: `projects//locations//agents//intents/`. |
| /// |
| /// Required. |
| core.String? intent; |
| |
| GoogleCloudDialogflowCxV3beta1IntentInput({ |
| this.intent, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1IntentInput.fromJson(core.Map _json) |
| : this( |
| intent: _json.containsKey('intent') |
| ? _json['intent'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (intent != null) 'intent': intent!, |
| }; |
| } |
| |
| /// Represents an intent parameter. |
| class GoogleCloudDialogflowCxV3beta1IntentParameter { |
| /// The entity type of the parameter. |
| /// |
| /// Format: `projects/-/locations/-/agents/-/entityTypes/` for system entity |
| /// types (for example, |
| /// `projects/-/locations/-/agents/-/entityTypes/sys.date`), or |
| /// `projects//locations//agents//entityTypes/` for developer entity types. |
| /// |
| /// Required. |
| core.String? entityType; |
| |
| /// The unique identifier of the parameter. |
| /// |
| /// This field is used by training phrases to annotate their parts. |
| /// |
| /// Required. |
| core.String? id; |
| |
| /// Indicates whether the parameter represents a list of values. |
| core.bool? isList; |
| |
| /// Indicates whether the parameter content should be redacted in log. |
| /// |
| /// If redaction is enabled, the parameter content will be replaced by |
| /// parameter name during logging. Note: the parameter content is subject to |
| /// redaction if either parameter level redaction or entity type level |
| /// redaction is enabled. |
| core.bool? redact; |
| |
| GoogleCloudDialogflowCxV3beta1IntentParameter({ |
| this.entityType, |
| this.id, |
| this.isList, |
| this.redact, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1IntentParameter.fromJson(core.Map _json) |
| : this( |
| entityType: _json.containsKey('entityType') |
| ? _json['entityType'] as core.String |
| : null, |
| id: _json.containsKey('id') ? _json['id'] as core.String : null, |
| isList: |
| _json.containsKey('isList') ? _json['isList'] as core.bool : null, |
| redact: |
| _json.containsKey('redact') ? _json['redact'] as core.bool : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (entityType != null) 'entityType': entityType!, |
| if (id != null) 'id': id!, |
| if (isList != null) 'isList': isList!, |
| if (redact != null) 'redact': redact!, |
| }; |
| } |
| |
| /// Represents an example that the agent is trained on to identify the intent. |
| class GoogleCloudDialogflowCxV3beta1IntentTrainingPhrase { |
| /// The unique identifier of the training phrase. |
| /// |
| /// Output only. |
| core.String? id; |
| |
| /// The ordered list of training phrase parts. |
| /// |
| /// The parts are concatenated in order to form the training phrase. Note: The |
| /// API does not automatically annotate training phrases like the Dialogflow |
| /// Console does. Note: Do not forget to include whitespace at part |
| /// boundaries, so the training phrase is well formatted when the parts are |
| /// concatenated. If the training phrase does not need to be annotated with |
| /// parameters, you just need a single part with only the Part.text field set. |
| /// If you want to annotate the training phrase, you must create multiple |
| /// parts, where the fields of each part are populated in one of two ways: - |
| /// `Part.text` is set to a part of the phrase that has no parameters. - |
| /// `Part.text` is set to a part of the phrase that you want to annotate, and |
| /// the `parameter_id` field is set. |
| /// |
| /// Required. |
| core.List<GoogleCloudDialogflowCxV3beta1IntentTrainingPhrasePart>? parts; |
| |
| /// Indicates how many times this example was added to the intent. |
| core.int? repeatCount; |
| |
| GoogleCloudDialogflowCxV3beta1IntentTrainingPhrase({ |
| this.id, |
| this.parts, |
| this.repeatCount, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1IntentTrainingPhrase.fromJson(core.Map _json) |
| : this( |
| id: _json.containsKey('id') ? _json['id'] as core.String : null, |
| parts: _json.containsKey('parts') |
| ? (_json['parts'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1IntentTrainingPhrasePart>( |
| (value) => |
| GoogleCloudDialogflowCxV3beta1IntentTrainingPhrasePart |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| repeatCount: _json.containsKey('repeatCount') |
| ? _json['repeatCount'] as core.int |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (id != null) 'id': id!, |
| if (parts != null) |
| 'parts': parts!.map((value) => value.toJson()).toList(), |
| if (repeatCount != null) 'repeatCount': repeatCount!, |
| }; |
| } |
| |
| /// Represents a part of a training phrase. |
| class GoogleCloudDialogflowCxV3beta1IntentTrainingPhrasePart { |
| /// The parameter used to annotate this part of the training phrase. |
| /// |
| /// This field is required for annotated parts of the training phrase. |
| core.String? parameterId; |
| |
| /// The text for this part. |
| /// |
| /// Required. |
| core.String? text; |
| |
| GoogleCloudDialogflowCxV3beta1IntentTrainingPhrasePart({ |
| this.parameterId, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1IntentTrainingPhrasePart.fromJson( |
| core.Map _json) |
| : this( |
| parameterId: _json.containsKey('parameterId') |
| ? _json['parameterId'] as core.String |
| : null, |
| text: _json.containsKey('text') ? _json['text'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (parameterId != null) 'parameterId': parameterId!, |
| if (text != null) 'text': text!, |
| }; |
| } |
| |
| /// A Dialogflow CX conversation (session) can be described and visualized as a |
| /// state machine. |
| /// |
| /// The states of a CX session are represented by pages. For each flow, you |
| /// define many pages, where your combined pages can handle a complete |
| /// conversation on the topics the flow is designed for. At any given moment, |
| /// exactly one page is the current page, the current page is considered active, |
| /// and the flow associated with that page is considered active. Every flow has |
| /// a special start page. When a flow initially becomes active, the start page |
| /// page becomes the current page. For each conversational turn, the current |
| /// page will either stay the same or transition to another page. You configure |
| /// each page to collect information from the end-user that is relevant for the |
| /// conversational state represented by the page. For more information, see the |
| /// [Page guide](https://cloud.google.com/dialogflow/cx/docs/concept/page). |
| class GoogleCloudDialogflowCxV3beta1Page { |
| /// The human-readable name of the page, unique within the agent. |
| /// |
| /// Required. |
| core.String? displayName; |
| |
| /// The fulfillment to call when the session is entering the page. |
| GoogleCloudDialogflowCxV3beta1Fulfillment? entryFulfillment; |
| |
| /// Handlers associated with the page to handle events such as webhook errors, |
| /// no match or no input. |
| core.List<GoogleCloudDialogflowCxV3beta1EventHandler>? eventHandlers; |
| |
| /// The form associated with the page, used for collecting parameters relevant |
| /// to the page. |
| GoogleCloudDialogflowCxV3beta1Form? form; |
| |
| /// The unique identifier of the page. |
| /// |
| /// Required for the Pages.UpdatePage method. Pages.CreatePage populates the |
| /// name automatically. Format: `projects//locations//agents//flows//pages/`. |
| core.String? name; |
| |
| /// Ordered list of `TransitionRouteGroups` associated with the page. |
| /// |
| /// Transition route groups must be unique within a page. * If multiple |
| /// transition routes within a page scope refer to the same intent, then the |
| /// precedence order is: page's transition route -> page's transition route |
| /// group -> flow's transition routes. * If multiple transition route groups |
| /// within a page contain the same intent, then the first group in the ordered |
| /// list takes precedence. |
| /// Format:`projects//locations//agents//flows//transitionRouteGroups/`. |
| core.List<core.String>? transitionRouteGroups; |
| |
| /// A list of transitions for the transition rules of this page. |
| /// |
| /// They route the conversation to another page in the same flow, or another |
| /// flow. When we are in a certain page, the TransitionRoutes are evalauted in |
| /// the following order: * TransitionRoutes defined in the page with intent |
| /// specified. * TransitionRoutes defined in the transition route groups with |
| /// intent specified. * TransitionRoutes defined in flow with intent |
| /// specified. * TransitionRoutes defined in the transition route groups with |
| /// intent specified. * TransitionRoutes defined in the page with only |
| /// condition specified. * TransitionRoutes defined in the transition route |
| /// groups with only condition specified. |
| core.List<GoogleCloudDialogflowCxV3beta1TransitionRoute>? transitionRoutes; |
| |
| GoogleCloudDialogflowCxV3beta1Page({ |
| this.displayName, |
| this.entryFulfillment, |
| this.eventHandlers, |
| this.form, |
| this.name, |
| this.transitionRouteGroups, |
| this.transitionRoutes, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1Page.fromJson(core.Map _json) |
| : this( |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| entryFulfillment: _json.containsKey('entryFulfillment') |
| ? GoogleCloudDialogflowCxV3beta1Fulfillment.fromJson( |
| _json['entryFulfillment'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| eventHandlers: _json.containsKey('eventHandlers') |
| ? (_json['eventHandlers'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1EventHandler>((value) => |
| GoogleCloudDialogflowCxV3beta1EventHandler.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| form: _json.containsKey('form') |
| ? GoogleCloudDialogflowCxV3beta1Form.fromJson( |
| _json['form'] as core.Map<core.String, core.dynamic>) |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| transitionRouteGroups: _json.containsKey('transitionRouteGroups') |
| ? (_json['transitionRouteGroups'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| transitionRoutes: _json.containsKey('transitionRoutes') |
| ? (_json['transitionRoutes'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1TransitionRoute>((value) => |
| GoogleCloudDialogflowCxV3beta1TransitionRoute.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (displayName != null) 'displayName': displayName!, |
| if (entryFulfillment != null) |
| 'entryFulfillment': entryFulfillment!.toJson(), |
| if (eventHandlers != null) |
| 'eventHandlers': |
| eventHandlers!.map((value) => value.toJson()).toList(), |
| if (form != null) 'form': form!.toJson(), |
| if (name != null) 'name': name!, |
| if (transitionRouteGroups != null) |
| 'transitionRouteGroups': transitionRouteGroups!, |
| if (transitionRoutes != null) |
| 'transitionRoutes': |
| transitionRoutes!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Represents page information communicated to and from the webhook. |
| class GoogleCloudDialogflowCxV3beta1PageInfo { |
| /// Always present for WebhookRequest. |
| /// |
| /// Ignored for WebhookResponse. The unique identifier of the current page. |
| /// Format: `projects//locations//agents//flows//pages/`. |
| core.String? currentPage; |
| |
| /// Optional for both WebhookRequest and WebhookResponse. |
| /// |
| /// Information about the form. |
| GoogleCloudDialogflowCxV3beta1PageInfoFormInfo? formInfo; |
| |
| GoogleCloudDialogflowCxV3beta1PageInfo({ |
| this.currentPage, |
| this.formInfo, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1PageInfo.fromJson(core.Map _json) |
| : this( |
| currentPage: _json.containsKey('currentPage') |
| ? _json['currentPage'] as core.String |
| : null, |
| formInfo: _json.containsKey('formInfo') |
| ? GoogleCloudDialogflowCxV3beta1PageInfoFormInfo.fromJson( |
| _json['formInfo'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (currentPage != null) 'currentPage': currentPage!, |
| if (formInfo != null) 'formInfo': formInfo!.toJson(), |
| }; |
| } |
| |
| /// Represents form information. |
| class GoogleCloudDialogflowCxV3beta1PageInfoFormInfo { |
| /// Optional for both WebhookRequest and WebhookResponse. |
| /// |
| /// The parameters contained in the form. Note that the webhook cannot add or |
| /// remove any form parameter. |
| core.List<GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo>? |
| parameterInfo; |
| |
| GoogleCloudDialogflowCxV3beta1PageInfoFormInfo({ |
| this.parameterInfo, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1PageInfoFormInfo.fromJson(core.Map _json) |
| : this( |
| parameterInfo: _json.containsKey('parameterInfo') |
| ? (_json['parameterInfo'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo>( |
| (value) => |
| GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (parameterInfo != null) |
| 'parameterInfo': |
| parameterInfo!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Represents parameter information. |
| class GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo { |
| /// Always present for WebhookRequest. |
| /// |
| /// Required for WebhookResponse. The human-readable name of the parameter, |
| /// unique within the form. This field cannot be modified by the webhook. |
| core.String? displayName; |
| |
| /// Optional for WebhookRequest. |
| /// |
| /// Ignored for WebhookResponse. Indicates if the parameter value was just |
| /// collected on the last conversation turn. |
| core.bool? justCollected; |
| |
| /// Optional for both WebhookRequest and WebhookResponse. |
| /// |
| /// Indicates whether the parameter is required. Optional parameters will not |
| /// trigger prompts; however, they are filled if the user specifies them. |
| /// Required parameters must be filled before form filling concludes. |
| core.bool? required; |
| |
| /// Always present for WebhookRequest. |
| /// |
| /// Required for WebhookResponse. The state of the parameter. This field can |
| /// be set to INVALID by the webhook to invalidate the parameter; other values |
| /// set by the webhook will be ignored. |
| /// Possible string values are: |
| /// - "PARAMETER_STATE_UNSPECIFIED" : Not specified. This value should be |
| /// never used. |
| /// - "EMPTY" : Indicates that the parameter does not have a value. |
| /// - "INVALID" : Indicates that the parameter value is invalid. This field |
| /// can be used by the webhook to invalidate the parameter and ask the server |
| /// to collect it from the user again. |
| /// - "FILLED" : Indicates that the parameter has a value. |
| core.String? state; |
| |
| /// Optional for both WebhookRequest and WebhookResponse. |
| /// |
| /// The value of the parameter. This field can be set by the webhook to change |
| /// the parameter value. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Object? value; |
| |
| GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo({ |
| this.displayName, |
| this.justCollected, |
| this.required, |
| this.state, |
| this.value, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo.fromJson( |
| core.Map _json) |
| : this( |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| justCollected: _json.containsKey('justCollected') |
| ? _json['justCollected'] as core.bool |
| : null, |
| required: _json.containsKey('required') |
| ? _json['required'] as core.bool |
| : null, |
| state: |
| _json.containsKey('state') ? _json['state'] as core.String : null, |
| value: |
| _json.containsKey('value') ? _json['value'] as core.Object : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (displayName != null) 'displayName': displayName!, |
| if (justCollected != null) 'justCollected': justCollected!, |
| if (required != null) 'required': required!, |
| if (state != null) 'state': state!, |
| if (value != null) 'value': value!, |
| }; |
| } |
| |
| /// Represents the query input. |
| /// |
| /// It can contain one of: 1. A conversational query in the form of text. 2. An |
| /// intent query that specifies which intent to trigger. 3. Natural language |
| /// speech audio to be processed. 4. An event to be triggered. |
| class GoogleCloudDialogflowCxV3beta1QueryInput { |
| /// The natural language speech audio to be processed. |
| GoogleCloudDialogflowCxV3beta1AudioInput? audio; |
| |
| /// The DTMF event to be handled. |
| GoogleCloudDialogflowCxV3beta1DtmfInput? dtmf; |
| |
| /// The event to be triggered. |
| GoogleCloudDialogflowCxV3beta1EventInput? event; |
| |
| /// The intent to be triggered. |
| GoogleCloudDialogflowCxV3beta1IntentInput? intent; |
| |
| /// The language of the input. |
| /// |
| /// See |
| /// [Language Support](https://cloud.google.com/dialogflow/cx/docs/reference/language) |
| /// for a list of the currently supported language codes. Note that queries in |
| /// the same session do not necessarily need to specify the same language. |
| /// |
| /// Required. |
| core.String? languageCode; |
| |
| /// The natural language text to be processed. |
| GoogleCloudDialogflowCxV3beta1TextInput? text; |
| |
| GoogleCloudDialogflowCxV3beta1QueryInput({ |
| this.audio, |
| this.dtmf, |
| this.event, |
| this.intent, |
| this.languageCode, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1QueryInput.fromJson(core.Map _json) |
| : this( |
| audio: _json.containsKey('audio') |
| ? GoogleCloudDialogflowCxV3beta1AudioInput.fromJson( |
| _json['audio'] as core.Map<core.String, core.dynamic>) |
| : null, |
| dtmf: _json.containsKey('dtmf') |
| ? GoogleCloudDialogflowCxV3beta1DtmfInput.fromJson( |
| _json['dtmf'] as core.Map<core.String, core.dynamic>) |
| : null, |
| event: _json.containsKey('event') |
| ? GoogleCloudDialogflowCxV3beta1EventInput.fromJson( |
| _json['event'] as core.Map<core.String, core.dynamic>) |
| : null, |
| intent: _json.containsKey('intent') |
| ? GoogleCloudDialogflowCxV3beta1IntentInput.fromJson( |
| _json['intent'] as core.Map<core.String, core.dynamic>) |
| : null, |
| languageCode: _json.containsKey('languageCode') |
| ? _json['languageCode'] as core.String |
| : null, |
| text: _json.containsKey('text') |
| ? GoogleCloudDialogflowCxV3beta1TextInput.fromJson( |
| _json['text'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (audio != null) 'audio': audio!.toJson(), |
| if (dtmf != null) 'dtmf': dtmf!.toJson(), |
| if (event != null) 'event': event!.toJson(), |
| if (intent != null) 'intent': intent!.toJson(), |
| if (languageCode != null) 'languageCode': languageCode!, |
| if (text != null) 'text': text!.toJson(), |
| }; |
| } |
| |
| /// Metadata for ReloadDocument operation. |
| class GoogleCloudDialogflowCxV3beta1ReloadDocumentOperationMetadata { |
| /// The generic information of the operation. |
| GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata? |
| genericMetadata; |
| |
| GoogleCloudDialogflowCxV3beta1ReloadDocumentOperationMetadata({ |
| this.genericMetadata, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1ReloadDocumentOperationMetadata.fromJson( |
| core.Map _json) |
| : this( |
| genericMetadata: _json.containsKey('genericMetadata') |
| ? GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata |
| .fromJson(_json['genericMetadata'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (genericMetadata != null) |
| 'genericMetadata': genericMetadata!.toJson(), |
| }; |
| } |
| |
| /// Represents a response message that can be returned by a conversational |
| /// agent. |
| /// |
| /// Response messages are also used for output audio synthesis. The approach is |
| /// as follows: * If at least one OutputAudioText response is present, then all |
| /// OutputAudioText responses are linearly concatenated, and the result is used |
| /// for output audio synthesis. * If the OutputAudioText responses are a mixture |
| /// of text and SSML, then the concatenated result is treated as SSML; |
| /// otherwise, the result is treated as either text or SSML as appropriate. The |
| /// agent designer should ideally use either text or SSML consistently |
| /// throughout the bot design. * Otherwise, all Text responses are linearly |
| /// concatenated, and the result is used for output audio synthesis. This |
| /// approach allows for more sophisticated user experience scenarios, where the |
| /// text displayed to the user may differ from what is heard. |
| class GoogleCloudDialogflowCxV3beta1ResponseMessage { |
| /// Indicates that the conversation succeeded. |
| GoogleCloudDialogflowCxV3beta1ResponseMessageConversationSuccess? |
| conversationSuccess; |
| |
| /// A signal that indicates the interaction with the Dialogflow agent has |
| /// ended. |
| /// |
| /// This message is generated by Dialogflow only when the conversation reaches |
| /// `END_SESSION` page. It is not supposed to be defined by the user. It's |
| /// guaranteed that there is at most one such message in each response. |
| /// |
| /// Output only. |
| GoogleCloudDialogflowCxV3beta1ResponseMessageEndInteraction? endInteraction; |
| |
| /// Hands off conversation to a human agent. |
| GoogleCloudDialogflowCxV3beta1ResponseMessageLiveAgentHandoff? |
| liveAgentHandoff; |
| |
| /// An audio response message composed of both the synthesized Dialogflow |
| /// agent responses and responses defined via play_audio. |
| /// |
| /// This message is generated by Dialogflow only and not supposed to be |
| /// defined by the user. |
| /// |
| /// Output only. |
| GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudio? mixedAudio; |
| |
| /// A text or ssml response that is preferentially used for TTS output audio |
| /// synthesis, as described in the comment on the ResponseMessage message. |
| GoogleCloudDialogflowCxV3beta1ResponseMessageOutputAudioText? outputAudioText; |
| |
| /// Returns a response containing a custom, platform-specific payload. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? payload; |
| |
| /// Signal that the client should play an audio clip hosted at a |
| /// client-specific URI. |
| /// |
| /// Dialogflow uses this to construct mixed_audio. However, Dialogflow itself |
| /// does not try to read or process the URI in any way. |
| GoogleCloudDialogflowCxV3beta1ResponseMessagePlayAudio? playAudio; |
| |
| /// Returns a text response. |
| GoogleCloudDialogflowCxV3beta1ResponseMessageText? text; |
| |
| GoogleCloudDialogflowCxV3beta1ResponseMessage({ |
| this.conversationSuccess, |
| this.endInteraction, |
| this.liveAgentHandoff, |
| this.mixedAudio, |
| this.outputAudioText, |
| this.payload, |
| this.playAudio, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1ResponseMessage.fromJson(core.Map _json) |
| : this( |
| conversationSuccess: _json.containsKey('conversationSuccess') |
| ? GoogleCloudDialogflowCxV3beta1ResponseMessageConversationSuccess |
| .fromJson(_json['conversationSuccess'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| endInteraction: _json.containsKey('endInteraction') |
| ? GoogleCloudDialogflowCxV3beta1ResponseMessageEndInteraction |
| .fromJson(_json['endInteraction'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| liveAgentHandoff: _json.containsKey('liveAgentHandoff') |
| ? GoogleCloudDialogflowCxV3beta1ResponseMessageLiveAgentHandoff |
| .fromJson(_json['liveAgentHandoff'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| mixedAudio: _json.containsKey('mixedAudio') |
| ? GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudio |
| .fromJson(_json['mixedAudio'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| outputAudioText: _json.containsKey('outputAudioText') |
| ? GoogleCloudDialogflowCxV3beta1ResponseMessageOutputAudioText |
| .fromJson(_json['outputAudioText'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| payload: _json.containsKey('payload') |
| ? (_json['payload'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| playAudio: _json.containsKey('playAudio') |
| ? GoogleCloudDialogflowCxV3beta1ResponseMessagePlayAudio.fromJson( |
| _json['playAudio'] as core.Map<core.String, core.dynamic>) |
| : null, |
| text: _json.containsKey('text') |
| ? GoogleCloudDialogflowCxV3beta1ResponseMessageText.fromJson( |
| _json['text'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (conversationSuccess != null) |
| 'conversationSuccess': conversationSuccess!.toJson(), |
| if (endInteraction != null) 'endInteraction': endInteraction!.toJson(), |
| if (liveAgentHandoff != null) |
| 'liveAgentHandoff': liveAgentHandoff!.toJson(), |
| if (mixedAudio != null) 'mixedAudio': mixedAudio!.toJson(), |
| if (outputAudioText != null) |
| 'outputAudioText': outputAudioText!.toJson(), |
| if (payload != null) 'payload': payload!, |
| if (playAudio != null) 'playAudio': playAudio!.toJson(), |
| if (text != null) 'text': text!.toJson(), |
| }; |
| } |
| |
| /// Indicates that the conversation succeeded, i.e., the bot handled the issue |
| /// that the customer talked to it about. |
| /// |
| /// Dialogflow only uses this to determine which conversations should be counted |
| /// as successful and doesn't process the metadata in this message in any way. |
| /// Note that Dialogflow also considers conversations that get to the |
| /// conversation end page as successful even if they don't return |
| /// ConversationSuccess. You may set this, for example: * In the |
| /// entry_fulfillment of a Page if entering the page indicates that the |
| /// conversation succeeded. * In a webhook response when you determine that you |
| /// handled the customer issue. |
| class GoogleCloudDialogflowCxV3beta1ResponseMessageConversationSuccess { |
| /// Custom metadata. |
| /// |
| /// Dialogflow doesn't impose any structure on this. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? metadata; |
| |
| GoogleCloudDialogflowCxV3beta1ResponseMessageConversationSuccess({ |
| this.metadata, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1ResponseMessageConversationSuccess.fromJson( |
| core.Map _json) |
| : this( |
| metadata: _json.containsKey('metadata') |
| ? (_json['metadata'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (metadata != null) 'metadata': metadata!, |
| }; |
| } |
| |
| /// Indicates that interaction with the Dialogflow agent has ended. |
| /// |
| /// This message is generated by Dialogflow only and not supposed to be defined |
| /// by the user. |
| class GoogleCloudDialogflowCxV3beta1ResponseMessageEndInteraction { |
| GoogleCloudDialogflowCxV3beta1ResponseMessageEndInteraction(); |
| |
| GoogleCloudDialogflowCxV3beta1ResponseMessageEndInteraction.fromJson( |
| // ignore: avoid_unused_constructor_parameters |
| core.Map _json); |
| |
| core.Map<core.String, core.dynamic> toJson() => {}; |
| } |
| |
| /// Indicates that the conversation should be handed off to a live agent. |
| /// |
| /// Dialogflow only uses this to determine which conversations were handed off |
| /// to a human agent for measurement purposes. What else to do with this signal |
| /// is up to you and your handoff procedures. You may set this, for example: * |
| /// In the entry_fulfillment of a Page if entering the page indicates something |
| /// went extremely wrong in the conversation. * In a webhook response when you |
| /// determine that the customer issue can only be handled by a human. |
| class GoogleCloudDialogflowCxV3beta1ResponseMessageLiveAgentHandoff { |
| /// Custom metadata for your handoff procedure. |
| /// |
| /// Dialogflow doesn't impose any structure on this. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? metadata; |
| |
| GoogleCloudDialogflowCxV3beta1ResponseMessageLiveAgentHandoff({ |
| this.metadata, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1ResponseMessageLiveAgentHandoff.fromJson( |
| core.Map _json) |
| : this( |
| metadata: _json.containsKey('metadata') |
| ? (_json['metadata'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (metadata != null) 'metadata': metadata!, |
| }; |
| } |
| |
| /// Represents an audio message that is composed of both segments synthesized |
| /// from the Dialogflow agent prompts and ones hosted externally at the |
| /// specified URIs. |
| /// |
| /// The external URIs are specified via play_audio. This message is generated by |
| /// Dialogflow only and not supposed to be defined by the user. |
| class GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudio { |
| /// Segments this audio response is composed of. |
| core.List<GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudioSegment>? |
| segments; |
| |
| GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudio({ |
| this.segments, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudio.fromJson( |
| core.Map _json) |
| : this( |
| segments: _json.containsKey('segments') |
| ? (_json['segments'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudioSegment>( |
| (value) => |
| GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudioSegment |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (segments != null) |
| 'segments': segments!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Represents one segment of audio. |
| class GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudioSegment { |
| /// Whether the playback of this segment can be interrupted by the end user's |
| /// speech and the client should then start the next Dialogflow request. |
| /// |
| /// Output only. |
| core.bool? allowPlaybackInterruption; |
| |
| /// Raw audio synthesized from the Dialogflow agent's response using the |
| /// output config specified in the request. |
| core.String? audio; |
| core.List<core.int> get audioAsBytes => convert.base64.decode(audio!); |
| |
| set audioAsBytes(core.List<core.int> _bytes) { |
| audio = |
| convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); |
| } |
| |
| /// Client-specific URI that points to an audio clip accessible to the client. |
| /// |
| /// Dialogflow does not impose any validation on it. |
| core.String? uri; |
| |
| GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudioSegment({ |
| this.allowPlaybackInterruption, |
| this.audio, |
| this.uri, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudioSegment.fromJson( |
| core.Map _json) |
| : this( |
| allowPlaybackInterruption: |
| _json.containsKey('allowPlaybackInterruption') |
| ? _json['allowPlaybackInterruption'] as core.bool |
| : null, |
| audio: |
| _json.containsKey('audio') ? _json['audio'] as core.String : null, |
| uri: _json.containsKey('uri') ? _json['uri'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (allowPlaybackInterruption != null) |
| 'allowPlaybackInterruption': allowPlaybackInterruption!, |
| if (audio != null) 'audio': audio!, |
| if (uri != null) 'uri': uri!, |
| }; |
| } |
| |
| /// A text or ssml response that is preferentially used for TTS output audio |
| /// synthesis, as described in the comment on the ResponseMessage message. |
| class GoogleCloudDialogflowCxV3beta1ResponseMessageOutputAudioText { |
| /// Whether the playback of this message can be interrupted by the end user's |
| /// speech and the client can then starts the next Dialogflow request. |
| /// |
| /// Output only. |
| core.bool? allowPlaybackInterruption; |
| |
| /// The SSML text to be synthesized. |
| /// |
| /// For more information, see \[SSML\](/speech/text-to-speech/docs/ssml). |
| core.String? ssml; |
| |
| /// The raw text to be synthesized. |
| core.String? text; |
| |
| GoogleCloudDialogflowCxV3beta1ResponseMessageOutputAudioText({ |
| this.allowPlaybackInterruption, |
| this.ssml, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1ResponseMessageOutputAudioText.fromJson( |
| core.Map _json) |
| : this( |
| allowPlaybackInterruption: |
| _json.containsKey('allowPlaybackInterruption') |
| ? _json['allowPlaybackInterruption'] as core.bool |
| : null, |
| ssml: _json.containsKey('ssml') ? _json['ssml'] as core.String : null, |
| text: _json.containsKey('text') ? _json['text'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (allowPlaybackInterruption != null) |
| 'allowPlaybackInterruption': allowPlaybackInterruption!, |
| if (ssml != null) 'ssml': ssml!, |
| if (text != null) 'text': text!, |
| }; |
| } |
| |
| /// Specifies an audio clip to be played by the client as part of the response. |
| class GoogleCloudDialogflowCxV3beta1ResponseMessagePlayAudio { |
| /// Whether the playback of this message can be interrupted by the end user's |
| /// speech and the client can then starts the next Dialogflow request. |
| /// |
| /// Output only. |
| core.bool? allowPlaybackInterruption; |
| |
| /// URI of the audio clip. |
| /// |
| /// Dialogflow does not impose any validation on this value. It is specific to |
| /// the client that reads it. |
| /// |
| /// Required. |
| core.String? audioUri; |
| |
| GoogleCloudDialogflowCxV3beta1ResponseMessagePlayAudio({ |
| this.allowPlaybackInterruption, |
| this.audioUri, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1ResponseMessagePlayAudio.fromJson( |
| core.Map _json) |
| : this( |
| allowPlaybackInterruption: |
| _json.containsKey('allowPlaybackInterruption') |
| ? _json['allowPlaybackInterruption'] as core.bool |
| : null, |
| audioUri: _json.containsKey('audioUri') |
| ? _json['audioUri'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (allowPlaybackInterruption != null) |
| 'allowPlaybackInterruption': allowPlaybackInterruption!, |
| if (audioUri != null) 'audioUri': audioUri!, |
| }; |
| } |
| |
| /// The text response message. |
| class GoogleCloudDialogflowCxV3beta1ResponseMessageText { |
| /// Whether the playback of this message can be interrupted by the end user's |
| /// speech and the client can then starts the next Dialogflow request. |
| /// |
| /// Output only. |
| core.bool? allowPlaybackInterruption; |
| |
| /// A collection of text responses. |
| /// |
| /// Required. |
| core.List<core.String>? text; |
| |
| GoogleCloudDialogflowCxV3beta1ResponseMessageText({ |
| this.allowPlaybackInterruption, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1ResponseMessageText.fromJson(core.Map _json) |
| : this( |
| allowPlaybackInterruption: |
| _json.containsKey('allowPlaybackInterruption') |
| ? _json['allowPlaybackInterruption'] as core.bool |
| : null, |
| text: _json.containsKey('text') |
| ? (_json['text'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (allowPlaybackInterruption != null) |
| 'allowPlaybackInterruption': allowPlaybackInterruption!, |
| if (text != null) 'text': text!, |
| }; |
| } |
| |
| /// Metadata returned for the Environments.RunContinuousTest long running |
| /// operation. |
| class GoogleCloudDialogflowCxV3beta1RunContinuousTestMetadata { |
| /// The test errors. |
| core.List<GoogleCloudDialogflowCxV3beta1TestError>? errors; |
| |
| GoogleCloudDialogflowCxV3beta1RunContinuousTestMetadata({ |
| this.errors, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1RunContinuousTestMetadata.fromJson( |
| core.Map _json) |
| : this( |
| errors: _json.containsKey('errors') |
| ? (_json['errors'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1TestError>((value) => |
| GoogleCloudDialogflowCxV3beta1TestError.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (errors != null) |
| 'errors': errors!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// The response message for Environments.RunContinuousTest. |
| class GoogleCloudDialogflowCxV3beta1RunContinuousTestResponse { |
| /// The result for a continuous test run. |
| GoogleCloudDialogflowCxV3beta1ContinuousTestResult? continuousTestResult; |
| |
| GoogleCloudDialogflowCxV3beta1RunContinuousTestResponse({ |
| this.continuousTestResult, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1RunContinuousTestResponse.fromJson( |
| core.Map _json) |
| : this( |
| continuousTestResult: _json.containsKey('continuousTestResult') |
| ? GoogleCloudDialogflowCxV3beta1ContinuousTestResult.fromJson( |
| _json['continuousTestResult'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (continuousTestResult != null) |
| 'continuousTestResult': continuousTestResult!.toJson(), |
| }; |
| } |
| |
| /// Metadata returned for the TestCases.RunTestCase long running operation. |
| /// |
| /// This message currently has no fields. |
| class GoogleCloudDialogflowCxV3beta1RunTestCaseMetadata { |
| GoogleCloudDialogflowCxV3beta1RunTestCaseMetadata(); |
| |
| GoogleCloudDialogflowCxV3beta1RunTestCaseMetadata.fromJson( |
| // ignore: avoid_unused_constructor_parameters |
| core.Map _json); |
| |
| core.Map<core.String, core.dynamic> toJson() => {}; |
| } |
| |
| /// The response message for TestCases.RunTestCase. |
| class GoogleCloudDialogflowCxV3beta1RunTestCaseResponse { |
| /// The result. |
| GoogleCloudDialogflowCxV3beta1TestCaseResult? result; |
| |
| GoogleCloudDialogflowCxV3beta1RunTestCaseResponse({ |
| this.result, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1RunTestCaseResponse.fromJson(core.Map _json) |
| : this( |
| result: _json.containsKey('result') |
| ? GoogleCloudDialogflowCxV3beta1TestCaseResult.fromJson( |
| _json['result'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (result != null) 'result': result!.toJson(), |
| }; |
| } |
| |
| /// Represents session information communicated to and from the webhook. |
| class GoogleCloudDialogflowCxV3beta1SessionInfo { |
| /// Optional for WebhookRequest. |
| /// |
| /// Optional for WebhookResponse. All parameters collected from forms and |
| /// intents during the session. Parameters can be created, updated, or removed |
| /// by the webhook. To remove a parameter from the session, the webhook should |
| /// explicitly set the parameter value to null in WebhookResponse. The map is |
| /// keyed by parameters' display names. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? parameters; |
| |
| /// Always present for WebhookRequest. |
| /// |
| /// Ignored for WebhookResponse. The unique identifier of the session. This |
| /// field can be used by the webhook to identify a session. Format: |
| /// `projects//locations//agents//sessions/` or |
| /// `projects//locations//agents//environments//sessions/` if environment is |
| /// specified. |
| core.String? session; |
| |
| GoogleCloudDialogflowCxV3beta1SessionInfo({ |
| this.parameters, |
| this.session, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1SessionInfo.fromJson(core.Map _json) |
| : this( |
| parameters: _json.containsKey('parameters') |
| ? (_json['parameters'] as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| session: _json.containsKey('session') |
| ? _json['session'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (parameters != null) 'parameters': parameters!, |
| if (session != null) 'session': session!, |
| }; |
| } |
| |
| /// Represents a test case. |
| class GoogleCloudDialogflowCxV3beta1TestCase { |
| /// When the test was created. |
| /// |
| /// Output only. |
| core.String? creationTime; |
| |
| /// The human-readable name of the test case, unique within the agent. |
| /// |
| /// Limit of 200 characters. |
| /// |
| /// Required. |
| core.String? displayName; |
| |
| /// The latest test result. |
| GoogleCloudDialogflowCxV3beta1TestCaseResult? lastTestResult; |
| |
| /// The unique identifier of the test case. |
| /// |
| /// TestCases.CreateTestCase will populate the name automatically. Otherwise |
| /// use format: `projects//locations//agents/ /testCases/`. |
| core.String? name; |
| |
| /// Additional freeform notes about the test case. |
| /// |
| /// Limit of 400 characters. |
| core.String? notes; |
| |
| /// Tags are short descriptions that users may apply to test cases for |
| /// organizational and filtering purposes. |
| /// |
| /// Each tag should start with "#" and has a limit of 30 characters. |
| core.List<core.String>? tags; |
| |
| /// The conversation turns uttered when the test case was created, in |
| /// chronological order. |
| /// |
| /// These include the canonical set of agent utterances that should occur when |
| /// the agent is working properly. |
| core.List<GoogleCloudDialogflowCxV3beta1ConversationTurn>? |
| testCaseConversationTurns; |
| |
| /// Config for the test case. |
| GoogleCloudDialogflowCxV3beta1TestConfig? testConfig; |
| |
| GoogleCloudDialogflowCxV3beta1TestCase({ |
| this.creationTime, |
| this.displayName, |
| this.lastTestResult, |
| this.name, |
| this.notes, |
| this.tags, |
| this.testCaseConversationTurns, |
| this.testConfig, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1TestCase.fromJson(core.Map _json) |
| : this( |
| creationTime: _json.containsKey('creationTime') |
| ? _json['creationTime'] as core.String |
| : null, |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| lastTestResult: _json.containsKey('lastTestResult') |
| ? GoogleCloudDialogflowCxV3beta1TestCaseResult.fromJson( |
| _json['lastTestResult'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| notes: |
| _json.containsKey('notes') ? _json['notes'] as core.String : null, |
| tags: _json.containsKey('tags') |
| ? (_json['tags'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| testCaseConversationTurns: _json |
| .containsKey('testCaseConversationTurns') |
| ? (_json['testCaseConversationTurns'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1ConversationTurn>( |
| (value) => GoogleCloudDialogflowCxV3beta1ConversationTurn |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| testConfig: _json.containsKey('testConfig') |
| ? GoogleCloudDialogflowCxV3beta1TestConfig.fromJson( |
| _json['testConfig'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (creationTime != null) 'creationTime': creationTime!, |
| if (displayName != null) 'displayName': displayName!, |
| if (lastTestResult != null) 'lastTestResult': lastTestResult!.toJson(), |
| if (name != null) 'name': name!, |
| if (notes != null) 'notes': notes!, |
| if (tags != null) 'tags': tags!, |
| if (testCaseConversationTurns != null) |
| 'testCaseConversationTurns': testCaseConversationTurns! |
| .map((value) => value.toJson()) |
| .toList(), |
| if (testConfig != null) 'testConfig': testConfig!.toJson(), |
| }; |
| } |
| |
| /// Error info for importing a test. |
| class GoogleCloudDialogflowCxV3beta1TestCaseError { |
| /// The status associated with the test case. |
| GoogleRpcStatus? status; |
| |
| /// The test case. |
| GoogleCloudDialogflowCxV3beta1TestCase? testCase; |
| |
| GoogleCloudDialogflowCxV3beta1TestCaseError({ |
| this.status, |
| this.testCase, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1TestCaseError.fromJson(core.Map _json) |
| : this( |
| status: _json.containsKey('status') |
| ? GoogleRpcStatus.fromJson( |
| _json['status'] as core.Map<core.String, core.dynamic>) |
| : null, |
| testCase: _json.containsKey('testCase') |
| ? GoogleCloudDialogflowCxV3beta1TestCase.fromJson( |
| _json['testCase'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (status != null) 'status': status!.toJson(), |
| if (testCase != null) 'testCase': testCase!.toJson(), |
| }; |
| } |
| |
| /// Represents a result from running a test case in an agent environment. |
| class GoogleCloudDialogflowCxV3beta1TestCaseResult { |
| /// The conversation turns uttered during the test case replay in |
| /// chronological order. |
| core.List<GoogleCloudDialogflowCxV3beta1ConversationTurn>? conversationTurns; |
| |
| /// Environment where the test was run. |
| /// |
| /// If not set, it indicates the draft environment. |
| core.String? environment; |
| |
| /// The resource name for the test case result. |
| /// |
| /// Format: `projects//locations//agents//testCases/ /results/`. |
| core.String? name; |
| |
| /// Whether the test case passed in the agent environment. |
| /// Possible string values are: |
| /// - "TEST_RESULT_UNSPECIFIED" : Not specified. Should never be used. |
| /// - "PASSED" : The test passed. |
| /// - "FAILED" : The test did not pass. |
| core.String? testResult; |
| |
| /// The time that the test was run. |
| core.String? testTime; |
| |
| GoogleCloudDialogflowCxV3beta1TestCaseResult({ |
| this.conversationTurns, |
| this.environment, |
| this.name, |
| this.testResult, |
| this.testTime, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1TestCaseResult.fromJson(core.Map _json) |
| : this( |
| conversationTurns: _json.containsKey('conversationTurns') |
| ? (_json['conversationTurns'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1ConversationTurn>( |
| (value) => GoogleCloudDialogflowCxV3beta1ConversationTurn |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| environment: _json.containsKey('environment') |
| ? _json['environment'] as core.String |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| testResult: _json.containsKey('testResult') |
| ? _json['testResult'] as core.String |
| : null, |
| testTime: _json.containsKey('testTime') |
| ? _json['testTime'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (conversationTurns != null) |
| 'conversationTurns': |
| conversationTurns!.map((value) => value.toJson()).toList(), |
| if (environment != null) 'environment': environment!, |
| if (name != null) 'name': name!, |
| if (testResult != null) 'testResult': testResult!, |
| if (testTime != null) 'testTime': testTime!, |
| }; |
| } |
| |
| /// Represents configurations for a test case. |
| class GoogleCloudDialogflowCxV3beta1TestConfig { |
| /// Flow name. |
| /// |
| /// If not set, default start flow is assumed. Format: |
| /// `projects//locations//agents//flows/`. |
| core.String? flow; |
| |
| /// Session parameters to be compared when calculating differences. |
| core.List<core.String>? trackingParameters; |
| |
| GoogleCloudDialogflowCxV3beta1TestConfig({ |
| this.flow, |
| this.trackingParameters, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1TestConfig.fromJson(core.Map _json) |
| : this( |
| flow: _json.containsKey('flow') ? _json['flow'] as core.String : null, |
| trackingParameters: _json.containsKey('trackingParameters') |
| ? (_json['trackingParameters'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (flow != null) 'flow': flow!, |
| if (trackingParameters != null) |
| 'trackingParameters': trackingParameters!, |
| }; |
| } |
| |
| /// Error info for running a test. |
| class GoogleCloudDialogflowCxV3beta1TestError { |
| /// The status associated with the test. |
| GoogleRpcStatus? status; |
| |
| /// The test case resource name. |
| core.String? testCase; |
| |
| /// The timestamp when the test was completed. |
| core.String? testTime; |
| |
| GoogleCloudDialogflowCxV3beta1TestError({ |
| this.status, |
| this.testCase, |
| this.testTime, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1TestError.fromJson(core.Map _json) |
| : this( |
| status: _json.containsKey('status') |
| ? GoogleRpcStatus.fromJson( |
| _json['status'] as core.Map<core.String, core.dynamic>) |
| : null, |
| testCase: _json.containsKey('testCase') |
| ? _json['testCase'] as core.String |
| : null, |
| testTime: _json.containsKey('testTime') |
| ? _json['testTime'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (status != null) 'status': status!.toJson(), |
| if (testCase != null) 'testCase': testCase!, |
| if (testTime != null) 'testTime': testTime!, |
| }; |
| } |
| |
| /// The description of differences between original and replayed agent output. |
| class GoogleCloudDialogflowCxV3beta1TestRunDifference { |
| /// A description of the diff, showing the actual output vs expected output. |
| core.String? description; |
| |
| /// The type of diff. |
| /// Possible string values are: |
| /// - "DIFF_TYPE_UNSPECIFIED" : Should never be used. |
| /// - "INTENT" : The intent. |
| /// - "PAGE" : The page. |
| /// - "PARAMETERS" : The parameters. |
| /// - "UTTERANCE" : The message utterance. |
| core.String? type; |
| |
| GoogleCloudDialogflowCxV3beta1TestRunDifference({ |
| this.description, |
| this.type, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1TestRunDifference.fromJson(core.Map _json) |
| : this( |
| description: _json.containsKey('description') |
| ? _json['description'] as core.String |
| : null, |
| type: _json.containsKey('type') ? _json['type'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (description != null) 'description': description!, |
| if (type != null) 'type': type!, |
| }; |
| } |
| |
| /// Represents the natural language text to be processed. |
| class GoogleCloudDialogflowCxV3beta1TextInput { |
| /// The UTF-8 encoded natural language text to be processed. |
| /// |
| /// Text length must not exceed 256 characters. |
| /// |
| /// Required. |
| core.String? text; |
| |
| GoogleCloudDialogflowCxV3beta1TextInput({ |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1TextInput.fromJson(core.Map _json) |
| : this( |
| text: _json.containsKey('text') ? _json['text'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (text != null) 'text': text!, |
| }; |
| } |
| |
| /// A transition route specifies a intent that can be matched and/or a data |
| /// condition that can be evaluated during a session. |
| /// |
| /// When a specified transition is matched, the following actions are taken in |
| /// order: * If there is a `trigger_fulfillment` associated with the transition, |
| /// it will be called. * If there is a `target_page` associated with the |
| /// transition, the session will transition into the specified page. * If there |
| /// is a `target_flow` associated with the transition, the session will |
| /// transition into the specified flow. |
| class GoogleCloudDialogflowCxV3beta1TransitionRoute { |
| /// The condition to evaluate against form parameters or session parameters. |
| /// |
| /// See the |
| /// [conditions reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). |
| /// At least one of `intent` or `condition` must be specified. When both |
| /// `intent` and `condition` are specified, the transition can only happen |
| /// when both are fulfilled. |
| core.String? condition; |
| |
| /// The unique identifier of an Intent. |
| /// |
| /// Format: `projects//locations//agents//intents/`. Indicates that the |
| /// transition can only happen when the given intent is matched. At least one |
| /// of `intent` or `condition` must be specified. When both `intent` and |
| /// `condition` are specified, the transition can only happen when both are |
| /// fulfilled. |
| core.String? intent; |
| |
| /// The unique identifier of this transition route. |
| /// |
| /// Output only. |
| core.String? name; |
| |
| /// The target flow to transition to. |
| /// |
| /// Format: `projects//locations//agents//flows/`. |
| core.String? targetFlow; |
| |
| /// The target page to transition to. |
| /// |
| /// Format: `projects//locations//agents//flows//pages/`. |
| core.String? targetPage; |
| |
| /// The fulfillment to call when the condition is satisfied. |
| /// |
| /// At least one of `trigger_fulfillment` and `target` must be specified. When |
| /// both are defined, `trigger_fulfillment` is executed first. |
| GoogleCloudDialogflowCxV3beta1Fulfillment? triggerFulfillment; |
| |
| GoogleCloudDialogflowCxV3beta1TransitionRoute({ |
| this.condition, |
| this.intent, |
| this.name, |
| this.targetFlow, |
| this.targetPage, |
| this.triggerFulfillment, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1TransitionRoute.fromJson(core.Map _json) |
| : this( |
| condition: _json.containsKey('condition') |
| ? _json['condition'] as core.String |
| : null, |
| intent: _json.containsKey('intent') |
| ? _json['intent'] as core.String |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| targetFlow: _json.containsKey('targetFlow') |
| ? _json['targetFlow'] as core.String |
| : null, |
| targetPage: _json.containsKey('targetPage') |
| ? _json['targetPage'] as core.String |
| : null, |
| triggerFulfillment: _json.containsKey('triggerFulfillment') |
| ? GoogleCloudDialogflowCxV3beta1Fulfillment.fromJson( |
| _json['triggerFulfillment'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (condition != null) 'condition': condition!, |
| if (intent != null) 'intent': intent!, |
| if (name != null) 'name': name!, |
| if (targetFlow != null) 'targetFlow': targetFlow!, |
| if (targetPage != null) 'targetPage': targetPage!, |
| if (triggerFulfillment != null) |
| 'triggerFulfillment': triggerFulfillment!.toJson(), |
| }; |
| } |
| |
| /// Metadata for UpdateDocument operation. |
| class GoogleCloudDialogflowCxV3beta1UpdateDocumentOperationMetadata { |
| /// The generic information of the operation. |
| GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata? |
| genericMetadata; |
| |
| GoogleCloudDialogflowCxV3beta1UpdateDocumentOperationMetadata({ |
| this.genericMetadata, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1UpdateDocumentOperationMetadata.fromJson( |
| core.Map _json) |
| : this( |
| genericMetadata: _json.containsKey('genericMetadata') |
| ? GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata |
| .fromJson(_json['genericMetadata'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (genericMetadata != null) |
| 'genericMetadata': genericMetadata!.toJson(), |
| }; |
| } |
| |
| /// The request message for a webhook call. |
| /// |
| /// The request is sent as a JSON object and the field names will be presented |
| /// in camel cases. |
| class GoogleCloudDialogflowCxV3beta1WebhookRequest { |
| /// Always present. |
| /// |
| /// The unique identifier of the DetectIntentResponse that will be returned to |
| /// the API caller. |
| core.String? detectIntentResponseId; |
| |
| /// Always present. |
| /// |
| /// Information about the fulfillment that triggered this webhook call. |
| GoogleCloudDialogflowCxV3beta1WebhookRequestFulfillmentInfo? fulfillmentInfo; |
| |
| /// Information about the last matched intent. |
| GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfo? intentInfo; |
| |
| /// The language code specified in the original request. |
| core.String? languageCode; |
| |
| /// The list of rich message responses to present to the user. |
| /// |
| /// Webhook can choose to append or replace this list in |
| /// WebhookResponse.fulfillment_response; |
| core.List<GoogleCloudDialogflowCxV3beta1ResponseMessage>? messages; |
| |
| /// Information about page status. |
| GoogleCloudDialogflowCxV3beta1PageInfo? pageInfo; |
| |
| /// Custom data set in QueryParameters.payload. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? payload; |
| |
| /// The sentiment analysis result of the current user request. |
| /// |
| /// The field is filled when sentiment analysis is configured to be enabled |
| /// for the request. |
| GoogleCloudDialogflowCxV3beta1WebhookRequestSentimentAnalysisResult? |
| sentimentAnalysisResult; |
| |
| /// Information about session status. |
| GoogleCloudDialogflowCxV3beta1SessionInfo? sessionInfo; |
| |
| /// If natural language text was provided as input, this field will contain a |
| /// copy of the text. |
| core.String? text; |
| |
| /// If natural language speech audio was provided as input, this field will |
| /// contain the transcript for the audio. |
| core.String? transcript; |
| |
| /// If an event was provided as input, this field will contain the name of the |
| /// event. |
| core.String? triggerEvent; |
| |
| /// If an intent was provided as input, this field will contain a copy of the |
| /// intent identifier. |
| /// |
| /// Format: `projects//locations//agents//intents/`. |
| core.String? triggerIntent; |
| |
| GoogleCloudDialogflowCxV3beta1WebhookRequest({ |
| this.detectIntentResponseId, |
| this.fulfillmentInfo, |
| this.intentInfo, |
| this.languageCode, |
| this.messages, |
| this.pageInfo, |
| this.payload, |
| this.sentimentAnalysisResult, |
| this.sessionInfo, |
| this.text, |
| this.transcript, |
| this.triggerEvent, |
| this.triggerIntent, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1WebhookRequest.fromJson(core.Map _json) |
| : this( |
| detectIntentResponseId: _json.containsKey('detectIntentResponseId') |
| ? _json['detectIntentResponseId'] as core.String |
| : null, |
| fulfillmentInfo: _json.containsKey('fulfillmentInfo') |
| ? GoogleCloudDialogflowCxV3beta1WebhookRequestFulfillmentInfo |
| .fromJson(_json['fulfillmentInfo'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| intentInfo: _json.containsKey('intentInfo') |
| ? GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfo.fromJson( |
| _json['intentInfo'] as core.Map<core.String, core.dynamic>) |
| : null, |
| languageCode: _json.containsKey('languageCode') |
| ? _json['languageCode'] as core.String |
| : null, |
| messages: _json.containsKey('messages') |
| ? (_json['messages'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1ResponseMessage>((value) => |
| GoogleCloudDialogflowCxV3beta1ResponseMessage.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| pageInfo: _json.containsKey('pageInfo') |
| ? GoogleCloudDialogflowCxV3beta1PageInfo.fromJson( |
| _json['pageInfo'] as core.Map<core.String, core.dynamic>) |
| : null, |
| payload: _json.containsKey('payload') |
| ? (_json['payload'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| sentimentAnalysisResult: _json.containsKey('sentimentAnalysisResult') |
| ? GoogleCloudDialogflowCxV3beta1WebhookRequestSentimentAnalysisResult |
| .fromJson(_json['sentimentAnalysisResult'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| sessionInfo: _json.containsKey('sessionInfo') |
| ? GoogleCloudDialogflowCxV3beta1SessionInfo.fromJson( |
| _json['sessionInfo'] as core.Map<core.String, core.dynamic>) |
| : null, |
| text: _json.containsKey('text') ? _json['text'] as core.String : null, |
| transcript: _json.containsKey('transcript') |
| ? _json['transcript'] as core.String |
| : null, |
| triggerEvent: _json.containsKey('triggerEvent') |
| ? _json['triggerEvent'] as core.String |
| : null, |
| triggerIntent: _json.containsKey('triggerIntent') |
| ? _json['triggerIntent'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (detectIntentResponseId != null) |
| 'detectIntentResponseId': detectIntentResponseId!, |
| if (fulfillmentInfo != null) |
| 'fulfillmentInfo': fulfillmentInfo!.toJson(), |
| if (intentInfo != null) 'intentInfo': intentInfo!.toJson(), |
| if (languageCode != null) 'languageCode': languageCode!, |
| if (messages != null) |
| 'messages': messages!.map((value) => value.toJson()).toList(), |
| if (pageInfo != null) 'pageInfo': pageInfo!.toJson(), |
| if (payload != null) 'payload': payload!, |
| if (sentimentAnalysisResult != null) |
| 'sentimentAnalysisResult': sentimentAnalysisResult!.toJson(), |
| if (sessionInfo != null) 'sessionInfo': sessionInfo!.toJson(), |
| if (text != null) 'text': text!, |
| if (transcript != null) 'transcript': transcript!, |
| if (triggerEvent != null) 'triggerEvent': triggerEvent!, |
| if (triggerIntent != null) 'triggerIntent': triggerIntent!, |
| }; |
| } |
| |
| /// Represents fulfillment information communicated to the webhook. |
| class GoogleCloudDialogflowCxV3beta1WebhookRequestFulfillmentInfo { |
| /// Always present. |
| /// |
| /// The tag used to identify which fulfillment is being called. |
| core.String? tag; |
| |
| GoogleCloudDialogflowCxV3beta1WebhookRequestFulfillmentInfo({ |
| this.tag, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1WebhookRequestFulfillmentInfo.fromJson( |
| core.Map _json) |
| : this( |
| tag: _json.containsKey('tag') ? _json['tag'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (tag != null) 'tag': tag!, |
| }; |
| } |
| |
| /// Represents intent information communicated to the webhook. |
| class GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfo { |
| /// The confidence of the matched intent. |
| /// |
| /// Values range from 0.0 (completely uncertain) to 1.0 (completely certain). |
| core.double? confidence; |
| |
| /// Always present. |
| /// |
| /// The display name of the last matched intent. |
| core.String? displayName; |
| |
| /// Always present. |
| /// |
| /// The unique identifier of the last matched intent. Format: |
| /// `projects//locations//agents//intents/`. |
| core.String? lastMatchedIntent; |
| |
| /// Parameters identified as a result of intent matching. |
| /// |
| /// This is a map of the name of the identified parameter to the value of the |
| /// parameter identified from the user's utterance. All parameters defined in |
| /// the matched intent that are identified will be surfaced here. |
| core.Map<core.String, |
| GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfoIntentParameterValue>? |
| parameters; |
| |
| GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfo({ |
| this.confidence, |
| this.displayName, |
| this.lastMatchedIntent, |
| this.parameters, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfo.fromJson( |
| core.Map _json) |
| : this( |
| confidence: _json.containsKey('confidence') |
| ? (_json['confidence'] as core.num).toDouble() |
| : null, |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| lastMatchedIntent: _json.containsKey('lastMatchedIntent') |
| ? _json['lastMatchedIntent'] as core.String |
| : null, |
| parameters: _json.containsKey('parameters') |
| ? (_json['parameters'] as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfoIntentParameterValue |
| .fromJson(item as core.Map<core.String, core.dynamic>), |
| ), |
| ) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (confidence != null) 'confidence': confidence!, |
| if (displayName != null) 'displayName': displayName!, |
| if (lastMatchedIntent != null) 'lastMatchedIntent': lastMatchedIntent!, |
| if (parameters != null) |
| 'parameters': |
| parameters!.map((key, item) => core.MapEntry(key, item.toJson())), |
| }; |
| } |
| |
| /// Represents a value for an intent parameter. |
| class GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfoIntentParameterValue { |
| /// Always present. |
| /// |
| /// Original text value extracted from user utterance. |
| core.String? originalValue; |
| |
| /// Always present. |
| /// |
| /// Structured value for the parameter extracted from user utterance. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Object? resolvedValue; |
| |
| GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfoIntentParameterValue({ |
| this.originalValue, |
| this.resolvedValue, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfoIntentParameterValue.fromJson( |
| core.Map _json) |
| : this( |
| originalValue: _json.containsKey('originalValue') |
| ? _json['originalValue'] as core.String |
| : null, |
| resolvedValue: _json.containsKey('resolvedValue') |
| ? _json['resolvedValue'] as core.Object |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (originalValue != null) 'originalValue': originalValue!, |
| if (resolvedValue != null) 'resolvedValue': resolvedValue!, |
| }; |
| } |
| |
| /// Represents the result of sentiment analysis. |
| class GoogleCloudDialogflowCxV3beta1WebhookRequestSentimentAnalysisResult { |
| /// A non-negative number in the \[0, +inf) range, which represents the |
| /// absolute magnitude of sentiment, regardless of score (positive or |
| /// negative). |
| core.double? magnitude; |
| |
| /// Sentiment score between -1.0 (negative sentiment) and 1.0 (positive |
| /// sentiment). |
| core.double? score; |
| |
| GoogleCloudDialogflowCxV3beta1WebhookRequestSentimentAnalysisResult({ |
| this.magnitude, |
| this.score, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1WebhookRequestSentimentAnalysisResult.fromJson( |
| core.Map _json) |
| : this( |
| magnitude: _json.containsKey('magnitude') |
| ? (_json['magnitude'] as core.num).toDouble() |
| : null, |
| score: _json.containsKey('score') |
| ? (_json['score'] as core.num).toDouble() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (magnitude != null) 'magnitude': magnitude!, |
| if (score != null) 'score': score!, |
| }; |
| } |
| |
| /// The response message for a webhook call. |
| class GoogleCloudDialogflowCxV3beta1WebhookResponse { |
| /// The fulfillment response to send to the user. |
| /// |
| /// This field can be omitted by the webhook if it does not intend to send any |
| /// response to the user. |
| GoogleCloudDialogflowCxV3beta1WebhookResponseFulfillmentResponse? |
| fulfillmentResponse; |
| |
| /// Information about page status. |
| /// |
| /// This field can be omitted by the webhook if it does not intend to modify |
| /// page status. |
| GoogleCloudDialogflowCxV3beta1PageInfo? pageInfo; |
| |
| /// Value to append directly to QueryResult.webhook_payloads. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? payload; |
| |
| /// Information about session status. |
| /// |
| /// This field can be omitted by the webhook if it does not intend to modify |
| /// session status. |
| GoogleCloudDialogflowCxV3beta1SessionInfo? sessionInfo; |
| |
| /// The target flow to transition to. |
| /// |
| /// Format: `projects//locations//agents//flows/`. |
| core.String? targetFlow; |
| |
| /// The target page to transition to. |
| /// |
| /// Format: `projects//locations//agents//flows//pages/`. |
| core.String? targetPage; |
| |
| GoogleCloudDialogflowCxV3beta1WebhookResponse({ |
| this.fulfillmentResponse, |
| this.pageInfo, |
| this.payload, |
| this.sessionInfo, |
| this.targetFlow, |
| this.targetPage, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1WebhookResponse.fromJson(core.Map _json) |
| : this( |
| fulfillmentResponse: _json.containsKey('fulfillmentResponse') |
| ? GoogleCloudDialogflowCxV3beta1WebhookResponseFulfillmentResponse |
| .fromJson(_json['fulfillmentResponse'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| pageInfo: _json.containsKey('pageInfo') |
| ? GoogleCloudDialogflowCxV3beta1PageInfo.fromJson( |
| _json['pageInfo'] as core.Map<core.String, core.dynamic>) |
| : null, |
| payload: _json.containsKey('payload') |
| ? (_json['payload'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| sessionInfo: _json.containsKey('sessionInfo') |
| ? GoogleCloudDialogflowCxV3beta1SessionInfo.fromJson( |
| _json['sessionInfo'] as core.Map<core.String, core.dynamic>) |
| : null, |
| targetFlow: _json.containsKey('targetFlow') |
| ? _json['targetFlow'] as core.String |
| : null, |
| targetPage: _json.containsKey('targetPage') |
| ? _json['targetPage'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (fulfillmentResponse != null) |
| 'fulfillmentResponse': fulfillmentResponse!.toJson(), |
| if (pageInfo != null) 'pageInfo': pageInfo!.toJson(), |
| if (payload != null) 'payload': payload!, |
| if (sessionInfo != null) 'sessionInfo': sessionInfo!.toJson(), |
| if (targetFlow != null) 'targetFlow': targetFlow!, |
| if (targetPage != null) 'targetPage': targetPage!, |
| }; |
| } |
| |
| /// Represents a fulfillment response to the user. |
| class GoogleCloudDialogflowCxV3beta1WebhookResponseFulfillmentResponse { |
| /// Merge behavior for `messages`. |
| /// Possible string values are: |
| /// - "MERGE_BEHAVIOR_UNSPECIFIED" : Not specified. `APPEND` will be used. |
| /// - "APPEND" : `messages` will be appended to the list of messages waiting |
| /// to be sent to the user. |
| /// - "REPLACE" : `messages` will replace the list of messages waiting to be |
| /// sent to the user. |
| core.String? mergeBehavior; |
| |
| /// The list of rich message responses to present to the user. |
| core.List<GoogleCloudDialogflowCxV3beta1ResponseMessage>? messages; |
| |
| GoogleCloudDialogflowCxV3beta1WebhookResponseFulfillmentResponse({ |
| this.mergeBehavior, |
| this.messages, |
| }); |
| |
| GoogleCloudDialogflowCxV3beta1WebhookResponseFulfillmentResponse.fromJson( |
| core.Map _json) |
| : this( |
| mergeBehavior: _json.containsKey('mergeBehavior') |
| ? _json['mergeBehavior'] as core.String |
| : null, |
| messages: _json.containsKey('messages') |
| ? (_json['messages'] as core.List) |
| .map<GoogleCloudDialogflowCxV3beta1ResponseMessage>((value) => |
| GoogleCloudDialogflowCxV3beta1ResponseMessage.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (mergeBehavior != null) 'mergeBehavior': mergeBehavior!, |
| if (messages != null) |
| 'messages': messages!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// A Dialogflow agent is a virtual agent that handles conversations with your |
| /// end-users. |
| /// |
| /// It is a natural language understanding module that understands the nuances |
| /// of human language. Dialogflow translates end-user text or audio during a |
| /// conversation to structured data that your apps and services can understand. |
| /// You design and build a Dialogflow agent to handle the types of conversations |
| /// required for your system. For more information about agents, see the |
| /// [Agent guide](https://cloud.google.com/dialogflow/docs/agents-overview). |
| class GoogleCloudDialogflowV2Agent { |
| /// API version displayed in Dialogflow console. |
| /// |
| /// If not specified, V2 API is assumed. Clients are free to query different |
| /// service endpoints for different API versions. However, bots connectors and |
| /// webhook calls will follow the specified API version. |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "API_VERSION_UNSPECIFIED" : Not specified. |
| /// - "API_VERSION_V1" : Legacy V1 API. |
| /// - "API_VERSION_V2" : V2 API. |
| /// - "API_VERSION_V2_BETA_1" : V2beta1 API. |
| core.String? apiVersion; |
| |
| /// The URI of the agent's avatar. |
| /// |
| /// Avatars are used throughout the Dialogflow console and in the self-hosted |
| /// [Web Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo) |
| /// integration. |
| /// |
| /// Optional. |
| core.String? avatarUri; |
| |
| /// To filter out false positive results and still get variety in matched |
| /// natural language inputs for your agent, you can tune the machine learning |
| /// classification threshold. |
| /// |
| /// If the returned score value is less than the threshold value, then a |
| /// fallback intent will be triggered or, if there are no fallback intents |
| /// defined, no intent will be triggered. The score values range from 0.0 |
| /// (completely uncertain) to 1.0 (completely certain). If set to 0.0, the |
| /// default of 0.3 is used. |
| /// |
| /// Optional. |
| core.double? classificationThreshold; |
| |
| /// The default language of the agent as a language tag. |
| /// |
| /// See |
| /// [Language Support](https://cloud.google.com/dialogflow/docs/reference/language) |
| /// for a list of the currently supported language codes. This field cannot be |
| /// set by the `Update` method. |
| /// |
| /// Required. |
| core.String? defaultLanguageCode; |
| |
| /// The description of this agent. |
| /// |
| /// The maximum length is 500 characters. If exceeded, the request is |
| /// rejected. |
| /// |
| /// Optional. |
| core.String? description; |
| |
| /// The name of this agent. |
| /// |
| /// Required. |
| core.String? displayName; |
| |
| /// Determines whether this agent should log conversation queries. |
| /// |
| /// Optional. |
| core.bool? enableLogging; |
| |
| /// Determines how intents are detected from user queries. |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "MATCH_MODE_UNSPECIFIED" : Not specified. |
| /// - "MATCH_MODE_HYBRID" : Best for agents with a small number of examples in |
| /// intents and/or wide use of templates syntax and composite entities. |
| /// - "MATCH_MODE_ML_ONLY" : Can be used for agents with a large number of |
| /// examples in intents, especially the ones using @sys.any or very large |
| /// custom entities. |
| core.String? matchMode; |
| |
| /// The project of this agent. |
| /// |
| /// Format: `projects/`. |
| /// |
| /// Required. |
| core.String? parent; |
| |
| /// The list of all languages supported by this agent (except for the |
| /// `default_language_code`). |
| /// |
| /// Optional. |
| core.List<core.String>? supportedLanguageCodes; |
| |
| /// The agent tier. |
| /// |
| /// If not specified, TIER_STANDARD is assumed. |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "TIER_UNSPECIFIED" : Not specified. This value should never be used. |
| /// - "TIER_STANDARD" : Standard tier. |
| /// - "TIER_ENTERPRISE" : Enterprise tier (Essentials). |
| /// - "TIER_ENTERPRISE_PLUS" : Enterprise tier (Plus). |
| core.String? tier; |
| |
| /// The time zone of this agent from the |
| /// [time zone database](https://www.iana.org/time-zones), e.g., |
| /// America/New_York, Europe/Paris. |
| /// |
| /// Required. |
| core.String? timeZone; |
| |
| GoogleCloudDialogflowV2Agent({ |
| this.apiVersion, |
| this.avatarUri, |
| this.classificationThreshold, |
| this.defaultLanguageCode, |
| this.description, |
| this.displayName, |
| this.enableLogging, |
| this.matchMode, |
| this.parent, |
| this.supportedLanguageCodes, |
| this.tier, |
| this.timeZone, |
| }); |
| |
| GoogleCloudDialogflowV2Agent.fromJson(core.Map _json) |
| : this( |
| apiVersion: _json.containsKey('apiVersion') |
| ? _json['apiVersion'] as core.String |
| : null, |
| avatarUri: _json.containsKey('avatarUri') |
| ? _json['avatarUri'] as core.String |
| : null, |
| classificationThreshold: _json.containsKey('classificationThreshold') |
| ? (_json['classificationThreshold'] as core.num).toDouble() |
| : null, |
| defaultLanguageCode: _json.containsKey('defaultLanguageCode') |
| ? _json['defaultLanguageCode'] as core.String |
| : null, |
| description: _json.containsKey('description') |
| ? _json['description'] as core.String |
| : null, |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| enableLogging: _json.containsKey('enableLogging') |
| ? _json['enableLogging'] as core.bool |
| : null, |
| matchMode: _json.containsKey('matchMode') |
| ? _json['matchMode'] as core.String |
| : null, |
| parent: _json.containsKey('parent') |
| ? _json['parent'] as core.String |
| : null, |
| supportedLanguageCodes: _json.containsKey('supportedLanguageCodes') |
| ? (_json['supportedLanguageCodes'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| tier: _json.containsKey('tier') ? _json['tier'] as core.String : null, |
| timeZone: _json.containsKey('timeZone') |
| ? _json['timeZone'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (apiVersion != null) 'apiVersion': apiVersion!, |
| if (avatarUri != null) 'avatarUri': avatarUri!, |
| if (classificationThreshold != null) |
| 'classificationThreshold': classificationThreshold!, |
| if (defaultLanguageCode != null) |
| 'defaultLanguageCode': defaultLanguageCode!, |
| if (description != null) 'description': description!, |
| if (displayName != null) 'displayName': displayName!, |
| if (enableLogging != null) 'enableLogging': enableLogging!, |
| if (matchMode != null) 'matchMode': matchMode!, |
| if (parent != null) 'parent': parent!, |
| if (supportedLanguageCodes != null) |
| 'supportedLanguageCodes': supportedLanguageCodes!, |
| if (tier != null) 'tier': tier!, |
| if (timeZone != null) 'timeZone': timeZone!, |
| }; |
| } |
| |
| /// Detail feedback of Agent Assist result. |
| class GoogleCloudDialogflowV2AgentAssistantFeedback { |
| /// Whether or not the suggested answer is relevant. |
| /// |
| /// For example: * Query: "Can I change my mailing address?" * Suggested |
| /// document says: "Items must be returned/exchanged within 60 days of the |
| /// purchase date." * answer_relevance: AnswerRelevance.IRRELEVANT |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "ANSWER_RELEVANCE_UNSPECIFIED" : Answer relevance unspecified. |
| /// - "IRRELEVANT" : Answer is irrelevant to query. |
| /// - "RELEVANT" : Answer is relevant to query. |
| core.String? answerRelevance; |
| |
| /// Whether or not the information in the document is correct. |
| /// |
| /// For example: * Query: "Can I return the package in 2 days once received?" |
| /// * Suggested document says: "Items must be returned/exchanged within 60 |
| /// days of the purchase date." * Ground truth: "No return or exchange is |
| /// allowed." * \[document_correctness\]: INCORRECT |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "DOCUMENT_CORRECTNESS_UNSPECIFIED" : Document correctness unspecified. |
| /// - "INCORRECT" : Information in document is incorrect. |
| /// - "CORRECT" : Information in document is correct. |
| core.String? documentCorrectness; |
| |
| /// Whether or not the suggested document is efficient. |
| /// |
| /// For example, if the document is poorly written, hard to understand, hard |
| /// to use or too long to find useful information, document_efficiency is |
| /// DocumentEfficiency.INEFFICIENT. |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "DOCUMENT_EFFICIENCY_UNSPECIFIED" : Document efficiency unspecified. |
| /// - "INEFFICIENT" : Document is inefficient. |
| /// - "EFFICIENT" : Document is efficient. |
| core.String? documentEfficiency; |
| |
| GoogleCloudDialogflowV2AgentAssistantFeedback({ |
| this.answerRelevance, |
| this.documentCorrectness, |
| this.documentEfficiency, |
| }); |
| |
| GoogleCloudDialogflowV2AgentAssistantFeedback.fromJson(core.Map _json) |
| : this( |
| answerRelevance: _json.containsKey('answerRelevance') |
| ? _json['answerRelevance'] as core.String |
| : null, |
| documentCorrectness: _json.containsKey('documentCorrectness') |
| ? _json['documentCorrectness'] as core.String |
| : null, |
| documentEfficiency: _json.containsKey('documentEfficiency') |
| ? _json['documentEfficiency'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (answerRelevance != null) 'answerRelevance': answerRelevance!, |
| if (documentCorrectness != null) |
| 'documentCorrectness': documentCorrectness!, |
| if (documentEfficiency != null) |
| 'documentEfficiency': documentEfficiency!, |
| }; |
| } |
| |
| /// Represents a record of a human agent assist answer. |
| class GoogleCloudDialogflowV2AgentAssistantRecord { |
| /// The article suggestion answer. |
| /// |
| /// Output only. |
| GoogleCloudDialogflowV2ArticleAnswer? articleSuggestionAnswer; |
| |
| /// The FAQ answer. |
| /// |
| /// Output only. |
| GoogleCloudDialogflowV2FaqAnswer? faqAnswer; |
| |
| GoogleCloudDialogflowV2AgentAssistantRecord({ |
| this.articleSuggestionAnswer, |
| this.faqAnswer, |
| }); |
| |
| GoogleCloudDialogflowV2AgentAssistantRecord.fromJson(core.Map _json) |
| : this( |
| articleSuggestionAnswer: _json.containsKey('articleSuggestionAnswer') |
| ? GoogleCloudDialogflowV2ArticleAnswer.fromJson( |
| _json['articleSuggestionAnswer'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| faqAnswer: _json.containsKey('faqAnswer') |
| ? GoogleCloudDialogflowV2FaqAnswer.fromJson( |
| _json['faqAnswer'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (articleSuggestionAnswer != null) |
| 'articleSuggestionAnswer': articleSuggestionAnswer!.toJson(), |
| if (faqAnswer != null) 'faqAnswer': faqAnswer!.toJson(), |
| }; |
| } |
| |
| /// The request message for Participants.AnalyzeContent. |
| class GoogleCloudDialogflowV2AnalyzeContentRequest { |
| /// An input event to send to Dialogflow. |
| GoogleCloudDialogflowV2EventInput? eventInput; |
| |
| /// Parameters for a Dialogflow virtual-agent query. |
| GoogleCloudDialogflowV2QueryParameters? queryParams; |
| |
| /// Speech synthesis configuration. |
| /// |
| /// The speech synthesis settings for a virtual agent that may be configured |
| /// for the associated conversation profile are not used when calling |
| /// AnalyzeContent. If this configuration is not supplied, speech synthesis is |
| /// disabled. |
| GoogleCloudDialogflowV2OutputAudioConfig? replyAudioConfig; |
| |
| /// A unique identifier for this request. |
| /// |
| /// Restricted to 36 ASCII characters. A random UUID is recommended. This |
| /// request is only idempotent if a `request_id` is provided. |
| core.String? requestId; |
| |
| /// The natural language text to be processed. |
| GoogleCloudDialogflowV2TextInput? textInput; |
| |
| GoogleCloudDialogflowV2AnalyzeContentRequest({ |
| this.eventInput, |
| this.queryParams, |
| this.replyAudioConfig, |
| this.requestId, |
| this.textInput, |
| }); |
| |
| GoogleCloudDialogflowV2AnalyzeContentRequest.fromJson(core.Map _json) |
| : this( |
| eventInput: _json.containsKey('eventInput') |
| ? GoogleCloudDialogflowV2EventInput.fromJson( |
| _json['eventInput'] as core.Map<core.String, core.dynamic>) |
| : null, |
| queryParams: _json.containsKey('queryParams') |
| ? GoogleCloudDialogflowV2QueryParameters.fromJson( |
| _json['queryParams'] as core.Map<core.String, core.dynamic>) |
| : null, |
| replyAudioConfig: _json.containsKey('replyAudioConfig') |
| ? GoogleCloudDialogflowV2OutputAudioConfig.fromJson( |
| _json['replyAudioConfig'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| requestId: _json.containsKey('requestId') |
| ? _json['requestId'] as core.String |
| : null, |
| textInput: _json.containsKey('textInput') |
| ? GoogleCloudDialogflowV2TextInput.fromJson( |
| _json['textInput'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (eventInput != null) 'eventInput': eventInput!.toJson(), |
| if (queryParams != null) 'queryParams': queryParams!.toJson(), |
| if (replyAudioConfig != null) |
| 'replyAudioConfig': replyAudioConfig!.toJson(), |
| if (requestId != null) 'requestId': requestId!, |
| if (textInput != null) 'textInput': textInput!.toJson(), |
| }; |
| } |
| |
| /// The response message for Participants.AnalyzeContent. |
| class GoogleCloudDialogflowV2AnalyzeContentResponse { |
| /// Only set if a Dialogflow automated agent has responded. |
| /// |
| /// Note that: AutomatedAgentReply.detect_intent_response.output_audio and |
| /// AutomatedAgentReply.detect_intent_response.output_audio_config are always |
| /// empty, use reply_audio instead. |
| GoogleCloudDialogflowV2AutomatedAgentReply? automatedAgentReply; |
| |
| /// Indicates the parameters of DTMF. |
| GoogleCloudDialogflowV2DtmfParameters? dtmfParameters; |
| |
| /// The suggestions for end user. |
| /// |
| /// The order is the same as |
| /// HumanAgentAssistantConfig.SuggestionConfig.feature_configs of |
| /// HumanAgentAssistantConfig.end_user_suggestion_config. |
| core.List<GoogleCloudDialogflowV2SuggestionResult>? endUserSuggestionResults; |
| |
| /// The suggestions for most recent human agent. |
| /// |
| /// The order is the same as |
| /// HumanAgentAssistantConfig.SuggestionConfig.feature_configs of |
| /// HumanAgentAssistantConfig.human_agent_suggestion_config. |
| core.List<GoogleCloudDialogflowV2SuggestionResult>? |
| humanAgentSuggestionResults; |
| |
| /// Message analyzed by CCAI. |
| GoogleCloudDialogflowV2Message? message; |
| |
| /// The audio data bytes encoded as specified in the request. |
| /// |
| /// This field is set if: - `reply_audio_config` was specified in the request, |
| /// or - The automated agent responded with audio to play to the user. In such |
| /// case, `reply_audio.config` contains settings used to synthesize the |
| /// speech. In some scenarios, multiple output audio fields may be present in |
| /// the response structure. In these cases, only the top-most-level audio |
| /// output has content. |
| GoogleCloudDialogflowV2OutputAudio? replyAudio; |
| |
| /// The output text content. |
| /// |
| /// This field is set if the automated agent responded with text to show to |
| /// the user. |
| core.String? replyText; |
| |
| GoogleCloudDialogflowV2AnalyzeContentResponse({ |
| this.automatedAgentReply, |
| this.dtmfParameters, |
| this.endUserSuggestionResults, |
| this.humanAgentSuggestionResults, |
| this.message, |
| this.replyAudio, |
| this.replyText, |
| }); |
| |
| GoogleCloudDialogflowV2AnalyzeContentResponse.fromJson(core.Map _json) |
| : this( |
| automatedAgentReply: _json.containsKey('automatedAgentReply') |
| ? GoogleCloudDialogflowV2AutomatedAgentReply.fromJson( |
| _json['automatedAgentReply'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| dtmfParameters: _json.containsKey('dtmfParameters') |
| ? GoogleCloudDialogflowV2DtmfParameters.fromJson( |
| _json['dtmfParameters'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| endUserSuggestionResults: |
| _json.containsKey('endUserSuggestionResults') |
| ? (_json['endUserSuggestionResults'] as core.List) |
| .map<GoogleCloudDialogflowV2SuggestionResult>((value) => |
| GoogleCloudDialogflowV2SuggestionResult.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| humanAgentSuggestionResults: |
| _json.containsKey('humanAgentSuggestionResults') |
| ? (_json['humanAgentSuggestionResults'] as core.List) |
| .map<GoogleCloudDialogflowV2SuggestionResult>((value) => |
| GoogleCloudDialogflowV2SuggestionResult.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| message: _json.containsKey('message') |
| ? GoogleCloudDialogflowV2Message.fromJson( |
| _json['message'] as core.Map<core.String, core.dynamic>) |
| : null, |
| replyAudio: _json.containsKey('replyAudio') |
| ? GoogleCloudDialogflowV2OutputAudio.fromJson( |
| _json['replyAudio'] as core.Map<core.String, core.dynamic>) |
| : null, |
| replyText: _json.containsKey('replyText') |
| ? _json['replyText'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (automatedAgentReply != null) |
| 'automatedAgentReply': automatedAgentReply!.toJson(), |
| if (dtmfParameters != null) 'dtmfParameters': dtmfParameters!.toJson(), |
| if (endUserSuggestionResults != null) |
| 'endUserSuggestionResults': |
| endUserSuggestionResults!.map((value) => value.toJson()).toList(), |
| if (humanAgentSuggestionResults != null) |
| 'humanAgentSuggestionResults': humanAgentSuggestionResults! |
| .map((value) => value.toJson()) |
| .toList(), |
| if (message != null) 'message': message!.toJson(), |
| if (replyAudio != null) 'replyAudio': replyAudio!.toJson(), |
| if (replyText != null) 'replyText': replyText!, |
| }; |
| } |
| |
| /// Represents a part of a message possibly annotated with an entity. |
| /// |
| /// The part can be an entity or purely a part of the message between two |
| /// entities or message start/end. |
| class GoogleCloudDialogflowV2AnnotatedMessagePart { |
| /// The |
| /// [Dialogflow system entity type](https://cloud.google.com/dialogflow/docs/reference/system-entities) |
| /// of this message part. |
| /// |
| /// If this is empty, Dialogflow could not annotate the phrase part with a |
| /// system entity. |
| core.String? entityType; |
| |
| /// The |
| /// [Dialogflow system entity formatted value ](https://cloud.google.com/dialogflow/docs/reference/system-entities) |
| /// of this message part. |
| /// |
| /// For example for a system entity of type `@sys.unit-currency`, this may |
| /// contain: { "amount": 5, "currency": "USD" } |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Object? formattedValue; |
| |
| /// A part of a message possibly annotated with an entity. |
| core.String? text; |
| |
| GoogleCloudDialogflowV2AnnotatedMessagePart({ |
| this.entityType, |
| this.formattedValue, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowV2AnnotatedMessagePart.fromJson(core.Map _json) |
| : this( |
| entityType: _json.containsKey('entityType') |
| ? _json['entityType'] as core.String |
| : null, |
| formattedValue: _json.containsKey('formattedValue') |
| ? _json['formattedValue'] as core.Object |
| : null, |
| text: _json.containsKey('text') ? _json['text'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (entityType != null) 'entityType': entityType!, |
| if (formattedValue != null) 'formattedValue': formattedValue!, |
| if (text != null) 'text': text!, |
| }; |
| } |
| |
| /// Represents feedback the customer has about the quality & correctness of a |
| /// certain answer in a conversation. |
| class GoogleCloudDialogflowV2AnswerFeedback { |
| /// Detail feedback of agent assist suggestions. |
| GoogleCloudDialogflowV2AgentAssistantFeedback? agentAssistantDetailFeedback; |
| |
| /// Time when the answer/item was clicked. |
| core.String? clickTime; |
| |
| /// Indicates whether the answer/item was clicked by the human agent or not. |
| /// |
| /// Default to false. |
| core.bool? clicked; |
| |
| /// The correctness level of the specific answer. |
| /// Possible string values are: |
| /// - "CORRECTNESS_LEVEL_UNSPECIFIED" : Correctness level unspecified. |
| /// - "NOT_CORRECT" : Answer is totally wrong. |
| /// - "PARTIALLY_CORRECT" : Answer is partially correct. |
| /// - "FULLY_CORRECT" : Answer is fully correct. |
| core.String? correctnessLevel; |
| |
| /// Time when the answer/item was displayed. |
| core.String? displayTime; |
| |
| /// Indicates whether the answer/item was displayed to the human agent in the |
| /// agent desktop UI. |
| /// |
| /// Default to false. |
| core.bool? displayed; |
| |
| GoogleCloudDialogflowV2AnswerFeedback({ |
| this.agentAssistantDetailFeedback, |
| this.clickTime, |
| this.clicked, |
| this.correctnessLevel, |
| this.displayTime, |
| this.displayed, |
| }); |
| |
| GoogleCloudDialogflowV2AnswerFeedback.fromJson(core.Map _json) |
| : this( |
| agentAssistantDetailFeedback: |
| _json.containsKey('agentAssistantDetailFeedback') |
| ? GoogleCloudDialogflowV2AgentAssistantFeedback.fromJson( |
| _json['agentAssistantDetailFeedback'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| clickTime: _json.containsKey('clickTime') |
| ? _json['clickTime'] as core.String |
| : null, |
| clicked: _json.containsKey('clicked') |
| ? _json['clicked'] as core.bool |
| : null, |
| correctnessLevel: _json.containsKey('correctnessLevel') |
| ? _json['correctnessLevel'] as core.String |
| : null, |
| displayTime: _json.containsKey('displayTime') |
| ? _json['displayTime'] as core.String |
| : null, |
| displayed: _json.containsKey('displayed') |
| ? _json['displayed'] as core.bool |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (agentAssistantDetailFeedback != null) |
| 'agentAssistantDetailFeedback': |
| agentAssistantDetailFeedback!.toJson(), |
| if (clickTime != null) 'clickTime': clickTime!, |
| if (clicked != null) 'clicked': clicked!, |
| if (correctnessLevel != null) 'correctnessLevel': correctnessLevel!, |
| if (displayTime != null) 'displayTime': displayTime!, |
| if (displayed != null) 'displayed': displayed!, |
| }; |
| } |
| |
| /// Answer records are records to manage answer history and feedbacks for |
| /// Dialogflow. |
| /// |
| /// Currently, answer record includes: - human agent assistant article |
| /// suggestion - human agent assistant faq article It doesn't include: - |
| /// `DetectIntent` intent matching - `DetectIntent` knowledge Answer records are |
| /// not related to the conversation history in the Dialogflow Console. A Record |
| /// is generated even when the end-user disables conversation history in the |
| /// console. Records are created when there's a human agent assistant suggestion |
| /// generated. A typical workflow for customers provide feedback to an answer |
| /// is: 1. For human agent assistant, customers get suggestion via |
| /// ListSuggestions API. Together with the answers, AnswerRecord.name are |
| /// returned to the customers. 2. The customer uses the AnswerRecord.name to |
| /// call the UpdateAnswerRecord method to send feedback about a specific answer |
| /// that they believe is wrong. |
| class GoogleCloudDialogflowV2AnswerRecord { |
| /// The record for human agent assistant. |
| /// |
| /// Output only. |
| GoogleCloudDialogflowV2AgentAssistantRecord? agentAssistantRecord; |
| |
| /// The AnswerFeedback for this record. |
| /// |
| /// You can set this with AnswerRecords.UpdateAnswerRecord in order to give us |
| /// feedback about this answer. |
| /// |
| /// Required. |
| GoogleCloudDialogflowV2AnswerFeedback? answerFeedback; |
| |
| /// The unique identifier of this answer record. |
| /// |
| /// Format: `projects//locations//answerRecords/`. |
| core.String? name; |
| |
| GoogleCloudDialogflowV2AnswerRecord({ |
| this.agentAssistantRecord, |
| this.answerFeedback, |
| this.name, |
| }); |
| |
| GoogleCloudDialogflowV2AnswerRecord.fromJson(core.Map _json) |
| : this( |
| agentAssistantRecord: _json.containsKey('agentAssistantRecord') |
| ? GoogleCloudDialogflowV2AgentAssistantRecord.fromJson( |
| _json['agentAssistantRecord'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| answerFeedback: _json.containsKey('answerFeedback') |
| ? GoogleCloudDialogflowV2AnswerFeedback.fromJson( |
| _json['answerFeedback'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (agentAssistantRecord != null) |
| 'agentAssistantRecord': agentAssistantRecord!.toJson(), |
| if (answerFeedback != null) 'answerFeedback': answerFeedback!.toJson(), |
| if (name != null) 'name': name!, |
| }; |
| } |
| |
| /// Represents article answer. |
| class GoogleCloudDialogflowV2ArticleAnswer { |
| /// The name of answer record, in the format of |
| /// "projects//locations//answerRecords/" |
| core.String? answerRecord; |
| |
| /// Article match confidence. |
| /// |
| /// The system's confidence score that this article is a good match for this |
| /// conversation, as a value from 0.0 (completely uncertain) to 1.0 |
| /// (completely certain). |
| core.double? confidence; |
| |
| /// A map that contains metadata about the answer and the document from which |
| /// it originates. |
| core.Map<core.String, core.String>? metadata; |
| |
| /// Article snippets. |
| core.List<core.String>? snippets; |
| |
| /// The article title. |
| core.String? title; |
| |
| /// The article URI. |
| core.String? uri; |
| |
| GoogleCloudDialogflowV2ArticleAnswer({ |
| this.answerRecord, |
| this.confidence, |
| this.metadata, |
| this.snippets, |
| this.title, |
| this.uri, |
| }); |
| |
| GoogleCloudDialogflowV2ArticleAnswer.fromJson(core.Map _json) |
| : this( |
| answerRecord: _json.containsKey('answerRecord') |
| ? _json['answerRecord'] as core.String |
| : null, |
| confidence: _json.containsKey('confidence') |
| ? (_json['confidence'] as core.num).toDouble() |
| : null, |
| metadata: _json.containsKey('metadata') |
| ? (_json['metadata'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.String, |
| ), |
| ) |
| : null, |
| snippets: _json.containsKey('snippets') |
| ? (_json['snippets'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| uri: _json.containsKey('uri') ? _json['uri'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (answerRecord != null) 'answerRecord': answerRecord!, |
| if (confidence != null) 'confidence': confidence!, |
| if (metadata != null) 'metadata': metadata!, |
| if (snippets != null) 'snippets': snippets!, |
| if (title != null) 'title': title!, |
| if (uri != null) 'uri': uri!, |
| }; |
| } |
| |
| /// Defines the Automated Agent to connect to a conversation. |
| class GoogleCloudDialogflowV2AutomatedAgentConfig { |
| /// ID of the Dialogflow agent environment to use. |
| /// |
| /// This project needs to either be the same project as the conversation or |
| /// you need to grant `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the |
| /// `Dialogflow API Service Agent` role in this project. Format: |
| /// `projects//locations//agent/environments/`. If environment is not |
| /// specified, the default `draft` environment is used. Refer to |
| /// \[DetectIntentRequest\](/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentRequest) |
| /// for more details. |
| /// |
| /// Required. |
| core.String? agent; |
| |
| GoogleCloudDialogflowV2AutomatedAgentConfig({ |
| this.agent, |
| }); |
| |
| GoogleCloudDialogflowV2AutomatedAgentConfig.fromJson(core.Map _json) |
| : this( |
| agent: |
| _json.containsKey('agent') ? _json['agent'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (agent != null) 'agent': agent!, |
| }; |
| } |
| |
| /// Represents a response from an automated agent. |
| class GoogleCloudDialogflowV2AutomatedAgentReply { |
| /// Indicates whether the partial automated agent reply is interruptible when |
| /// a later reply message arrives. |
| /// |
| /// e.g. if the agent specified some music as partial response, it can be |
| /// cancelled. |
| core.bool? allowCancellation; |
| |
| /// AutomatedAgentReply type. |
| /// Possible string values are: |
| /// - "AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED" : Not specified. This should |
| /// never happen. |
| /// - "PARTIAL" : Partial reply. e.g. Aggregated responses in a `Fulfillment` |
| /// that enables `return_partial_response` can be returned as partial reply. |
| /// WARNING: partial reply is not eligible for barge-in. |
| /// - "FINAL" : Final reply. |
| core.String? automatedAgentReplyType; |
| |
| /// Response of the Dialogflow Sessions.DetectIntent call. |
| GoogleCloudDialogflowV2DetectIntentResponse? detectIntentResponse; |
| |
| GoogleCloudDialogflowV2AutomatedAgentReply({ |
| this.allowCancellation, |
| this.automatedAgentReplyType, |
| this.detectIntentResponse, |
| }); |
| |
| GoogleCloudDialogflowV2AutomatedAgentReply.fromJson(core.Map _json) |
| : this( |
| allowCancellation: _json.containsKey('allowCancellation') |
| ? _json['allowCancellation'] as core.bool |
| : null, |
| automatedAgentReplyType: _json.containsKey('automatedAgentReplyType') |
| ? _json['automatedAgentReplyType'] as core.String |
| : null, |
| detectIntentResponse: _json.containsKey('detectIntentResponse') |
| ? GoogleCloudDialogflowV2DetectIntentResponse.fromJson( |
| _json['detectIntentResponse'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (allowCancellation != null) 'allowCancellation': allowCancellation!, |
| if (automatedAgentReplyType != null) |
| 'automatedAgentReplyType': automatedAgentReplyType!, |
| if (detectIntentResponse != null) |
| 'detectIntentResponse': detectIntentResponse!.toJson(), |
| }; |
| } |
| |
| /// The request message for EntityTypes.BatchCreateEntities. |
| class GoogleCloudDialogflowV2BatchCreateEntitiesRequest { |
| /// The entities to create. |
| /// |
| /// Required. |
| core.List<GoogleCloudDialogflowV2EntityTypeEntity>? entities; |
| |
| /// The language used to access language-specific data. |
| /// |
| /// If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// Optional. |
| core.String? languageCode; |
| |
| GoogleCloudDialogflowV2BatchCreateEntitiesRequest({ |
| this.entities, |
| this.languageCode, |
| }); |
| |
| GoogleCloudDialogflowV2BatchCreateEntitiesRequest.fromJson(core.Map _json) |
| : this( |
| entities: _json.containsKey('entities') |
| ? (_json['entities'] as core.List) |
| .map<GoogleCloudDialogflowV2EntityTypeEntity>((value) => |
| GoogleCloudDialogflowV2EntityTypeEntity.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| languageCode: _json.containsKey('languageCode') |
| ? _json['languageCode'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (entities != null) |
| 'entities': entities!.map((value) => value.toJson()).toList(), |
| if (languageCode != null) 'languageCode': languageCode!, |
| }; |
| } |
| |
| /// The request message for EntityTypes.BatchDeleteEntities. |
| class GoogleCloudDialogflowV2BatchDeleteEntitiesRequest { |
| /// The reference `values` of the entities to delete. |
| /// |
| /// Note that these are not fully-qualified names, i.e. they don't start with |
| /// `projects/`. |
| /// |
| /// Required. |
| core.List<core.String>? entityValues; |
| |
| /// The language used to access language-specific data. |
| /// |
| /// If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// Optional. |
| core.String? languageCode; |
| |
| GoogleCloudDialogflowV2BatchDeleteEntitiesRequest({ |
| this.entityValues, |
| this.languageCode, |
| }); |
| |
| GoogleCloudDialogflowV2BatchDeleteEntitiesRequest.fromJson(core.Map _json) |
| : this( |
| entityValues: _json.containsKey('entityValues') |
| ? (_json['entityValues'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| languageCode: _json.containsKey('languageCode') |
| ? _json['languageCode'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (entityValues != null) 'entityValues': entityValues!, |
| if (languageCode != null) 'languageCode': languageCode!, |
| }; |
| } |
| |
| /// The request message for EntityTypes.BatchDeleteEntityTypes. |
| class GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest { |
| /// The names entity types to delete. |
| /// |
| /// All names must point to the same agent as `parent`. |
| /// |
| /// Required. |
| core.List<core.String>? entityTypeNames; |
| |
| GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest({ |
| this.entityTypeNames, |
| }); |
| |
| GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest.fromJson(core.Map _json) |
| : this( |
| entityTypeNames: _json.containsKey('entityTypeNames') |
| ? (_json['entityTypeNames'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (entityTypeNames != null) 'entityTypeNames': entityTypeNames!, |
| }; |
| } |
| |
| /// The request message for Intents.BatchDeleteIntents. |
| class GoogleCloudDialogflowV2BatchDeleteIntentsRequest { |
| /// The collection of intents to delete. |
| /// |
| /// Only intent `name` must be filled in. |
| /// |
| /// Required. |
| core.List<GoogleCloudDialogflowV2Intent>? intents; |
| |
| GoogleCloudDialogflowV2BatchDeleteIntentsRequest({ |
| this.intents, |
| }); |
| |
| GoogleCloudDialogflowV2BatchDeleteIntentsRequest.fromJson(core.Map _json) |
| : this( |
| intents: _json.containsKey('intents') |
| ? (_json['intents'] as core.List) |
| .map<GoogleCloudDialogflowV2Intent>((value) => |
| GoogleCloudDialogflowV2Intent.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (intents != null) |
| 'intents': intents!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// The request message for EntityTypes.BatchUpdateEntities. |
| class GoogleCloudDialogflowV2BatchUpdateEntitiesRequest { |
| /// The entities to update or create. |
| /// |
| /// Required. |
| core.List<GoogleCloudDialogflowV2EntityTypeEntity>? entities; |
| |
| /// The language used to access language-specific data. |
| /// |
| /// If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// Optional. |
| core.String? languageCode; |
| |
| /// The mask to control which fields get updated. |
| /// |
| /// Optional. |
| core.String? updateMask; |
| |
| GoogleCloudDialogflowV2BatchUpdateEntitiesRequest({ |
| this.entities, |
| this.languageCode, |
| this.updateMask, |
| }); |
| |
| GoogleCloudDialogflowV2BatchUpdateEntitiesRequest.fromJson(core.Map _json) |
| : this( |
| entities: _json.containsKey('entities') |
| ? (_json['entities'] as core.List) |
| .map<GoogleCloudDialogflowV2EntityTypeEntity>((value) => |
| GoogleCloudDialogflowV2EntityTypeEntity.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| languageCode: _json.containsKey('languageCode') |
| ? _json['languageCode'] as core.String |
| : null, |
| updateMask: _json.containsKey('updateMask') |
| ? _json['updateMask'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (entities != null) |
| 'entities': entities!.map((value) => value.toJson()).toList(), |
| if (languageCode != null) 'languageCode': languageCode!, |
| if (updateMask != null) 'updateMask': updateMask!, |
| }; |
| } |
| |
| /// The request message for EntityTypes.BatchUpdateEntityTypes. |
| class GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest { |
| /// The collection of entity types to update or create. |
| GoogleCloudDialogflowV2EntityTypeBatch? entityTypeBatchInline; |
| |
| /// The URI to a Google Cloud Storage file containing entity types to update |
| /// or create. |
| /// |
| /// The file format can either be a serialized proto (of EntityBatch type) or |
| /// a JSON object. Note: The URI must start with "gs://". |
| core.String? entityTypeBatchUri; |
| |
| /// The language used to access language-specific data. |
| /// |
| /// If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// Optional. |
| core.String? languageCode; |
| |
| /// The mask to control which fields get updated. |
| /// |
| /// Optional. |
| core.String? updateMask; |
| |
| GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest({ |
| this.entityTypeBatchInline, |
| this.entityTypeBatchUri, |
| this.languageCode, |
| this.updateMask, |
| }); |
| |
| GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest.fromJson(core.Map _json) |
| : this( |
| entityTypeBatchInline: _json.containsKey('entityTypeBatchInline') |
| ? GoogleCloudDialogflowV2EntityTypeBatch.fromJson( |
| _json['entityTypeBatchInline'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| entityTypeBatchUri: _json.containsKey('entityTypeBatchUri') |
| ? _json['entityTypeBatchUri'] as core.String |
| : null, |
| languageCode: _json.containsKey('languageCode') |
| ? _json['languageCode'] as core.String |
| : null, |
| updateMask: _json.containsKey('updateMask') |
| ? _json['updateMask'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (entityTypeBatchInline != null) |
| 'entityTypeBatchInline': entityTypeBatchInline!.toJson(), |
| if (entityTypeBatchUri != null) |
| 'entityTypeBatchUri': entityTypeBatchUri!, |
| if (languageCode != null) 'languageCode': languageCode!, |
| if (updateMask != null) 'updateMask': updateMask!, |
| }; |
| } |
| |
| /// The response message for EntityTypes.BatchUpdateEntityTypes. |
| class GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse { |
| /// The collection of updated or created entity types. |
| core.List<GoogleCloudDialogflowV2EntityType>? entityTypes; |
| |
| GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse({ |
| this.entityTypes, |
| }); |
| |
| GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse.fromJson(core.Map _json) |
| : this( |
| entityTypes: _json.containsKey('entityTypes') |
| ? (_json['entityTypes'] as core.List) |
| .map<GoogleCloudDialogflowV2EntityType>((value) => |
| GoogleCloudDialogflowV2EntityType.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (entityTypes != null) |
| 'entityTypes': entityTypes!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| class GoogleCloudDialogflowV2BatchUpdateIntentsRequest { |
| /// The collection of intents to update or create. |
| GoogleCloudDialogflowV2IntentBatch? intentBatchInline; |
| |
| /// The URI to a Google Cloud Storage file containing intents to update or |
| /// create. |
| /// |
| /// The file format can either be a serialized proto (of IntentBatch type) or |
| /// JSON object. Note: The URI must start with "gs://". |
| core.String? intentBatchUri; |
| |
| /// The resource view to apply to the returned intent. |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "INTENT_VIEW_UNSPECIFIED" : Training phrases field is not populated in |
| /// the response. |
| /// - "INTENT_VIEW_FULL" : All fields are populated. |
| core.String? intentView; |
| |
| /// The language used to access language-specific data. |
| /// |
| /// If not specified, the agent's default language is used. For more |
| /// information, see |
| /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). |
| /// |
| /// Optional. |
| core.String? languageCode; |
| |
| /// The mask to control which fields get updated. |
| /// |
| /// Optional. |
| core.String? updateMask; |
| |
| GoogleCloudDialogflowV2BatchUpdateIntentsRequest({ |
| this.intentBatchInline, |
| this.intentBatchUri, |
| this.intentView, |
| this.languageCode, |
| this.updateMask, |
| }); |
| |
| GoogleCloudDialogflowV2BatchUpdateIntentsRequest.fromJson(core.Map _json) |
| : this( |
| intentBatchInline: _json.containsKey('intentBatchInline') |
| ? GoogleCloudDialogflowV2IntentBatch.fromJson( |
| _json['intentBatchInline'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| intentBatchUri: _json.containsKey('intentBatchUri') |
| ? _json['intentBatchUri'] as core.String |
| : null, |
| intentView: _json.containsKey('intentView') |
| ? _json['intentView'] as core.String |
| : null, |
| languageCode: _json.containsKey('languageCode') |
| ? _json['languageCode'] as core.String |
| : null, |
| updateMask: _json.containsKey('updateMask') |
| ? _json['updateMask'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (intentBatchInline != null) |
| 'intentBatchInline': intentBatchInline!.toJson(), |
| if (intentBatchUri != null) 'intentBatchUri': intentBatchUri!, |
| if (intentView != null) 'intentView': intentView!, |
| if (languageCode != null) 'languageCode': languageCode!, |
| if (updateMask != null) 'updateMask': updateMask!, |
| }; |
| } |
| |
| /// The response message for Intents.BatchUpdateIntents. |
| class GoogleCloudDialogflowV2BatchUpdateIntentsResponse { |
| /// The collection of updated or created intents. |
| core.List<GoogleCloudDialogflowV2Intent>? intents; |
| |
| GoogleCloudDialogflowV2BatchUpdateIntentsResponse({ |
| this.intents, |
| }); |
| |
| GoogleCloudDialogflowV2BatchUpdateIntentsResponse.fromJson(core.Map _json) |
| : this( |
| intents: _json.containsKey('intents') |
| ? (_json['intents'] as core.List) |
| .map<GoogleCloudDialogflowV2Intent>((value) => |
| GoogleCloudDialogflowV2Intent.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (intents != null) |
| 'intents': intents!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// The request message for Conversations.CompleteConversation. |
| class GoogleCloudDialogflowV2CompleteConversationRequest { |
| GoogleCloudDialogflowV2CompleteConversationRequest(); |
| |
| GoogleCloudDialogflowV2CompleteConversationRequest.fromJson( |
| // ignore: avoid_unused_constructor_parameters |
| core.Map _json); |
| |
| core.Map<core.String, core.dynamic> toJson() => {}; |
| } |
| |
| /// Dialogflow contexts are similar to natural language context. |
| /// |
| /// If a person says to you "they are orange", you need context in order to |
| /// understand what "they" is referring to. Similarly, for Dialogflow to handle |
| /// an end-user expression like that, it needs to be provided with context in |
| /// order to correctly match an intent. Using contexts, you can control the flow |
| /// of a conversation. You can configure contexts for an intent by setting input |
| /// and output contexts, which are identified by string names. When an intent is |
| /// matched, any configured output contexts for that intent become active. While |
| /// any contexts are active, Dialogflow is more likely to match intents that are |
| /// configured with input contexts that correspond to the currently active |
| /// contexts. For more information about context, see the |
| /// [Contexts guide](https://cloud.google.com/dialogflow/docs/contexts-overview). |
| class GoogleCloudDialogflowV2Context { |
| /// The number of conversational query requests after which the context |
| /// expires. |
| /// |
| /// The default is `0`. If set to `0`, the context expires immediately. |
| /// Contexts expire automatically after 20 minutes if there are no matching |
| /// queries. |
| /// |
| /// Optional. |
| core.int? lifespanCount; |
| |
| /// The unique identifier of the context. |
| /// |
| /// Format: `projects//agent/sessions//contexts/`, or |
| /// `projects//agent/environments//users//sessions//contexts/`. The `Context |
| /// ID` is always converted to lowercase, may only contain characters in |
| /// a-zA-Z0-9_-% and may be at most 250 bytes long. If `Environment ID` is not |
| /// specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. The following context names are |
| /// reserved for internal use by Dialogflow. You should not use these contexts |
| /// or create contexts with these names: * `__system_counters__` * |
| /// `*_id_dialog_context` * `*_dialog_params_size` |
| /// |
| /// Required. |
| core.String? name; |
| |
| /// The collection of parameters associated with this context. |
| /// |
| /// Depending on your protocol or client library language, this is a map, |
| /// associative array, symbol table, dictionary, or JSON object composed of a |
| /// collection of (MapKey, MapValue) pairs: - MapKey type: string - MapKey |
| /// value: parameter name - MapValue type: - If parameter's entity type is a |
| /// composite entity: map - Else: depending on parameter value type, could be |
| /// one of string, number, boolean, null, list or map - MapValue value: - If |
| /// parameter's entity type is a composite entity: map from composite entity |
| /// property names to property values - Else: parameter value |
| /// |
| /// Optional. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? parameters; |
| |
| GoogleCloudDialogflowV2Context({ |
| this.lifespanCount, |
| this.name, |
| this.parameters, |
| }); |
| |
| GoogleCloudDialogflowV2Context.fromJson(core.Map _json) |
| : this( |
| lifespanCount: _json.containsKey('lifespanCount') |
| ? _json['lifespanCount'] as core.int |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| parameters: _json.containsKey('parameters') |
| ? (_json['parameters'] as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (lifespanCount != null) 'lifespanCount': lifespanCount!, |
| if (name != null) 'name': name!, |
| if (parameters != null) 'parameters': parameters!, |
| }; |
| } |
| |
| /// Represents a conversation. |
| /// |
| /// A conversation is an interaction between an agent, including live agents and |
| /// Dialogflow agents, and a support customer. Conversations can include phone |
| /// calls and text-based chat sessions. |
| class GoogleCloudDialogflowV2Conversation { |
| /// The Conversation Profile to be used to configure this Conversation. |
| /// |
| /// This field cannot be updated. Format: |
| /// `projects//locations//conversationProfiles/`. |
| /// |
| /// Required. |
| core.String? conversationProfile; |
| |
| /// The stage of a conversation. |
| /// |
| /// It indicates whether the virtual agent or a human agent is handling the |
| /// conversation. If the conversation is created with the conversation profile |
| /// that has Dialogflow config set, defaults to |
| /// ConversationStage.VIRTUAL_AGENT_STAGE; Otherwise, defaults to |
| /// ConversationStage.HUMAN_ASSIST_STAGE. If the conversation is created with |
| /// the conversation profile that has Dialogflow config set but explicitly |
| /// sets conversation_stage to ConversationStage.HUMAN_ASSIST_STAGE, it skips |
| /// ConversationStage.VIRTUAL_AGENT_STAGE stage and directly goes to |
| /// ConversationStage.HUMAN_ASSIST_STAGE. |
| /// Possible string values are: |
| /// - "CONVERSATION_STAGE_UNSPECIFIED" : Unknown. Should never be used after a |
| /// conversation is successfully created. |
| /// - "VIRTUAL_AGENT_STAGE" : The conversation should return virtual agent |
| /// responses into the conversation. |
| /// - "HUMAN_ASSIST_STAGE" : The conversation should not provide responses, |
| /// just listen and provide suggestions. |
| core.String? conversationStage; |
| |
| /// The time the conversation was finished. |
| /// |
| /// Output only. |
| core.String? endTime; |
| |
| /// The current state of the Conversation. |
| /// |
| /// Output only. |
| /// Possible string values are: |
| /// - "LIFECYCLE_STATE_UNSPECIFIED" : Unknown. |
| /// - "IN_PROGRESS" : Conversation is currently open for media analysis. |
| /// - "COMPLETED" : Conversation has been completed. |
| core.String? lifecycleState; |
| |
| /// The unique identifier of this conversation. |
| /// |
| /// Format: `projects//locations//conversations/`. |
| /// |
| /// Output only. |
| core.String? name; |
| |
| /// It will not be empty if the conversation is to be connected over |
| /// telephony. |
| /// |
| /// Output only. |
| GoogleCloudDialogflowV2ConversationPhoneNumber? phoneNumber; |
| |
| /// The time the conversation was started. |
| /// |
| /// Output only. |
| core.String? startTime; |
| |
| GoogleCloudDialogflowV2Conversation({ |
| this.conversationProfile, |
| this.conversationStage, |
| this.endTime, |
| this.lifecycleState, |
| this.name, |
| this.phoneNumber, |
| this.startTime, |
| }); |
| |
| GoogleCloudDialogflowV2Conversation.fromJson(core.Map _json) |
| : this( |
| conversationProfile: _json.containsKey('conversationProfile') |
| ? _json['conversationProfile'] as core.String |
| : null, |
| conversationStage: _json.containsKey('conversationStage') |
| ? _json['conversationStage'] as core.String |
| : null, |
| endTime: _json.containsKey('endTime') |
| ? _json['endTime'] as core.String |
| : null, |
| lifecycleState: _json.containsKey('lifecycleState') |
| ? _json['lifecycleState'] as core.String |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| phoneNumber: _json.containsKey('phoneNumber') |
| ? GoogleCloudDialogflowV2ConversationPhoneNumber.fromJson( |
| _json['phoneNumber'] as core.Map<core.String, core.dynamic>) |
| : null, |
| startTime: _json.containsKey('startTime') |
| ? _json['startTime'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (conversationProfile != null) |
| 'conversationProfile': conversationProfile!, |
| if (conversationStage != null) 'conversationStage': conversationStage!, |
| if (endTime != null) 'endTime': endTime!, |
| if (lifecycleState != null) 'lifecycleState': lifecycleState!, |
| if (name != null) 'name': name!, |
| if (phoneNumber != null) 'phoneNumber': phoneNumber!.toJson(), |
| if (startTime != null) 'startTime': startTime!, |
| }; |
| } |
| |
| /// Represents a notification sent to Pub/Sub subscribers for conversation |
| /// lifecycle events. |
| class GoogleCloudDialogflowV2ConversationEvent { |
| /// The unique identifier of the conversation this notification refers to. |
| /// |
| /// Format: `projects//conversations/`. |
| core.String? conversation; |
| |
| /// More detailed information about an error. |
| /// |
| /// Only set for type UNRECOVERABLE_ERROR_IN_PHONE_CALL. |
| GoogleRpcStatus? errorStatus; |
| |
| /// Payload of NEW_MESSAGE event. |
| GoogleCloudDialogflowV2Message? newMessagePayload; |
| |
| /// The type of the event that this notification refers to. |
| /// Possible string values are: |
| /// - "TYPE_UNSPECIFIED" : Type not set. |
| /// - "CONVERSATION_STARTED" : A new conversation has been opened. This is |
| /// fired when a telephone call is answered, or a conversation is created via |
| /// the API. |
| /// - "CONVERSATION_FINISHED" : An existing conversation has closed. This is |
| /// fired when a telephone call is terminated, or a conversation is closed via |
| /// the API. |
| /// - "HUMAN_INTERVENTION_NEEDED" : An existing conversation has received |
| /// notification from Dialogflow that human intervention is required. |
| /// - "NEW_MESSAGE" : An existing conversation has received a new message, |
| /// either from API or telephony. It is configured in |
| /// ConversationProfile.new_message_event_notification_config |
| /// - "UNRECOVERABLE_ERROR" : Unrecoverable error during a telephone call. In |
| /// general non-recoverable errors only occur if something was misconfigured |
| /// in the ConversationProfile corresponding to the call. After a |
| /// non-recoverable error, Dialogflow may stop responding. We don't fire this |
| /// event: * in an API call because we can directly return the error, or, * |
| /// when we can recover from an error. |
| core.String? type; |
| |
| GoogleCloudDialogflowV2ConversationEvent({ |
| this.conversation, |
| this.errorStatus, |
| this.newMessagePayload, |
| this.type, |
| }); |
| |
| GoogleCloudDialogflowV2ConversationEvent.fromJson(core.Map _json) |
| : this( |
| conversation: _json.containsKey('conversation') |
| ? _json['conversation'] as core.String |
| : null, |
| errorStatus: _json.containsKey('errorStatus') |
| ? GoogleRpcStatus.fromJson( |
| _json['errorStatus'] as core.Map<core.String, core.dynamic>) |
| : null, |
| newMessagePayload: _json.containsKey('newMessagePayload') |
| ? GoogleCloudDialogflowV2Message.fromJson( |
| _json['newMessagePayload'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| type: _json.containsKey('type') ? _json['type'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (conversation != null) 'conversation': conversation!, |
| if (errorStatus != null) 'errorStatus': errorStatus!.toJson(), |
| if (newMessagePayload != null) |
| 'newMessagePayload': newMessagePayload!.toJson(), |
| if (type != null) 'type': type!, |
| }; |
| } |
| |
| /// Represents a phone number for telephony integration. |
| /// |
| /// It allows for connecting a particular conversation over telephony. |
| class GoogleCloudDialogflowV2ConversationPhoneNumber { |
| /// The phone number to connect to this conversation. |
| /// |
| /// Output only. |
| core.String? phoneNumber; |
| |
| GoogleCloudDialogflowV2ConversationPhoneNumber({ |
| this.phoneNumber, |
| }); |
| |
| GoogleCloudDialogflowV2ConversationPhoneNumber.fromJson(core.Map _json) |
| : this( |
| phoneNumber: _json.containsKey('phoneNumber') |
| ? _json['phoneNumber'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (phoneNumber != null) 'phoneNumber': phoneNumber!, |
| }; |
| } |
| |
| /// Defines the services to connect to incoming Dialogflow conversations. |
| class GoogleCloudDialogflowV2ConversationProfile { |
| /// Configuration for an automated agent to use with this profile. |
| GoogleCloudDialogflowV2AutomatedAgentConfig? automatedAgentConfig; |
| |
| /// Create time of the conversation profile. |
| /// |
| /// Output only. |
| core.String? createTime; |
| |
| /// Human readable name for this profile. |
| /// |
| /// Max length 1024 bytes. |
| /// |
| /// Required. |
| core.String? displayName; |
| |
| /// Configuration for agent assistance to use with this profile. |
| GoogleCloudDialogflowV2HumanAgentAssistantConfig? humanAgentAssistantConfig; |
| |
| /// Configuration for connecting to a live agent. |
| /// |
| /// Currently, this feature is not general available, please contact Google to |
| /// get access. |
| GoogleCloudDialogflowV2HumanAgentHandoffConfig? humanAgentHandoffConfig; |
| |
| /// Language which represents the conversationProfile. |
| /// |
| /// If unspecified, the default language code en-us applies. Users need to |
| /// create a ConversationProfile for each language they want to support. |
| core.String? languageCode; |
| |
| /// Configuration for logging conversation lifecycle events. |
| GoogleCloudDialogflowV2LoggingConfig? loggingConfig; |
| |
| /// The unique identifier of this conversation profile. |
| /// |
| /// Format: `projects//locations//conversationProfiles/`. |
| core.String? name; |
| |
| /// Configuration for publishing new message events. |
| /// |
| /// Event will be sent in format of ConversationEvent |
| GoogleCloudDialogflowV2NotificationConfig? newMessageEventNotificationConfig; |
| |
| /// Configuration for publishing conversation lifecycle events. |
| GoogleCloudDialogflowV2NotificationConfig? notificationConfig; |
| |
| /// Settings for speech transcription. |
| GoogleCloudDialogflowV2SpeechToTextConfig? sttConfig; |
| |
| /// Update time of the conversation profile. |
| /// |
| /// Output only. |
| core.String? updateTime; |
| |
| GoogleCloudDialogflowV2ConversationProfile({ |
| this.automatedAgentConfig, |
| this.createTime, |
| this.displayName, |
| this.humanAgentAssistantConfig, |
| this.humanAgentHandoffConfig, |
| this.languageCode, |
| this.loggingConfig, |
| this.name, |
| this.newMessageEventNotificationConfig, |
| this.notificationConfig, |
| this.sttConfig, |
| this.updateTime, |
| }); |
| |
| GoogleCloudDialogflowV2ConversationProfile.fromJson(core.Map _json) |
| : this( |
| automatedAgentConfig: _json.containsKey('automatedAgentConfig') |
| ? GoogleCloudDialogflowV2AutomatedAgentConfig.fromJson( |
| _json['automatedAgentConfig'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| createTime: _json.containsKey('createTime') |
| ? _json['createTime'] as core.String |
| : null, |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| humanAgentAssistantConfig: |
| _json.containsKey('humanAgentAssistantConfig') |
| ? GoogleCloudDialogflowV2HumanAgentAssistantConfig.fromJson( |
| _json['humanAgentAssistantConfig'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| humanAgentHandoffConfig: _json.containsKey('humanAgentHandoffConfig') |
| ? GoogleCloudDialogflowV2HumanAgentHandoffConfig.fromJson( |
| _json['humanAgentHandoffConfig'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| languageCode: _json.containsKey('languageCode') |
| ? _json['languageCode'] as core.String |
| : null, |
| loggingConfig: _json.containsKey('loggingConfig') |
| ? GoogleCloudDialogflowV2LoggingConfig.fromJson( |
| _json['loggingConfig'] as core.Map<core.String, core.dynamic>) |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| newMessageEventNotificationConfig: |
| _json.containsKey('newMessageEventNotificationConfig') |
| ? GoogleCloudDialogflowV2NotificationConfig.fromJson( |
| _json['newMessageEventNotificationConfig'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| notificationConfig: _json.containsKey('notificationConfig') |
| ? GoogleCloudDialogflowV2NotificationConfig.fromJson( |
| _json['notificationConfig'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| sttConfig: _json.containsKey('sttConfig') |
| ? GoogleCloudDialogflowV2SpeechToTextConfig.fromJson( |
| _json['sttConfig'] as core.Map<core.String, core.dynamic>) |
| : null, |
| updateTime: _json.containsKey('updateTime') |
| ? _json['updateTime'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (automatedAgentConfig != null) |
| 'automatedAgentConfig': automatedAgentConfig!.toJson(), |
| if (createTime != null) 'createTime': createTime!, |
| if (displayName != null) 'displayName': displayName!, |
| if (humanAgentAssistantConfig != null) |
| 'humanAgentAssistantConfig': humanAgentAssistantConfig!.toJson(), |
| if (humanAgentHandoffConfig != null) |
| 'humanAgentHandoffConfig': humanAgentHandoffConfig!.toJson(), |
| if (languageCode != null) 'languageCode': languageCode!, |
| if (loggingConfig != null) 'loggingConfig': loggingConfig!.toJson(), |
| if (name != null) 'name': name!, |
| if (newMessageEventNotificationConfig != null) |
| 'newMessageEventNotificationConfig': |
| newMessageEventNotificationConfig!.toJson(), |
| if (notificationConfig != null) |
| 'notificationConfig': notificationConfig!.toJson(), |
| if (sttConfig != null) 'sttConfig': sttConfig!.toJson(), |
| if (updateTime != null) 'updateTime': updateTime!, |
| }; |
| } |
| |
| /// The request to detect user's intent. |
| class GoogleCloudDialogflowV2DetectIntentRequest { |
| /// The natural language speech audio to be processed. |
| /// |
| /// This field should be populated iff `query_input` is set to an input audio |
| /// config. A single request can contain up to 1 minute of speech audio data. |
| core.String? inputAudio; |
| core.List<core.int> get inputAudioAsBytes => |
| convert.base64.decode(inputAudio!); |
| |
| set inputAudioAsBytes(core.List<core.int> _bytes) { |
| inputAudio = |
| convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); |
| } |
| |
| /// Instructs the speech synthesizer how to generate the output audio. |
| /// |
| /// If this field is not set and agent-level speech synthesizer is not |
| /// configured, no output audio is generated. |
| GoogleCloudDialogflowV2OutputAudioConfig? outputAudioConfig; |
| |
| /// Mask for output_audio_config indicating which settings in this |
| /// request-level config should override speech synthesizer settings defined |
| /// at agent-level. |
| /// |
| /// If unspecified or empty, output_audio_config replaces the agent-level |
| /// config in its entirety. |
| core.String? outputAudioConfigMask; |
| |
| /// The input specification. |
| /// |
| /// It can be set to: 1. an audio config which instructs the speech recognizer |
| /// how to process the speech audio, 2. a conversational query in the form of |
| /// text, or 3. an event that specifies which intent to trigger. |
| /// |
| /// Required. |
| GoogleCloudDialogflowV2QueryInput? queryInput; |
| |
| /// The parameters of this query. |
| GoogleCloudDialogflowV2QueryParameters? queryParams; |
| |
| GoogleCloudDialogflowV2DetectIntentRequest({ |
| this.inputAudio, |
| this.outputAudioConfig, |
| this.outputAudioConfigMask, |
| this.queryInput, |
| this.queryParams, |
| }); |
| |
| GoogleCloudDialogflowV2DetectIntentRequest.fromJson(core.Map _json) |
| : this( |
| inputAudio: _json.containsKey('inputAudio') |
| ? _json['inputAudio'] as core.String |
| : null, |
| outputAudioConfig: _json.containsKey('outputAudioConfig') |
| ? GoogleCloudDialogflowV2OutputAudioConfig.fromJson( |
| _json['outputAudioConfig'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| outputAudioConfigMask: _json.containsKey('outputAudioConfigMask') |
| ? _json['outputAudioConfigMask'] as core.String |
| : null, |
| queryInput: _json.containsKey('queryInput') |
| ? GoogleCloudDialogflowV2QueryInput.fromJson( |
| _json['queryInput'] as core.Map<core.String, core.dynamic>) |
| : null, |
| queryParams: _json.containsKey('queryParams') |
| ? GoogleCloudDialogflowV2QueryParameters.fromJson( |
| _json['queryParams'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (inputAudio != null) 'inputAudio': inputAudio!, |
| if (outputAudioConfig != null) |
| 'outputAudioConfig': outputAudioConfig!.toJson(), |
| if (outputAudioConfigMask != null) |
| 'outputAudioConfigMask': outputAudioConfigMask!, |
| if (queryInput != null) 'queryInput': queryInput!.toJson(), |
| if (queryParams != null) 'queryParams': queryParams!.toJson(), |
| }; |
| } |
| |
| /// The message returned from the DetectIntent method. |
| class GoogleCloudDialogflowV2DetectIntentResponse { |
| /// The audio data bytes encoded as specified in the request. |
| /// |
| /// Note: The output audio is generated based on the values of default |
| /// platform text responses found in the `query_result.fulfillment_messages` |
| /// field. If multiple default text responses exist, they will be concatenated |
| /// when generating audio. If no default platform text responses exist, the |
| /// generated audio content will be empty. In some scenarios, multiple output |
| /// audio fields may be present in the response structure. In these cases, |
| /// only the top-most-level audio output has content. |
| core.String? outputAudio; |
| core.List<core.int> get outputAudioAsBytes => |
| convert.base64.decode(outputAudio!); |
| |
| set outputAudioAsBytes(core.List<core.int> _bytes) { |
| outputAudio = |
| convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); |
| } |
| |
| /// The config used by the speech synthesizer to generate the output audio. |
| GoogleCloudDialogflowV2OutputAudioConfig? outputAudioConfig; |
| |
| /// The selected results of the conversational query or event processing. |
| /// |
| /// See `alternative_query_results` for additional potential results. |
| GoogleCloudDialogflowV2QueryResult? queryResult; |
| |
| /// The unique identifier of the response. |
| /// |
| /// It can be used to locate a response in the training example set or for |
| /// reporting issues. |
| core.String? responseId; |
| |
| /// Specifies the status of the webhook request. |
| GoogleRpcStatus? webhookStatus; |
| |
| GoogleCloudDialogflowV2DetectIntentResponse({ |
| this.outputAudio, |
| this.outputAudioConfig, |
| this.queryResult, |
| this.responseId, |
| this.webhookStatus, |
| }); |
| |
| GoogleCloudDialogflowV2DetectIntentResponse.fromJson(core.Map _json) |
| : this( |
| outputAudio: _json.containsKey('outputAudio') |
| ? _json['outputAudio'] as core.String |
| : null, |
| outputAudioConfig: _json.containsKey('outputAudioConfig') |
| ? GoogleCloudDialogflowV2OutputAudioConfig.fromJson( |
| _json['outputAudioConfig'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| queryResult: _json.containsKey('queryResult') |
| ? GoogleCloudDialogflowV2QueryResult.fromJson( |
| _json['queryResult'] as core.Map<core.String, core.dynamic>) |
| : null, |
| responseId: _json.containsKey('responseId') |
| ? _json['responseId'] as core.String |
| : null, |
| webhookStatus: _json.containsKey('webhookStatus') |
| ? GoogleRpcStatus.fromJson( |
| _json['webhookStatus'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (outputAudio != null) 'outputAudio': outputAudio!, |
| if (outputAudioConfig != null) |
| 'outputAudioConfig': outputAudioConfig!.toJson(), |
| if (queryResult != null) 'queryResult': queryResult!.toJson(), |
| if (responseId != null) 'responseId': responseId!, |
| if (webhookStatus != null) 'webhookStatus': webhookStatus!.toJson(), |
| }; |
| } |
| |
| /// A knowledge document to be used by a KnowledgeBase. |
| /// |
| /// For more information, see the |
| /// [knowledge base guide](https://cloud.google.com/dialogflow/docs/how/knowledge-bases). |
| /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; |
| /// only use `projects.knowledgeBases.documents`. |
| class GoogleCloudDialogflowV2Document { |
| /// The URI where the file content is located. |
| /// |
| /// For documents stored in Google Cloud Storage, these URIs must have the |
| /// form `gs:///`. NOTE: External URLs must correspond to public webpages, |
| /// i.e., they must be indexed by Google Search. In particular, URLs for |
| /// showing documents in Google Cloud Storage (i.e. the URL in your browser) |
| /// are not supported. Instead use the `gs://` format URI described above. |
| core.String? contentUri; |
| |
| /// The display name of the document. |
| /// |
| /// The name must be 1024 bytes or less; otherwise, the creation request |
| /// fails. |
| /// |
| /// Required. |
| core.String? displayName; |
| |
| /// If true, we try to automatically reload the document every day (at a time |
| /// picked by the system). |
| /// |
| /// If false or unspecified, we don't try to automatically reload the |
| /// document. Currently you can only enable automatic reload for documents |
| /// sourced from a public url, see `source` field for the source types. Reload |
| /// status can be tracked in `latest_reload_status`. If a reload fails, we |
| /// will keep the document unchanged. If a reload fails with internal errors, |
| /// the system will try to reload the document on the next day. If a reload |
| /// fails with non-retriable errors (e.g. PERMISION_DENIED), the system will |
| /// not try to reload the document anymore. You need to manually reload the |
| /// document successfully by calling `ReloadDocument` and clear the errors. |
| /// |
| /// Optional. |
| core.bool? enableAutoReload; |
| |
| /// The knowledge type of document content. |
| /// |
| /// Required. |
| core.List<core.String>? knowledgeTypes; |
| |
| /// The time and status of the latest reload. |
| /// |
| /// This reload may have been triggered automatically or manually and may not |
| /// have succeeded. |
| /// |
| /// Output only. |
| GoogleCloudDialogflowV2DocumentReloadStatus? latestReloadStatus; |
| |
| /// Metadata for the document. |
| /// |
| /// The metadata supports arbitrary key-value pairs. Suggested use cases |
| /// include storing a document's title, an external URL distinct from the |
| /// document's content_uri, etc. The max size of a `key` or a `value` of the |
| /// metadata is 1024 bytes. |
| /// |
| /// Optional. |
| core.Map<core.String, core.String>? metadata; |
| |
| /// The MIME type of this document. |
| /// |
| /// Required. |
| core.String? mimeType; |
| |
| /// The document resource name. |
| /// |
| /// The name must be empty when creating a document. Format: |
| /// `projects//locations//knowledgeBases//documents/`. |
| /// |
| /// Optional. |
| core.String? name; |
| |
| /// The raw content of the document. |
| /// |
| /// This field is only permitted for EXTRACTIVE_QA and FAQ knowledge types. |
| core.String? rawContent; |
| core.List<core.int> get rawContentAsBytes => |
| convert.base64.decode(rawContent!); |
| |
| set rawContentAsBytes(core.List<core.int> _bytes) { |
| rawContent = |
| convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); |
| } |
| |
| GoogleCloudDialogflowV2Document({ |
| this.contentUri, |
| this.displayName, |
| this.enableAutoReload, |
| this.knowledgeTypes, |
| this.latestReloadStatus, |
| this.metadata, |
| this.mimeType, |
| this.name, |
| this.rawContent, |
| }); |
| |
| GoogleCloudDialogflowV2Document.fromJson(core.Map _json) |
| : this( |
| contentUri: _json.containsKey('contentUri') |
| ? _json['contentUri'] as core.String |
| : null, |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| enableAutoReload: _json.containsKey('enableAutoReload') |
| ? _json['enableAutoReload'] as core.bool |
| : null, |
| knowledgeTypes: _json.containsKey('knowledgeTypes') |
| ? (_json['knowledgeTypes'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| latestReloadStatus: _json.containsKey('latestReloadStatus') |
| ? GoogleCloudDialogflowV2DocumentReloadStatus.fromJson( |
| _json['latestReloadStatus'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| metadata: _json.containsKey('metadata') |
| ? (_json['metadata'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.String, |
| ), |
| ) |
| : null, |
| mimeType: _json.containsKey('mimeType') |
| ? _json['mimeType'] as core.String |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| rawContent: _json.containsKey('rawContent') |
| ? _json['rawContent'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (contentUri != null) 'contentUri': contentUri!, |
| if (displayName != null) 'displayName': displayName!, |
| if (enableAutoReload != null) 'enableAutoReload': enableAutoReload!, |
| if (knowledgeTypes != null) 'knowledgeTypes': knowledgeTypes!, |
| if (latestReloadStatus != null) |
| 'latestReloadStatus': latestReloadStatus!.toJson(), |
| if (metadata != null) 'metadata': metadata!, |
| if (mimeType != null) 'mimeType': mimeType!, |
| if (name != null) 'name': name!, |
| if (rawContent != null) 'rawContent': rawContent!, |
| }; |
| } |
| |
| /// The status of a reload attempt. |
| class GoogleCloudDialogflowV2DocumentReloadStatus { |
| /// The status of a reload attempt or the initial load. |
| GoogleRpcStatus? status; |
| |
| /// The time of a reload attempt. |
| /// |
| /// This reload may have been triggered automatically or manually and may not |
| /// have succeeded. |
| core.String? time; |
| |
| GoogleCloudDialogflowV2DocumentReloadStatus({ |
| this.status, |
| this.time, |
| }); |
| |
| GoogleCloudDialogflowV2DocumentReloadStatus.fromJson(core.Map _json) |
| : this( |
| status: _json.containsKey('status') |
| ? GoogleRpcStatus.fromJson( |
| _json['status'] as core.Map<core.String, core.dynamic>) |
| : null, |
| time: _json.containsKey('time') ? _json['time'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (status != null) 'status': status!.toJson(), |
| if (time != null) 'time': time!, |
| }; |
| } |
| |
| /// The message in the response that indicates the parameters of DTMF. |
| class GoogleCloudDialogflowV2DtmfParameters { |
| /// Indicates whether DTMF input can be handled in the next request. |
| core.bool? acceptsDtmfInput; |
| |
| GoogleCloudDialogflowV2DtmfParameters({ |
| this.acceptsDtmfInput, |
| }); |
| |
| GoogleCloudDialogflowV2DtmfParameters.fromJson(core.Map _json) |
| : this( |
| acceptsDtmfInput: _json.containsKey('acceptsDtmfInput') |
| ? _json['acceptsDtmfInput'] as core.bool |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (acceptsDtmfInput != null) 'acceptsDtmfInput': acceptsDtmfInput!, |
| }; |
| } |
| |
| /// Each intent parameter has a type, called the entity type, which dictates |
| /// exactly how data from an end-user expression is extracted. |
| /// |
| /// Dialogflow provides predefined system entities that can match many common |
| /// types of data. For example, there are system entities for matching dates, |
| /// times, colors, email addresses, and so on. You can also create your own |
| /// custom entities for matching custom data. For example, you could define a |
| /// vegetable entity that can match the types of vegetables available for |
| /// purchase with a grocery store agent. For more information, see the |
| /// [Entity guide](https://cloud.google.com/dialogflow/docs/entities-overview). |
| class GoogleCloudDialogflowV2EntityType { |
| /// Indicates whether the entity type can be automatically expanded. |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "AUTO_EXPANSION_MODE_UNSPECIFIED" : Auto expansion disabled for the |
| /// entity. |
| /// - "AUTO_EXPANSION_MODE_DEFAULT" : Allows an agent to recognize values that |
| /// have not been explicitly listed in the entity. |
| core.String? autoExpansionMode; |
| |
| /// The name of the entity type. |
| /// |
| /// Required. |
| core.String? displayName; |
| |
| /// Enables fuzzy entity extraction during classification. |
| /// |
| /// Optional. |
| core.bool? enableFuzzyExtraction; |
| |
| /// The collection of entity entries associated with the entity type. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2EntityTypeEntity>? entities; |
| |
| /// Indicates the kind of entity type. |
| /// |
| /// Required. |
| /// Possible string values are: |
| /// - "KIND_UNSPECIFIED" : Not specified. This value should be never used. |
| /// - "KIND_MAP" : Map entity types allow mapping of a group of synonyms to a |
| /// reference value. |
| /// - "KIND_LIST" : List entity types contain a set of entries that do not map |
| /// to reference values. However, list entity types can contain references to |
| /// other entity types (with or without aliases). |
| /// - "KIND_REGEXP" : Regexp entity types allow to specify regular expressions |
| /// in entries values. |
| core.String? kind; |
| |
| /// The unique identifier of the entity type. |
| /// |
| /// Required for EntityTypes.UpdateEntityType and |
| /// EntityTypes.BatchUpdateEntityTypes methods. Format: |
| /// `projects//agent/entityTypes/`. |
| core.String? name; |
| |
| GoogleCloudDialogflowV2EntityType({ |
| this.autoExpansionMode, |
| this.displayName, |
| this.enableFuzzyExtraction, |
| this.entities, |
| this.kind, |
| this.name, |
| }); |
| |
| GoogleCloudDialogflowV2EntityType.fromJson(core.Map _json) |
| : this( |
| autoExpansionMode: _json.containsKey('autoExpansionMode') |
| ? _json['autoExpansionMode'] as core.String |
| : null, |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| enableFuzzyExtraction: _json.containsKey('enableFuzzyExtraction') |
| ? _json['enableFuzzyExtraction'] as core.bool |
| : null, |
| entities: _json.containsKey('entities') |
| ? (_json['entities'] as core.List) |
| .map<GoogleCloudDialogflowV2EntityTypeEntity>((value) => |
| GoogleCloudDialogflowV2EntityTypeEntity.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| kind: _json.containsKey('kind') ? _json['kind'] as core.String : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (autoExpansionMode != null) 'autoExpansionMode': autoExpansionMode!, |
| if (displayName != null) 'displayName': displayName!, |
| if (enableFuzzyExtraction != null) |
| 'enableFuzzyExtraction': enableFuzzyExtraction!, |
| if (entities != null) |
| 'entities': entities!.map((value) => value.toJson()).toList(), |
| if (kind != null) 'kind': kind!, |
| if (name != null) 'name': name!, |
| }; |
| } |
| |
| /// This message is a wrapper around a collection of entity types. |
| class GoogleCloudDialogflowV2EntityTypeBatch { |
| /// A collection of entity types. |
| core.List<GoogleCloudDialogflowV2EntityType>? entityTypes; |
| |
| GoogleCloudDialogflowV2EntityTypeBatch({ |
| this.entityTypes, |
| }); |
| |
| GoogleCloudDialogflowV2EntityTypeBatch.fromJson(core.Map _json) |
| : this( |
| entityTypes: _json.containsKey('entityTypes') |
| ? (_json['entityTypes'] as core.List) |
| .map<GoogleCloudDialogflowV2EntityType>((value) => |
| GoogleCloudDialogflowV2EntityType.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (entityTypes != null) |
| 'entityTypes': entityTypes!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// An **entity entry** for an associated entity type. |
| class GoogleCloudDialogflowV2EntityTypeEntity { |
| /// A collection of value synonyms. |
| /// |
| /// For example, if the entity type is *vegetable*, and `value` is |
| /// *scallions*, a synonym could be *green onions*. For `KIND_LIST` entity |
| /// types: * This collection must contain exactly one synonym equal to |
| /// `value`. |
| /// |
| /// Required. |
| core.List<core.String>? synonyms; |
| |
| /// The primary value associated with this entity entry. |
| /// |
| /// For example, if the entity type is *vegetable*, the value could be |
| /// *scallions*. For `KIND_MAP` entity types: * A reference value to be used |
| /// in place of synonyms. For `KIND_LIST` entity types: * A string that can |
| /// contain references to other entity types (with or without aliases). |
| /// |
| /// Required. |
| core.String? value; |
| |
| GoogleCloudDialogflowV2EntityTypeEntity({ |
| this.synonyms, |
| this.value, |
| }); |
| |
| GoogleCloudDialogflowV2EntityTypeEntity.fromJson(core.Map _json) |
| : this( |
| synonyms: _json.containsKey('synonyms') |
| ? (_json['synonyms'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| value: |
| _json.containsKey('value') ? _json['value'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (synonyms != null) 'synonyms': synonyms!, |
| if (value != null) 'value': value!, |
| }; |
| } |
| |
| /// You can create multiple versions of your agent and publish them to separate |
| /// environments. |
| /// |
| /// When you edit an agent, you are editing the draft agent. At any point, you |
| /// can save the draft agent as an agent version, which is an immutable snapshot |
| /// of your agent. When you save the draft agent, it is published to the default |
| /// environment. When you create agent versions, you can publish them to custom |
| /// environments. You can create a variety of custom environments for: - testing |
| /// - development - production - etc. For more information, see the |
| /// [versions and environments guide](https://cloud.google.com/dialogflow/docs/agents-versions). |
| class GoogleCloudDialogflowV2Environment { |
| /// The agent version loaded into this environment. |
| /// |
| /// Supported formats: - `projects//agent/versions/` - |
| /// `projects//locations//agent/versions/` |
| /// |
| /// Optional. |
| core.String? agentVersion; |
| |
| /// The developer-provided description for this environment. |
| /// |
| /// The maximum length is 500 characters. If exceeded, the request is |
| /// rejected. |
| /// |
| /// Optional. |
| core.String? description; |
| |
| /// The fulfillment settings to use for this environment. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2Fulfillment? fulfillment; |
| |
| /// The unique identifier of this agent environment. |
| /// |
| /// Supported formats: - `projects//agent/environments/` - |
| /// `projects//locations//agent/environments/` The environment ID for the |
| /// default environment is `-`. |
| /// |
| /// Output only. |
| core.String? name; |
| |
| /// The state of this environment. |
| /// |
| /// This field is read-only, i.e., it cannot be set by create and update |
| /// methods. |
| /// |
| /// Output only. |
| /// Possible string values are: |
| /// - "STATE_UNSPECIFIED" : Not specified. This value is not used. |
| /// - "STOPPED" : Stopped. |
| /// - "LOADING" : Loading. |
| /// - "RUNNING" : Running. |
| core.String? state; |
| |
| /// Text to speech settings for this environment. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2TextToSpeechSettings? textToSpeechSettings; |
| |
| /// The last update time of this environment. |
| /// |
| /// This field is read-only, i.e., it cannot be set by create and update |
| /// methods. |
| /// |
| /// Output only. |
| core.String? updateTime; |
| |
| GoogleCloudDialogflowV2Environment({ |
| this.agentVersion, |
| this.description, |
| this.fulfillment, |
| this.name, |
| this.state, |
| this.textToSpeechSettings, |
| this.updateTime, |
| }); |
| |
| GoogleCloudDialogflowV2Environment.fromJson(core.Map _json) |
| : this( |
| agentVersion: _json.containsKey('agentVersion') |
| ? _json['agentVersion'] as core.String |
| : null, |
| description: _json.containsKey('description') |
| ? _json['description'] as core.String |
| : null, |
| fulfillment: _json.containsKey('fulfillment') |
| ? GoogleCloudDialogflowV2Fulfillment.fromJson( |
| _json['fulfillment'] as core.Map<core.String, core.dynamic>) |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| state: |
| _json.containsKey('state') ? _json['state'] as core.String : null, |
| textToSpeechSettings: _json.containsKey('textToSpeechSettings') |
| ? GoogleCloudDialogflowV2TextToSpeechSettings.fromJson( |
| _json['textToSpeechSettings'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| updateTime: _json.containsKey('updateTime') |
| ? _json['updateTime'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (agentVersion != null) 'agentVersion': agentVersion!, |
| if (description != null) 'description': description!, |
| if (fulfillment != null) 'fulfillment': fulfillment!.toJson(), |
| if (name != null) 'name': name!, |
| if (state != null) 'state': state!, |
| if (textToSpeechSettings != null) |
| 'textToSpeechSettings': textToSpeechSettings!.toJson(), |
| if (updateTime != null) 'updateTime': updateTime!, |
| }; |
| } |
| |
| /// The response message for Environments.GetEnvironmentHistory. |
| class GoogleCloudDialogflowV2EnvironmentHistory { |
| /// The list of agent environments. |
| /// |
| /// There will be a maximum number of items returned based on the page_size |
| /// field in the request. |
| /// |
| /// Output only. |
| core.List<GoogleCloudDialogflowV2EnvironmentHistoryEntry>? entries; |
| |
| /// Token to retrieve the next page of results, or empty if there are no more |
| /// results in the list. |
| /// |
| /// Output only. |
| core.String? nextPageToken; |
| |
| /// The name of the environment this history is for. |
| /// |
| /// Supported formats: - `projects//agent/environments/` - |
| /// `projects//locations//agent/environments/` The environment ID for the |
| /// default environment is `-`. |
| /// |
| /// Output only. |
| core.String? parent; |
| |
| GoogleCloudDialogflowV2EnvironmentHistory({ |
| this.entries, |
| this.nextPageToken, |
| this.parent, |
| }); |
| |
| GoogleCloudDialogflowV2EnvironmentHistory.fromJson(core.Map _json) |
| : this( |
| entries: _json.containsKey('entries') |
| ? (_json['entries'] as core.List) |
| .map<GoogleCloudDialogflowV2EnvironmentHistoryEntry>( |
| (value) => GoogleCloudDialogflowV2EnvironmentHistoryEntry |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| nextPageToken: _json.containsKey('nextPageToken') |
| ? _json['nextPageToken'] as core.String |
| : null, |
| parent: _json.containsKey('parent') |
| ? _json['parent'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (entries != null) |
| 'entries': entries!.map((value) => value.toJson()).toList(), |
| if (nextPageToken != null) 'nextPageToken': nextPageToken!, |
| if (parent != null) 'parent': parent!, |
| }; |
| } |
| |
| /// Represents an environment history entry. |
| class GoogleCloudDialogflowV2EnvironmentHistoryEntry { |
| /// The agent version loaded into this environment history entry. |
| core.String? agentVersion; |
| |
| /// The creation time of this environment history entry. |
| core.String? createTime; |
| |
| /// The developer-provided description for this environment history entry. |
| core.String? description; |
| |
| GoogleCloudDialogflowV2EnvironmentHistoryEntry({ |
| this.agentVersion, |
| this.createTime, |
| this.description, |
| }); |
| |
| GoogleCloudDialogflowV2EnvironmentHistoryEntry.fromJson(core.Map _json) |
| : this( |
| agentVersion: _json.containsKey('agentVersion') |
| ? _json['agentVersion'] as core.String |
| : null, |
| createTime: _json.containsKey('createTime') |
| ? _json['createTime'] as core.String |
| : null, |
| description: _json.containsKey('description') |
| ? _json['description'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (agentVersion != null) 'agentVersion': agentVersion!, |
| if (createTime != null) 'createTime': createTime!, |
| if (description != null) 'description': description!, |
| }; |
| } |
| |
| /// Events allow for matching intents by event name instead of the natural |
| /// language input. |
| /// |
| /// For instance, input `` can trigger a personalized welcome response. The |
| /// parameter `name` may be used by the agent in the response: `"Hello |
| /// #welcome_event.name! What can I do for you today?"`. |
| class GoogleCloudDialogflowV2EventInput { |
| /// The language of this query. |
| /// |
| /// See |
| /// [Language Support](https://cloud.google.com/dialogflow/docs/reference/language) |
| /// for a list of the currently supported language codes. Note that queries in |
| /// the same session do not necessarily need to specify the same language. |
| /// |
| /// Required. |
| core.String? languageCode; |
| |
| /// The unique identifier of the event. |
| /// |
| /// Required. |
| core.String? name; |
| |
| /// The collection of parameters associated with the event. |
| /// |
| /// Depending on your protocol or client library language, this is a map, |
| /// associative array, symbol table, dictionary, or JSON object composed of a |
| /// collection of (MapKey, MapValue) pairs: - MapKey type: string - MapKey |
| /// value: parameter name - MapValue type: - If parameter's entity type is a |
| /// composite entity: map - Else: depending on parameter value type, could be |
| /// one of string, number, boolean, null, list or map - MapValue value: - If |
| /// parameter's entity type is a composite entity: map from composite entity |
| /// property names to property values - Else: parameter value |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? parameters; |
| |
| GoogleCloudDialogflowV2EventInput({ |
| this.languageCode, |
| this.name, |
| this.parameters, |
| }); |
| |
| GoogleCloudDialogflowV2EventInput.fromJson(core.Map _json) |
| : this( |
| languageCode: _json.containsKey('languageCode') |
| ? _json['languageCode'] as core.String |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| parameters: _json.containsKey('parameters') |
| ? (_json['parameters'] as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (languageCode != null) 'languageCode': languageCode!, |
| if (name != null) 'name': name!, |
| if (parameters != null) 'parameters': parameters!, |
| }; |
| } |
| |
| /// The request message for Agents.ExportAgent. |
| class GoogleCloudDialogflowV2ExportAgentRequest { |
| /// 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. |
| /// |
| /// Required. |
| core.String? agentUri; |
| |
| GoogleCloudDialogflowV2ExportAgentRequest({ |
| this.agentUri, |
| }); |
| |
| GoogleCloudDialogflowV2ExportAgentRequest.fromJson(core.Map _json) |
| : this( |
| agentUri: _json.containsKey('agentUri') |
| ? _json['agentUri'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (agentUri != null) 'agentUri': agentUri!, |
| }; |
| } |
| |
| /// The response message for Agents.ExportAgent. |
| class GoogleCloudDialogflowV2ExportAgentResponse { |
| /// Zip compressed raw byte content for agent. |
| core.String? agentContent; |
| core.List<core.int> get agentContentAsBytes => |
| convert.base64.decode(agentContent!); |
| |
| set agentContentAsBytes(core.List<core.int> _bytes) { |
| agentContent = |
| convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); |
| } |
| |
| /// The URI to a file containing the exported agent. |
| /// |
| /// This field is populated only if `agent_uri` is specified in |
| /// `ExportAgentRequest`. |
| core.String? agentUri; |
| |
| GoogleCloudDialogflowV2ExportAgentResponse({ |
| this.agentContent, |
| this.agentUri, |
| }); |
| |
| GoogleCloudDialogflowV2ExportAgentResponse.fromJson(core.Map _json) |
| : this( |
| agentContent: _json.containsKey('agentContent') |
| ? _json['agentContent'] as core.String |
| : null, |
| agentUri: _json.containsKey('agentUri') |
| ? _json['agentUri'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (agentContent != null) 'agentContent': agentContent!, |
| if (agentUri != null) 'agentUri': agentUri!, |
| }; |
| } |
| |
| /// Represents answer from "frequently asked questions". |
| class GoogleCloudDialogflowV2FaqAnswer { |
| /// The piece of text from the `source` knowledge base document. |
| core.String? answer; |
| |
| /// The name of answer record, in the format of |
| /// "projects//locations//answerRecords/" |
| core.String? answerRecord; |
| |
| /// The system's confidence score that this Knowledge answer is a good match |
| /// for this conversational query, range from 0.0 (completely uncertain) to |
| /// 1.0 (completely certain). |
| core.double? confidence; |
| |
| /// A map that contains metadata about the answer and the document from which |
| /// it originates. |
| core.Map<core.String, core.String>? metadata; |
| |
| /// The corresponding FAQ question. |
| core.String? question; |
| |
| /// Indicates which Knowledge Document this answer was extracted from. |
| /// |
| /// Format: `projects//locations//agent/knowledgeBases//documents/`. |
| core.String? source; |
| |
| GoogleCloudDialogflowV2FaqAnswer({ |
| this.answer, |
| this.answerRecord, |
| this.confidence, |
| this.metadata, |
| this.question, |
| this.source, |
| }); |
| |
| GoogleCloudDialogflowV2FaqAnswer.fromJson(core.Map _json) |
| : this( |
| answer: _json.containsKey('answer') |
| ? _json['answer'] as core.String |
| : null, |
| answerRecord: _json.containsKey('answerRecord') |
| ? _json['answerRecord'] as core.String |
| : null, |
| confidence: _json.containsKey('confidence') |
| ? (_json['confidence'] as core.num).toDouble() |
| : null, |
| metadata: _json.containsKey('metadata') |
| ? (_json['metadata'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.String, |
| ), |
| ) |
| : null, |
| question: _json.containsKey('question') |
| ? _json['question'] as core.String |
| : null, |
| source: _json.containsKey('source') |
| ? _json['source'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (answer != null) 'answer': answer!, |
| if (answerRecord != null) 'answerRecord': answerRecord!, |
| if (confidence != null) 'confidence': confidence!, |
| if (metadata != null) 'metadata': metadata!, |
| if (question != null) 'question': question!, |
| if (source != null) 'source': source!, |
| }; |
| } |
| |
| /// By default, your agent responds to a matched intent with a static response. |
| /// |
| /// As an alternative, you can provide a more dynamic response by using |
| /// fulfillment. When you enable fulfillment for an intent, Dialogflow responds |
| /// to that intent by calling a service that you define. For example, if an |
| /// end-user wants to schedule a haircut on Friday, your service can check your |
| /// database and respond to the end-user with availability information for |
| /// Friday. For more information, see the |
| /// [fulfillment guide](https://cloud.google.com/dialogflow/docs/fulfillment-overview). |
| class GoogleCloudDialogflowV2Fulfillment { |
| /// The human-readable name of the fulfillment, unique within the agent. |
| /// |
| /// This field is not used for Fulfillment in an Environment. |
| /// |
| /// Optional. |
| core.String? displayName; |
| |
| /// Whether fulfillment is enabled. |
| /// |
| /// Optional. |
| core.bool? enabled; |
| |
| /// The field defines whether the fulfillment is enabled for certain features. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2FulfillmentFeature>? features; |
| |
| /// Configuration for a generic web service. |
| GoogleCloudDialogflowV2FulfillmentGenericWebService? genericWebService; |
| |
| /// The unique identifier of the fulfillment. |
| /// |
| /// Supported formats: - `projects//agent/fulfillment` - |
| /// `projects//locations//agent/fulfillment` This field is not used for |
| /// Fulfillment in an Environment. |
| /// |
| /// Required. |
| core.String? name; |
| |
| GoogleCloudDialogflowV2Fulfillment({ |
| this.displayName, |
| this.enabled, |
| this.features, |
| this.genericWebService, |
| this.name, |
| }); |
| |
| GoogleCloudDialogflowV2Fulfillment.fromJson(core.Map _json) |
| : this( |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| enabled: _json.containsKey('enabled') |
| ? _json['enabled'] as core.bool |
| : null, |
| features: _json.containsKey('features') |
| ? (_json['features'] as core.List) |
| .map<GoogleCloudDialogflowV2FulfillmentFeature>((value) => |
| GoogleCloudDialogflowV2FulfillmentFeature.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| genericWebService: _json.containsKey('genericWebService') |
| ? GoogleCloudDialogflowV2FulfillmentGenericWebService.fromJson( |
| _json['genericWebService'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (displayName != null) 'displayName': displayName!, |
| if (enabled != null) 'enabled': enabled!, |
| if (features != null) |
| 'features': features!.map((value) => value.toJson()).toList(), |
| if (genericWebService != null) |
| 'genericWebService': genericWebService!.toJson(), |
| if (name != null) 'name': name!, |
| }; |
| } |
| |
| /// Whether fulfillment is enabled for the specific feature. |
| class GoogleCloudDialogflowV2FulfillmentFeature { |
| /// The type of the feature that enabled for fulfillment. |
| /// Possible string values are: |
| /// - "TYPE_UNSPECIFIED" : Feature type not specified. |
| /// - "SMALLTALK" : Fulfillment is enabled for SmallTalk. |
| core.String? type; |
| |
| GoogleCloudDialogflowV2FulfillmentFeature({ |
| this.type, |
| }); |
| |
| GoogleCloudDialogflowV2FulfillmentFeature.fromJson(core.Map _json) |
| : this( |
| type: _json.containsKey('type') ? _json['type'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (type != null) 'type': type!, |
| }; |
| } |
| |
| /// Represents configuration for a generic web service. |
| /// |
| /// Dialogflow supports two mechanisms for authentications: - Basic |
| /// authentication with username and password. - Authentication with additional |
| /// authentication headers. More information could be found at: |
| /// https://cloud.google.com/dialogflow/docs/fulfillment-configure. |
| class GoogleCloudDialogflowV2FulfillmentGenericWebService { |
| /// Indicates if generic web service is created through Cloud Functions |
| /// integration. |
| /// |
| /// Defaults to false. is_cloud_function is deprecated. Cloud functions can be |
| /// configured by its uri as a regular web service now. |
| /// |
| /// Optional. |
| core.bool? isCloudFunction; |
| |
| /// The password for HTTP Basic authentication. |
| /// |
| /// Optional. |
| core.String? password; |
| |
| /// The HTTP request headers to send together with fulfillment requests. |
| /// |
| /// Optional. |
| core.Map<core.String, core.String>? requestHeaders; |
| |
| /// The fulfillment URI for receiving POST requests. |
| /// |
| /// It must use https protocol. |
| /// |
| /// Required. |
| core.String? uri; |
| |
| /// The user name for HTTP Basic authentication. |
| /// |
| /// Optional. |
| core.String? username; |
| |
| GoogleCloudDialogflowV2FulfillmentGenericWebService({ |
| this.isCloudFunction, |
| this.password, |
| this.requestHeaders, |
| this.uri, |
| this.username, |
| }); |
| |
| GoogleCloudDialogflowV2FulfillmentGenericWebService.fromJson(core.Map _json) |
| : this( |
| isCloudFunction: _json.containsKey('isCloudFunction') |
| ? _json['isCloudFunction'] as core.bool |
| : null, |
| password: _json.containsKey('password') |
| ? _json['password'] as core.String |
| : null, |
| requestHeaders: _json.containsKey('requestHeaders') |
| ? (_json['requestHeaders'] as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.String, |
| ), |
| ) |
| : null, |
| uri: _json.containsKey('uri') ? _json['uri'] as core.String : null, |
| username: _json.containsKey('username') |
| ? _json['username'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (isCloudFunction != null) 'isCloudFunction': isCloudFunction!, |
| if (password != null) 'password': password!, |
| if (requestHeaders != null) 'requestHeaders': requestHeaders!, |
| if (uri != null) 'uri': uri!, |
| if (username != null) 'username': username!, |
| }; |
| } |
| |
| /// Defines the Human Agent Assist to connect to a conversation. |
| class GoogleCloudDialogflowV2HumanAgentAssistantConfig { |
| /// Configuration for agent assistance of end user participant. |
| /// |
| /// Currently, this feature is not general available, please contact Google to |
| /// get access. |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionConfig? |
| endUserSuggestionConfig; |
| |
| /// Configuration for agent assistance of human agent participant. |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionConfig? |
| humanAgentSuggestionConfig; |
| |
| /// Configuration for message analysis. |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigMessageAnalysisConfig? |
| messageAnalysisConfig; |
| |
| /// Pub/Sub topic on which to publish new agent assistant events. |
| GoogleCloudDialogflowV2NotificationConfig? notificationConfig; |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfig({ |
| this.endUserSuggestionConfig, |
| this.humanAgentSuggestionConfig, |
| this.messageAnalysisConfig, |
| this.notificationConfig, |
| }); |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfig.fromJson(core.Map _json) |
| : this( |
| endUserSuggestionConfig: _json.containsKey('endUserSuggestionConfig') |
| ? GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionConfig |
| .fromJson(_json['endUserSuggestionConfig'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| humanAgentSuggestionConfig: _json |
| .containsKey('humanAgentSuggestionConfig') |
| ? GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionConfig |
| .fromJson(_json['humanAgentSuggestionConfig'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| messageAnalysisConfig: _json.containsKey('messageAnalysisConfig') |
| ? GoogleCloudDialogflowV2HumanAgentAssistantConfigMessageAnalysisConfig |
| .fromJson(_json['messageAnalysisConfig'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| notificationConfig: _json.containsKey('notificationConfig') |
| ? GoogleCloudDialogflowV2NotificationConfig.fromJson( |
| _json['notificationConfig'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (endUserSuggestionConfig != null) |
| 'endUserSuggestionConfig': endUserSuggestionConfig!.toJson(), |
| if (humanAgentSuggestionConfig != null) |
| 'humanAgentSuggestionConfig': humanAgentSuggestionConfig!.toJson(), |
| if (messageAnalysisConfig != null) |
| 'messageAnalysisConfig': messageAnalysisConfig!.toJson(), |
| if (notificationConfig != null) |
| 'notificationConfig': notificationConfig!.toJson(), |
| }; |
| } |
| |
| /// Custom conversation models used in agent assist feature. |
| /// |
| /// Supported feature: ARTICLE_SUGGESTION, SMART_COMPOSE, SMART_REPLY. |
| class GoogleCloudDialogflowV2HumanAgentAssistantConfigConversationModelConfig { |
| /// Conversation model resource name. |
| /// |
| /// Format: `projects//conversationModels/`. |
| core.String? model; |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigConversationModelConfig({ |
| this.model, |
| }); |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigConversationModelConfig.fromJson( |
| core.Map _json) |
| : this( |
| model: |
| _json.containsKey('model') ? _json['model'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (model != null) 'model': model!, |
| }; |
| } |
| |
| /// Configuration for analyses to run on each conversation message. |
| class GoogleCloudDialogflowV2HumanAgentAssistantConfigMessageAnalysisConfig { |
| /// Enable entity extraction in conversation messages on |
| /// [agent assist stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). |
| /// |
| /// If unspecified, defaults to false. Currently, this feature is not general |
| /// available, please contact Google to get access. |
| core.bool? enableEntityExtraction; |
| |
| /// Enable sentiment analysis in conversation messages on |
| /// [agent assist stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). |
| /// |
| /// If unspecified, defaults to false. Sentiment analysis inspects user input |
| /// and identifies the prevailing subjective opinion, especially to determine |
| /// a user's attitude as positive, negative, or neutral: |
| /// https://cloud.google.com/natural-language/docs/basics#sentiment_analysis |
| /// For Participants.StreamingAnalyzeContent method, result will be in |
| /// StreamingAnalyzeContentResponse.message.SentimentAnalysisResult. For |
| /// Participants.AnalyzeContent method, result will be in |
| /// AnalyzeContentResponse.message.SentimentAnalysisResult For |
| /// Conversations.ListMessages method, result will be in |
| /// ListMessagesResponse.messages.SentimentAnalysisResult If Pub/Sub |
| /// notification is configured, result will be in |
| /// ConversationEvent.new_message_payload.SentimentAnalysisResult. |
| core.bool? enableSentimentAnalysis; |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigMessageAnalysisConfig({ |
| this.enableEntityExtraction, |
| this.enableSentimentAnalysis, |
| }); |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigMessageAnalysisConfig.fromJson( |
| core.Map _json) |
| : this( |
| enableEntityExtraction: _json.containsKey('enableEntityExtraction') |
| ? _json['enableEntityExtraction'] as core.bool |
| : null, |
| enableSentimentAnalysis: _json.containsKey('enableSentimentAnalysis') |
| ? _json['enableSentimentAnalysis'] as core.bool |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (enableEntityExtraction != null) |
| 'enableEntityExtraction': enableEntityExtraction!, |
| if (enableSentimentAnalysis != null) |
| 'enableSentimentAnalysis': enableSentimentAnalysis!, |
| }; |
| } |
| |
| /// Detail human agent assistant config. |
| class GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionConfig { |
| /// Configuration of different suggestion features. |
| /// |
| /// One feature can have only one config. |
| core.List< |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionFeatureConfig>? |
| featureConfigs; |
| |
| /// If `group_suggestion_responses` is false, and there are multiple |
| /// `feature_configs` in `event based suggestion` or StreamingAnalyzeContent, |
| /// we will try to deliver suggestions to customers as soon as we get new |
| /// suggestion. |
| /// |
| /// Different type of suggestions based on the same context will be in |
| /// separate Pub/Sub event or `StreamingAnalyzeContentResponse`. If |
| /// `group_suggestion_responses` set to true. All the suggestions to the same |
| /// participant based on the same context will be grouped into a single |
| /// Pub/Sub event or StreamingAnalyzeContentResponse. |
| core.bool? groupSuggestionResponses; |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionConfig({ |
| this.featureConfigs, |
| this.groupSuggestionResponses, |
| }); |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionConfig.fromJson( |
| core.Map _json) |
| : this( |
| featureConfigs: _json.containsKey('featureConfigs') |
| ? (_json['featureConfigs'] as core.List) |
| .map<GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionFeatureConfig>( |
| (value) => |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionFeatureConfig |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| groupSuggestionResponses: |
| _json.containsKey('groupSuggestionResponses') |
| ? _json['groupSuggestionResponses'] as core.bool |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (featureConfigs != null) |
| 'featureConfigs': |
| featureConfigs!.map((value) => value.toJson()).toList(), |
| if (groupSuggestionResponses != null) |
| 'groupSuggestionResponses': groupSuggestionResponses!, |
| }; |
| } |
| |
| /// Config for suggestion features. |
| class GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionFeatureConfig { |
| /// Configs of custom conversation model. |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigConversationModelConfig? |
| conversationModelConfig; |
| |
| /// Automatically iterates all participants and tries to compile suggestions. |
| /// |
| /// Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST. |
| core.bool? enableEventBasedSuggestion; |
| |
| /// Configs of query. |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfig? |
| queryConfig; |
| |
| /// The suggestion feature. |
| GoogleCloudDialogflowV2SuggestionFeature? suggestionFeature; |
| |
| /// Settings of suggestion trigger. |
| /// |
| /// Currently, only ARTICLE_SUGGESTION and FAQ will use this field. |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionTriggerSettings? |
| suggestionTriggerSettings; |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionFeatureConfig({ |
| this.conversationModelConfig, |
| this.enableEventBasedSuggestion, |
| this.queryConfig, |
| this.suggestionFeature, |
| this.suggestionTriggerSettings, |
| }); |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionFeatureConfig.fromJson( |
| core.Map _json) |
| : this( |
| conversationModelConfig: _json.containsKey('conversationModelConfig') |
| ? GoogleCloudDialogflowV2HumanAgentAssistantConfigConversationModelConfig |
| .fromJson(_json['conversationModelConfig'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| enableEventBasedSuggestion: |
| _json.containsKey('enableEventBasedSuggestion') |
| ? _json['enableEventBasedSuggestion'] as core.bool |
| : null, |
| queryConfig: _json.containsKey('queryConfig') |
| ? GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfig |
| .fromJson(_json['queryConfig'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| suggestionFeature: _json.containsKey('suggestionFeature') |
| ? GoogleCloudDialogflowV2SuggestionFeature.fromJson( |
| _json['suggestionFeature'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| suggestionTriggerSettings: _json |
| .containsKey('suggestionTriggerSettings') |
| ? GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionTriggerSettings |
| .fromJson(_json['suggestionTriggerSettings'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (conversationModelConfig != null) |
| 'conversationModelConfig': conversationModelConfig!.toJson(), |
| if (enableEventBasedSuggestion != null) |
| 'enableEventBasedSuggestion': enableEventBasedSuggestion!, |
| if (queryConfig != null) 'queryConfig': queryConfig!.toJson(), |
| if (suggestionFeature != null) |
| 'suggestionFeature': suggestionFeature!.toJson(), |
| if (suggestionTriggerSettings != null) |
| 'suggestionTriggerSettings': suggestionTriggerSettings!.toJson(), |
| }; |
| } |
| |
| /// Config for suggestion query. |
| class GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfig { |
| /// Confidence threshold of query result. |
| /// |
| /// Agent Assist gives each suggestion a score in the range \[0.0, 1.0\], |
| /// based on the relevance between the suggestion and the current conversation |
| /// context. A score of 0.0 has no relevance, while a score of 1.0 has high |
| /// relevance. Only suggestions with a score greater than or equal to the |
| /// value of this field are included in the results. For a baseline model (the |
| /// default), the recommended value is in the range \[0.05, 0.1\]. For a |
| /// custom model, there is no recommended value. Tune this value by starting |
| /// from a very low value and slowly increasing until you have desired |
| /// results. If this field is not set, it defaults to 0.0, which means that |
| /// all suggestions are returned. Supported features: ARTICLE_SUGGESTION. |
| core.double? confidenceThreshold; |
| |
| /// Determines how recent conversation context is filtered when generating |
| /// suggestions. |
| /// |
| /// If unspecified, no messages will be dropped. |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfigContextFilterSettings? |
| contextFilterSettings; |
| |
| /// Query from Dialogflow agent. |
| /// |
| /// It is used by DIALOGFLOW_ASSIST. |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfigDialogflowQuerySource? |
| dialogflowQuerySource; |
| |
| /// Query from knowledge base document. |
| /// |
| /// It is used by: SMART_REPLY, SMART_COMPOSE. |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfigDocumentQuerySource? |
| documentQuerySource; |
| |
| /// Query from knowledgebase. |
| /// |
| /// It is used by: ARTICLE_SUGGESTION, FAQ. |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfigKnowledgeBaseQuerySource? |
| knowledgeBaseQuerySource; |
| |
| /// Maximum number of results to return. |
| /// |
| /// Currently, if unset, defaults to 10. And the max number is 20. |
| core.int? maxResults; |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfig({ |
| this.confidenceThreshold, |
| this.contextFilterSettings, |
| this.dialogflowQuerySource, |
| this.documentQuerySource, |
| this.knowledgeBaseQuerySource, |
| this.maxResults, |
| }); |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfig.fromJson( |
| core.Map _json) |
| : this( |
| confidenceThreshold: _json.containsKey('confidenceThreshold') |
| ? (_json['confidenceThreshold'] as core.num).toDouble() |
| : null, |
| contextFilterSettings: _json.containsKey('contextFilterSettings') |
| ? GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfigContextFilterSettings |
| .fromJson(_json['contextFilterSettings'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| dialogflowQuerySource: _json.containsKey('dialogflowQuerySource') |
| ? GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfigDialogflowQuerySource |
| .fromJson(_json['dialogflowQuerySource'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| documentQuerySource: _json.containsKey('documentQuerySource') |
| ? GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfigDocumentQuerySource |
| .fromJson(_json['documentQuerySource'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| knowledgeBaseQuerySource: _json |
| .containsKey('knowledgeBaseQuerySource') |
| ? GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfigKnowledgeBaseQuerySource |
| .fromJson(_json['knowledgeBaseQuerySource'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| maxResults: _json.containsKey('maxResults') |
| ? _json['maxResults'] as core.int |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (confidenceThreshold != null) |
| 'confidenceThreshold': confidenceThreshold!, |
| if (contextFilterSettings != null) |
| 'contextFilterSettings': contextFilterSettings!.toJson(), |
| if (dialogflowQuerySource != null) |
| 'dialogflowQuerySource': dialogflowQuerySource!.toJson(), |
| if (documentQuerySource != null) |
| 'documentQuerySource': documentQuerySource!.toJson(), |
| if (knowledgeBaseQuerySource != null) |
| 'knowledgeBaseQuerySource': knowledgeBaseQuerySource!.toJson(), |
| if (maxResults != null) 'maxResults': maxResults!, |
| }; |
| } |
| |
| /// Settings that determine how to filter recent conversation context when |
| /// generating suggestions. |
| class GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfigContextFilterSettings { |
| /// If set to true, the last message from virtual agent (hand off message) and |
| /// the message before it (trigger message of hand off) are dropped. |
| core.bool? dropHandoffMessages; |
| |
| /// If set to true, all messages from ivr stage are dropped. |
| core.bool? dropIvrMessages; |
| |
| /// If set to true, all messages from virtual agent are dropped. |
| core.bool? dropVirtualAgentMessages; |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfigContextFilterSettings({ |
| this.dropHandoffMessages, |
| this.dropIvrMessages, |
| this.dropVirtualAgentMessages, |
| }); |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfigContextFilterSettings.fromJson( |
| core.Map _json) |
| : this( |
| dropHandoffMessages: _json.containsKey('dropHandoffMessages') |
| ? _json['dropHandoffMessages'] as core.bool |
| : null, |
| dropIvrMessages: _json.containsKey('dropIvrMessages') |
| ? _json['dropIvrMessages'] as core.bool |
| : null, |
| dropVirtualAgentMessages: |
| _json.containsKey('dropVirtualAgentMessages') |
| ? _json['dropVirtualAgentMessages'] as core.bool |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (dropHandoffMessages != null) |
| 'dropHandoffMessages': dropHandoffMessages!, |
| if (dropIvrMessages != null) 'dropIvrMessages': dropIvrMessages!, |
| if (dropVirtualAgentMessages != null) |
| 'dropVirtualAgentMessages': dropVirtualAgentMessages!, |
| }; |
| } |
| |
| /// Dialogflow source setting. |
| /// |
| /// Supported feature: DIALOGFLOW_ASSIST. |
| class GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfigDialogflowQuerySource { |
| /// The name of a Dialogflow virtual agent used for end user side intent |
| /// detection and suggestion. |
| /// |
| /// Format: `projects//locations//agent`. When multiple agents are allowed in |
| /// the same Dialogflow project. |
| /// |
| /// Required. |
| core.String? agent; |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfigDialogflowQuerySource({ |
| this.agent, |
| }); |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfigDialogflowQuerySource.fromJson( |
| core.Map _json) |
| : this( |
| agent: |
| _json.containsKey('agent') ? _json['agent'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (agent != null) 'agent': agent!, |
| }; |
| } |
| |
| /// Document source settings. |
| /// |
| /// Supported features: SMART_REPLY, SMART_COMPOSE. |
| class GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfigDocumentQuerySource { |
| /// Knowledge documents to query from. |
| /// |
| /// Format: `projects//locations//knowledgeBases//documents/`. Currently, at |
| /// most 5 documents are supported. |
| /// |
| /// Required. |
| core.List<core.String>? documents; |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfigDocumentQuerySource({ |
| this.documents, |
| }); |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfigDocumentQuerySource.fromJson( |
| core.Map _json) |
| : this( |
| documents: _json.containsKey('documents') |
| ? (_json['documents'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (documents != null) 'documents': documents!, |
| }; |
| } |
| |
| /// Knowledge base source settings. |
| /// |
| /// Supported features: ARTICLE_SUGGESTION, FAQ. |
| class GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfigKnowledgeBaseQuerySource { |
| /// Knowledge bases to query. |
| /// |
| /// Format: `projects//locations//knowledgeBases/`. Currently, at most 5 |
| /// knowledge bases are supported. |
| /// |
| /// Required. |
| core.List<core.String>? knowledgeBases; |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfigKnowledgeBaseQuerySource({ |
| this.knowledgeBases, |
| }); |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionQueryConfigKnowledgeBaseQuerySource.fromJson( |
| core.Map _json) |
| : this( |
| knowledgeBases: _json.containsKey('knowledgeBases') |
| ? (_json['knowledgeBases'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (knowledgeBases != null) 'knowledgeBases': knowledgeBases!, |
| }; |
| } |
| |
| /// Settings of suggestion trigger. |
| class GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionTriggerSettings { |
| /// Do not trigger if last utterance is small talk. |
| core.bool? noSmalltalk; |
| |
| /// Only trigger suggestion if participant role of last utterance is END_USER. |
| core.bool? onlyEndUser; |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionTriggerSettings({ |
| this.noSmalltalk, |
| this.onlyEndUser, |
| }); |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionTriggerSettings.fromJson( |
| core.Map _json) |
| : this( |
| noSmalltalk: _json.containsKey('noSmalltalk') |
| ? _json['noSmalltalk'] as core.bool |
| : null, |
| onlyEndUser: _json.containsKey('onlyEndUser') |
| ? _json['onlyEndUser'] as core.bool |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (noSmalltalk != null) 'noSmalltalk': noSmalltalk!, |
| if (onlyEndUser != null) 'onlyEndUser': onlyEndUser!, |
| }; |
| } |
| |
| /// Represents a notification sent to Cloud Pub/Sub subscribers for human agent |
| /// assistant events in a specific conversation. |
| class GoogleCloudDialogflowV2HumanAgentAssistantEvent { |
| /// The conversation this notification refers to. |
| /// |
| /// Format: `projects//conversations/`. |
| core.String? conversation; |
| |
| /// The participant that the suggestion is compiled for. |
| /// |
| /// Format: `projects//conversations//participants/`. It will not be set in |
| /// legacy workflow. |
| core.String? participant; |
| |
| /// The suggestion results payload that this notification refers to. |
| core.List<GoogleCloudDialogflowV2SuggestionResult>? suggestionResults; |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantEvent({ |
| this.conversation, |
| this.participant, |
| this.suggestionResults, |
| }); |
| |
| GoogleCloudDialogflowV2HumanAgentAssistantEvent.fromJson(core.Map _json) |
| : this( |
| conversation: _json.containsKey('conversation') |
| ? _json['conversation'] as core.String |
| : null, |
| participant: _json.containsKey('participant') |
| ? _json['participant'] as core.String |
| : null, |
| suggestionResults: _json.containsKey('suggestionResults') |
| ? (_json['suggestionResults'] as core.List) |
| .map<GoogleCloudDialogflowV2SuggestionResult>((value) => |
| GoogleCloudDialogflowV2SuggestionResult.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (conversation != null) 'conversation': conversation!, |
| if (participant != null) 'participant': participant!, |
| if (suggestionResults != null) |
| 'suggestionResults': |
| suggestionResults!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Defines the hand off to a live agent, typically on which external agent |
| /// service provider to connect to a conversation. |
| /// |
| /// Currently, this feature is not general available, please contact Google to |
| /// get access. |
| class GoogleCloudDialogflowV2HumanAgentHandoffConfig { |
| /// Uses LivePerson (https://www.liveperson.com). |
| GoogleCloudDialogflowV2HumanAgentHandoffConfigLivePersonConfig? |
| livePersonConfig; |
| |
| /// Uses Salesforce Live Agent. |
| GoogleCloudDialogflowV2HumanAgentHandoffConfigSalesforceLiveAgentConfig? |
| salesforceLiveAgentConfig; |
| |
| GoogleCloudDialogflowV2HumanAgentHandoffConfig({ |
| this.livePersonConfig, |
| this.salesforceLiveAgentConfig, |
| }); |
| |
| GoogleCloudDialogflowV2HumanAgentHandoffConfig.fromJson(core.Map _json) |
| : this( |
| livePersonConfig: _json.containsKey('livePersonConfig') |
| ? GoogleCloudDialogflowV2HumanAgentHandoffConfigLivePersonConfig |
| .fromJson(_json['livePersonConfig'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| salesforceLiveAgentConfig: _json |
| .containsKey('salesforceLiveAgentConfig') |
| ? GoogleCloudDialogflowV2HumanAgentHandoffConfigSalesforceLiveAgentConfig |
| .fromJson(_json['salesforceLiveAgentConfig'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (livePersonConfig != null) |
| 'livePersonConfig': livePersonConfig!.toJson(), |
| if (salesforceLiveAgentConfig != null) |
| 'salesforceLiveAgentConfig': salesforceLiveAgentConfig!.toJson(), |
| }; |
| } |
| |
| /// Configuration specific to LivePerson (https://www.liveperson.com). |
| class GoogleCloudDialogflowV2HumanAgentHandoffConfigLivePersonConfig { |
| /// Account number of the LivePerson account to connect. |
| /// |
| /// This is the account number you input at the login page. |
| /// |
| /// Required. |
| core.String? accountNumber; |
| |
| GoogleCloudDialogflowV2HumanAgentHandoffConfigLivePersonConfig({ |
| this.accountNumber, |
| }); |
| |
| GoogleCloudDialogflowV2HumanAgentHandoffConfigLivePersonConfig.fromJson( |
| core.Map _json) |
| : this( |
| accountNumber: _json.containsKey('accountNumber') |
| ? _json['accountNumber'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (accountNumber != null) 'accountNumber': accountNumber!, |
| }; |
| } |
| |
| /// Configuration specific to Salesforce Live Agent. |
| class GoogleCloudDialogflowV2HumanAgentHandoffConfigSalesforceLiveAgentConfig { |
| /// Live Agent chat button ID. |
| /// |
| /// Required. |
| core.String? buttonId; |
| |
| /// Live Agent deployment ID. |
| /// |
| /// Required. |
| core.String? deploymentId; |
| |
| /// Domain of the Live Agent endpoint for this agent. |
| /// |
| /// You can find the endpoint URL in the `Live Agent settings` page. For |
| /// example if URL has the form |
| /// https://d.la4-c2-phx.salesforceliveagent.com/..., you should fill in |
| /// d.la4-c2-phx.salesforceliveagent.com. |
| /// |
| /// Required. |
| core.String? endpointDomain; |
| |
| /// The organization ID of the Salesforce account. |
| /// |
| /// Required. |
| core.String? organizationId; |
| |
| GoogleCloudDialogflowV2HumanAgentHandoffConfigSalesforceLiveAgentConfig({ |
| this.buttonId, |
| this.deploymentId, |
| this.endpointDomain, |
| this.organizationId, |
| }); |
| |
| GoogleCloudDialogflowV2HumanAgentHandoffConfigSalesforceLiveAgentConfig.fromJson( |
| core.Map _json) |
| : this( |
| buttonId: _json.containsKey('buttonId') |
| ? _json['buttonId'] as core.String |
| : null, |
| deploymentId: _json.containsKey('deploymentId') |
| ? _json['deploymentId'] as core.String |
| : null, |
| endpointDomain: _json.containsKey('endpointDomain') |
| ? _json['endpointDomain'] as core.String |
| : null, |
| organizationId: _json.containsKey('organizationId') |
| ? _json['organizationId'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (buttonId != null) 'buttonId': buttonId!, |
| if (deploymentId != null) 'deploymentId': deploymentId!, |
| if (endpointDomain != null) 'endpointDomain': endpointDomain!, |
| if (organizationId != null) 'organizationId': organizationId!, |
| }; |
| } |
| |
| /// The request message for Agents.ImportAgent. |
| class GoogleCloudDialogflowV2ImportAgentRequest { |
| /// Zip compressed raw byte content for agent. |
| core.String? agentContent; |
| core.List<core.int> get agentContentAsBytes => |
| convert.base64.decode(agentContent!); |
| |
| set agentContentAsBytes(core.List<core.int> _bytes) { |
| agentContent = |
| convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); |
| } |
| |
| /// The URI to a Google Cloud Storage file containing the agent to import. |
| /// |
| /// Note: The URI must start with "gs://". |
| core.String? agentUri; |
| |
| GoogleCloudDialogflowV2ImportAgentRequest({ |
| this.agentContent, |
| this.agentUri, |
| }); |
| |
| GoogleCloudDialogflowV2ImportAgentRequest.fromJson(core.Map _json) |
| : this( |
| agentContent: _json.containsKey('agentContent') |
| ? _json['agentContent'] as core.String |
| : null, |
| agentUri: _json.containsKey('agentUri') |
| ? _json['agentUri'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (agentContent != null) 'agentContent': agentContent!, |
| if (agentUri != null) 'agentUri': agentUri!, |
| }; |
| } |
| |
| /// Instructs the speech recognizer how to process the audio content. |
| class GoogleCloudDialogflowV2InputAudioConfig { |
| /// Audio encoding of the audio content to process. |
| /// |
| /// Required. |
| /// Possible string values are: |
| /// - "AUDIO_ENCODING_UNSPECIFIED" : Not specified. |
| /// - "AUDIO_ENCODING_LINEAR_16" : Uncompressed 16-bit signed little-endian |
| /// samples (Linear PCM). |
| /// - "AUDIO_ENCODING_FLAC" : |
| /// \[`FLAC`\](https://xiph.org/flac/documentation.html) (Free Lossless Audio |
| /// Codec) is the recommended encoding because it is lossless (therefore |
| /// recognition is not compromised) and requires only about half the bandwidth |
| /// of `LINEAR16`. `FLAC` stream encoding supports 16-bit and 24-bit samples, |
| /// however, not all fields in `STREAMINFO` are supported. |
| /// - "AUDIO_ENCODING_MULAW" : 8-bit samples that compand 14-bit audio samples |
| /// using G.711 PCMU/mu-law. |
| /// - "AUDIO_ENCODING_AMR" : Adaptive Multi-Rate Narrowband codec. |
| /// `sample_rate_hertz` must be 8000. |
| /// - "AUDIO_ENCODING_AMR_WB" : Adaptive Multi-Rate Wideband codec. |
| /// `sample_rate_hertz` must be 16000. |
| /// - "AUDIO_ENCODING_OGG_OPUS" : Opus encoded audio frames in Ogg container |
| /// ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be |
| /// 16000. |
| /// - "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE" : Although the use of lossy |
| /// encodings is not recommended, if a very low bitrate encoding is required, |
| /// `OGG_OPUS` is highly preferred over Speex encoding. The |
| /// [Speex](https://speex.org/) encoding supported by Dialogflow API has a |
| /// header byte in each block, as in MIME type |
| /// `audio/x-speex-with-header-byte`. It is a variant of the RTP Speex |
| /// encoding defined in [RFC 5574](https://tools.ietf.org/html/rfc5574). The |
| /// stream is a sequence of blocks, one block per RTP packet. Each block |
| /// starts with a byte containing the length of the block, in bytes, followed |
| /// by one or more frames of Speex data, padded to an integral number of bytes |
| /// (octets) as specified in RFC 5574. In other words, each RTP header is |
| /// replaced with a single byte containing the block length. Only Speex |
| /// wideband is supported. `sample_rate_hertz` must be 16000. |
| core.String? audioEncoding; |
| |
| /// Only used in Participants.AnalyzeContent and |
| /// Participants.StreamingAnalyzeContent. |
| /// |
| /// If `false` and recognition doesn't return any result, trigger |
| /// `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. |
| core.bool? disableNoSpeechRecognizedEvent; |
| |
| /// If `true`, Dialogflow returns SpeechWordInfo in StreamingRecognitionResult |
| /// with information about the recognized speech words, e.g. start and end |
| /// time offsets. |
| /// |
| /// If false or unspecified, Speech doesn't return any word-level information. |
| core.bool? enableWordInfo; |
| |
| /// The language of the supplied audio. |
| /// |
| /// Dialogflow does not do translations. See |
| /// [Language Support](https://cloud.google.com/dialogflow/docs/reference/language) |
| /// for a list of the currently supported language codes. Note that queries in |
| /// the same session do not necessarily need to specify the same language. |
| /// |
| /// Required. |
| core.String? languageCode; |
| |
| /// Which Speech model to select for the given request. |
| /// |
| /// Select the model best suited to your domain to get best results. If a |
| /// model is not explicitly specified, then we auto-select a model based on |
| /// the parameters in the InputAudioConfig. If enhanced speech model is |
| /// enabled for the agent and an enhanced version of the specified model for |
| /// the language does not exist, then the speech is recognized using the |
| /// standard version of the specified model. Refer to |
| /// [Cloud Speech API documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) |
| /// for more details. |
| core.String? model; |
| |
| /// Which variant of the Speech model to use. |
| /// Possible string values are: |
| /// - "SPEECH_MODEL_VARIANT_UNSPECIFIED" : No model variant specified. In this |
| /// case Dialogflow defaults to USE_BEST_AVAILABLE. |
| /// - "USE_BEST_AVAILABLE" : Use the best available variant of the Speech |
| /// model that the caller is eligible for. Please see the |
| /// [Dialogflow docs](https://cloud.google.com/dialogflow/docs/data-logging) |
| /// for how to make your project eligible for enhanced models. |
| /// - "USE_STANDARD" : Use standard model variant even if an enhanced model is |
| /// available. See the |
| /// [Cloud Speech documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) |
| /// for details about enhanced models. |
| /// - "USE_ENHANCED" : Use an enhanced model variant: * If an enhanced variant |
| /// does not exist for the given model and request language, Dialogflow falls |
| /// back to the standard variant. The |
| /// [Cloud Speech documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) |
| /// describes which models have enhanced variants. * If the API caller isn't |
| /// eligible for enhanced models, Dialogflow returns an error. Please see the |
| /// [Dialogflow docs](https://cloud.google.com/dialogflow/docs/data-logging) |
| /// for how to make your project eligible. |
| core.String? modelVariant; |
| |
| /// A list of strings containing words and phrases that the speech recognizer |
| /// should recognize with higher likelihood. |
| /// |
| /// See |
| /// [the Cloud Speech documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) |
| /// for more details. This field is deprecated. Please use |
| /// \[speech_contexts\]() instead. If you specify both \[phrase_hints\]() and |
| /// \[speech_contexts\](), Dialogflow will treat the \[phrase_hints\]() as a |
| /// single additional \[SpeechContext\](). |
| core.List<core.String>? phraseHints; |
| |
| /// Sample rate (in Hertz) of the audio content sent in the query. |
| /// |
| /// Refer to |
| /// [Cloud Speech API documentation](https://cloud.google.com/speech-to-text/docs/basics) |
| /// for more details. |
| /// |
| /// Required. |
| core.int? sampleRateHertz; |
| |
| /// If `false` (default), recognition does not cease until the client closes |
| /// the stream. |
| /// |
| /// If `true`, the recognizer will detect a single spoken utterance in input |
| /// audio. Recognition ceases when it detects the audio's voice has stopped or |
| /// paused. In this case, once a detected intent is received, the client |
| /// should close the stream and start a new request with a new stream as |
| /// needed. Note: This setting is relevant only for streaming methods. Note: |
| /// When specified, InputAudioConfig.single_utterance takes precedence over |
| /// StreamingDetectIntentRequest.single_utterance. |
| core.bool? singleUtterance; |
| |
| /// Context information to assist speech recognition. |
| /// |
| /// See |
| /// [the Cloud Speech documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) |
| /// for more details. |
| core.List<GoogleCloudDialogflowV2SpeechContext>? speechContexts; |
| |
| GoogleCloudDialogflowV2InputAudioConfig({ |
| this.audioEncoding, |
| this.disableNoSpeechRecognizedEvent, |
| this.enableWordInfo, |
| this.languageCode, |
| this.model, |
| this.modelVariant, |
| this.phraseHints, |
| this.sampleRateHertz, |
| this.singleUtterance, |
| this.speechContexts, |
| }); |
| |
| GoogleCloudDialogflowV2InputAudioConfig.fromJson(core.Map _json) |
| : this( |
| audioEncoding: _json.containsKey('audioEncoding') |
| ? _json['audioEncoding'] as core.String |
| : null, |
| disableNoSpeechRecognizedEvent: |
| _json.containsKey('disableNoSpeechRecognizedEvent') |
| ? _json['disableNoSpeechRecognizedEvent'] as core.bool |
| : null, |
| enableWordInfo: _json.containsKey('enableWordInfo') |
| ? _json['enableWordInfo'] as core.bool |
| : null, |
| languageCode: _json.containsKey('languageCode') |
| ? _json['languageCode'] as core.String |
| : null, |
| model: |
| _json.containsKey('model') ? _json['model'] as core.String : null, |
| modelVariant: _json.containsKey('modelVariant') |
| ? _json['modelVariant'] as core.String |
| : null, |
| phraseHints: _json.containsKey('phraseHints') |
| ? (_json['phraseHints'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| sampleRateHertz: _json.containsKey('sampleRateHertz') |
| ? _json['sampleRateHertz'] as core.int |
| : null, |
| singleUtterance: _json.containsKey('singleUtterance') |
| ? _json['singleUtterance'] as core.bool |
| : null, |
| speechContexts: _json.containsKey('speechContexts') |
| ? (_json['speechContexts'] as core.List) |
| .map<GoogleCloudDialogflowV2SpeechContext>((value) => |
| GoogleCloudDialogflowV2SpeechContext.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (audioEncoding != null) 'audioEncoding': audioEncoding!, |
| if (disableNoSpeechRecognizedEvent != null) |
| 'disableNoSpeechRecognizedEvent': disableNoSpeechRecognizedEvent!, |
| if (enableWordInfo != null) 'enableWordInfo': enableWordInfo!, |
| if (languageCode != null) 'languageCode': languageCode!, |
| if (model != null) 'model': model!, |
| if (modelVariant != null) 'modelVariant': modelVariant!, |
| if (phraseHints != null) 'phraseHints': phraseHints!, |
| if (sampleRateHertz != null) 'sampleRateHertz': sampleRateHertz!, |
| if (singleUtterance != null) 'singleUtterance': singleUtterance!, |
| if (speechContexts != null) |
| 'speechContexts': |
| speechContexts!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// An intent categorizes an end-user's intention for one conversation turn. |
| /// |
| /// For each agent, you define many intents, where your combined intents can |
| /// handle a complete conversation. When an end-user writes or says something, |
| /// referred to as an end-user expression or end-user input, Dialogflow matches |
| /// the end-user input to the best intent in your agent. Matching an intent is |
| /// also known as intent classification. For more information, see the |
| /// [intent guide](https://cloud.google.com/dialogflow/docs/intents-overview). |
| class GoogleCloudDialogflowV2Intent { |
| /// The name of the action associated with the intent. |
| /// |
| /// Note: The action name must not contain whitespaces. |
| /// |
| /// Optional. |
| core.String? action; |
| |
| /// The list of platforms for which the first responses will be copied from |
| /// the messages in PLATFORM_UNSPECIFIED (i.e. default platform). |
| /// |
| /// Optional. |
| core.List<core.String>? defaultResponsePlatforms; |
| |
| /// The name of this intent. |
| /// |
| /// Required. |
| core.String? displayName; |
| |
| /// Indicates that this intent ends an interaction. |
| /// |
| /// Some integrations (e.g., Actions on Google or Dialogflow phone gateway) |
| /// use this information to close interaction with an end user. Default is |
| /// false. |
| /// |
| /// Optional. |
| core.bool? endInteraction; |
| |
| /// The collection of event names that trigger the intent. |
| /// |
| /// If the collection of input contexts is not empty, all of the contexts must |
| /// be present in the active user session for an event to trigger this intent. |
| /// Event names are limited to 150 characters. |
| /// |
| /// Optional. |
| core.List<core.String>? events; |
| |
| /// Read-only. |
| /// |
| /// Information about all followup intents that have this intent as a direct |
| /// or indirect parent. We populate this field only in the output. |
| /// |
| /// Output only. |
| core.List<GoogleCloudDialogflowV2IntentFollowupIntentInfo>? |
| followupIntentInfo; |
| |
| /// The list of context names required for this intent to be triggered. |
| /// |
| /// Format: `projects//agent/sessions/-/contexts/`. |
| /// |
| /// Optional. |
| core.List<core.String>? inputContextNames; |
| |
| /// Indicates whether this is a fallback intent. |
| /// |
| /// Optional. |
| core.bool? isFallback; |
| |
| /// Indicates that a live agent should be brought in to handle the interaction |
| /// with the user. |
| /// |
| /// In most cases, when you set this flag to true, you would also want to set |
| /// end_interaction to true as well. Default is false. |
| /// |
| /// Optional. |
| core.bool? liveAgentHandoff; |
| |
| /// The collection of rich messages corresponding to the `Response` field in |
| /// the Dialogflow console. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2IntentMessage>? messages; |
| |
| /// Indicates whether Machine Learning is disabled for the intent. |
| /// |
| /// Note: If `ml_disabled` setting is set to true, then this intent is not |
| /// taken into account during inference in `ML ONLY` match mode. Also, |
| /// auto-markup in the UI is turned off. |
| /// |
| /// Optional. |
| core.bool? mlDisabled; |
| |
| /// The unique identifier of this intent. |
| /// |
| /// Required for Intents.UpdateIntent and Intents.BatchUpdateIntents methods. |
| /// Format: `projects//agent/intents/`. |
| /// |
| /// Optional. |
| core.String? name; |
| |
| /// The collection of contexts that are activated when the intent is matched. |
| /// |
| /// Context messages in this collection should not set the parameters field. |
| /// Setting the `lifespan_count` to 0 will reset the context when the intent |
| /// is matched. Format: `projects//agent/sessions/-/contexts/`. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2Context>? outputContexts; |
| |
| /// The collection of parameters associated with the intent. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2IntentParameter>? parameters; |
| |
| /// Read-only after creation. |
| /// |
| /// The unique identifier of the parent intent in the chain of followup |
| /// intents. You can set this field when creating an intent, for example with |
| /// CreateIntent or BatchUpdateIntents, in order to make this intent a |
| /// followup intent. It identifies the parent followup intent. Format: |
| /// `projects//agent/intents/`. |
| core.String? parentFollowupIntentName; |
| |
| /// The priority of this intent. |
| /// |
| /// Higher numbers represent higher priorities. - If the supplied value is |
| /// unspecified or 0, the service translates the value to 500,000, which |
| /// corresponds to the `Normal` priority in the console. - If the supplied |
| /// value is negative, the intent is ignored in runtime detect intent |
| /// requests. |
| /// |
| /// Optional. |
| core.int? priority; |
| |
| /// Indicates whether to delete all contexts in the current session when this |
| /// intent is matched. |
| /// |
| /// Optional. |
| core.bool? resetContexts; |
| |
| /// Read-only. |
| /// |
| /// The unique identifier of the root intent in the chain of followup intents. |
| /// It identifies the correct followup intents chain for this intent. We |
| /// populate this field only in the output. Format: |
| /// `projects//agent/intents/`. |
| /// |
| /// Output only. |
| core.String? rootFollowupIntentName; |
| |
| /// The collection of examples that the agent is trained on. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2IntentTrainingPhrase>? trainingPhrases; |
| |
| /// Indicates whether webhooks are enabled for the intent. |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "WEBHOOK_STATE_UNSPECIFIED" : Webhook is disabled in the agent and in |
| /// the intent. |
| /// - "WEBHOOK_STATE_ENABLED" : Webhook is enabled in the agent and in the |
| /// intent. |
| /// - "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING" : Webhook is enabled in the |
| /// agent and in the intent. Also, each slot filling prompt is forwarded to |
| /// the webhook. |
| core.String? webhookState; |
| |
| GoogleCloudDialogflowV2Intent({ |
| this.action, |
| this.defaultResponsePlatforms, |
| this.displayName, |
| this.endInteraction, |
| this.events, |
| this.followupIntentInfo, |
| this.inputContextNames, |
| this.isFallback, |
| this.liveAgentHandoff, |
| this.messages, |
| this.mlDisabled, |
| this.name, |
| this.outputContexts, |
| this.parameters, |
| this.parentFollowupIntentName, |
| this.priority, |
| this.resetContexts, |
| this.rootFollowupIntentName, |
| this.trainingPhrases, |
| this.webhookState, |
| }); |
| |
| GoogleCloudDialogflowV2Intent.fromJson(core.Map _json) |
| : this( |
| action: _json.containsKey('action') |
| ? _json['action'] as core.String |
| : null, |
| defaultResponsePlatforms: |
| _json.containsKey('defaultResponsePlatforms') |
| ? (_json['defaultResponsePlatforms'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| endInteraction: _json.containsKey('endInteraction') |
| ? _json['endInteraction'] as core.bool |
| : null, |
| events: _json.containsKey('events') |
| ? (_json['events'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| followupIntentInfo: _json.containsKey('followupIntentInfo') |
| ? (_json['followupIntentInfo'] as core.List) |
| .map<GoogleCloudDialogflowV2IntentFollowupIntentInfo>( |
| (value) => GoogleCloudDialogflowV2IntentFollowupIntentInfo |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| inputContextNames: _json.containsKey('inputContextNames') |
| ? (_json['inputContextNames'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| isFallback: _json.containsKey('isFallback') |
| ? _json['isFallback'] as core.bool |
| : null, |
| liveAgentHandoff: _json.containsKey('liveAgentHandoff') |
| ? _json['liveAgentHandoff'] as core.bool |
| : null, |
| messages: _json.containsKey('messages') |
| ? (_json['messages'] as core.List) |
| .map<GoogleCloudDialogflowV2IntentMessage>((value) => |
| GoogleCloudDialogflowV2IntentMessage.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| mlDisabled: _json.containsKey('mlDisabled') |
| ? _json['mlDisabled'] as core.bool |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| outputContexts: _json.containsKey('outputContexts') |
| ? (_json['outputContexts'] as core.List) |
| .map<GoogleCloudDialogflowV2Context>((value) => |
| GoogleCloudDialogflowV2Context.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| parameters: _json.containsKey('parameters') |
| ? (_json['parameters'] as core.List) |
| .map<GoogleCloudDialogflowV2IntentParameter>((value) => |
| GoogleCloudDialogflowV2IntentParameter.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| parentFollowupIntentName: |
| _json.containsKey('parentFollowupIntentName') |
| ? _json['parentFollowupIntentName'] as core.String |
| : null, |
| priority: _json.containsKey('priority') |
| ? _json['priority'] as core.int |
| : null, |
| resetContexts: _json.containsKey('resetContexts') |
| ? _json['resetContexts'] as core.bool |
| : null, |
| rootFollowupIntentName: _json.containsKey('rootFollowupIntentName') |
| ? _json['rootFollowupIntentName'] as core.String |
| : null, |
| trainingPhrases: _json.containsKey('trainingPhrases') |
| ? (_json['trainingPhrases'] as core.List) |
| .map<GoogleCloudDialogflowV2IntentTrainingPhrase>((value) => |
| GoogleCloudDialogflowV2IntentTrainingPhrase.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| webhookState: _json.containsKey('webhookState') |
| ? _json['webhookState'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (action != null) 'action': action!, |
| if (defaultResponsePlatforms != null) |
| 'defaultResponsePlatforms': defaultResponsePlatforms!, |
| if (displayName != null) 'displayName': displayName!, |
| if (endInteraction != null) 'endInteraction': endInteraction!, |
| if (events != null) 'events': events!, |
| if (followupIntentInfo != null) |
| 'followupIntentInfo': |
| followupIntentInfo!.map((value) => value.toJson()).toList(), |
| if (inputContextNames != null) 'inputContextNames': inputContextNames!, |
| if (isFallback != null) 'isFallback': isFallback!, |
| if (liveAgentHandoff != null) 'liveAgentHandoff': liveAgentHandoff!, |
| if (messages != null) |
| 'messages': messages!.map((value) => value.toJson()).toList(), |
| if (mlDisabled != null) 'mlDisabled': mlDisabled!, |
| if (name != null) 'name': name!, |
| if (outputContexts != null) |
| 'outputContexts': |
| outputContexts!.map((value) => value.toJson()).toList(), |
| if (parameters != null) |
| 'parameters': parameters!.map((value) => value.toJson()).toList(), |
| if (parentFollowupIntentName != null) |
| 'parentFollowupIntentName': parentFollowupIntentName!, |
| if (priority != null) 'priority': priority!, |
| if (resetContexts != null) 'resetContexts': resetContexts!, |
| if (rootFollowupIntentName != null) |
| 'rootFollowupIntentName': rootFollowupIntentName!, |
| if (trainingPhrases != null) |
| 'trainingPhrases': |
| trainingPhrases!.map((value) => value.toJson()).toList(), |
| if (webhookState != null) 'webhookState': webhookState!, |
| }; |
| } |
| |
| /// This message is a wrapper around a collection of intents. |
| class GoogleCloudDialogflowV2IntentBatch { |
| /// A collection of intents. |
| core.List<GoogleCloudDialogflowV2Intent>? intents; |
| |
| GoogleCloudDialogflowV2IntentBatch({ |
| this.intents, |
| }); |
| |
| GoogleCloudDialogflowV2IntentBatch.fromJson(core.Map _json) |
| : this( |
| intents: _json.containsKey('intents') |
| ? (_json['intents'] as core.List) |
| .map<GoogleCloudDialogflowV2Intent>((value) => |
| GoogleCloudDialogflowV2Intent.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (intents != null) |
| 'intents': intents!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Represents a single followup intent in the chain. |
| class GoogleCloudDialogflowV2IntentFollowupIntentInfo { |
| /// The unique identifier of the followup intent. |
| /// |
| /// Format: `projects//agent/intents/`. |
| core.String? followupIntentName; |
| |
| /// The unique identifier of the followup intent's parent. |
| /// |
| /// Format: `projects//agent/intents/`. |
| core.String? parentFollowupIntentName; |
| |
| GoogleCloudDialogflowV2IntentFollowupIntentInfo({ |
| this.followupIntentName, |
| this.parentFollowupIntentName, |
| }); |
| |
| GoogleCloudDialogflowV2IntentFollowupIntentInfo.fromJson(core.Map _json) |
| : this( |
| followupIntentName: _json.containsKey('followupIntentName') |
| ? _json['followupIntentName'] as core.String |
| : null, |
| parentFollowupIntentName: |
| _json.containsKey('parentFollowupIntentName') |
| ? _json['parentFollowupIntentName'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (followupIntentName != null) |
| 'followupIntentName': followupIntentName!, |
| if (parentFollowupIntentName != null) |
| 'parentFollowupIntentName': parentFollowupIntentName!, |
| }; |
| } |
| |
| /// A rich response message. |
| /// |
| /// Corresponds to the intent `Response` field in the Dialogflow console. For |
| /// more information, see |
| /// [Rich response messages](https://cloud.google.com/dialogflow/docs/intents-rich-messages). |
| class GoogleCloudDialogflowV2IntentMessage { |
| /// The basic card response for Actions on Google. |
| GoogleCloudDialogflowV2IntentMessageBasicCard? basicCard; |
| |
| /// Browse carousel card for Actions on Google. |
| GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard? browseCarouselCard; |
| |
| /// The card response. |
| GoogleCloudDialogflowV2IntentMessageCard? card; |
| |
| /// The carousel card response for Actions on Google. |
| GoogleCloudDialogflowV2IntentMessageCarouselSelect? carouselSelect; |
| |
| /// The image response. |
| GoogleCloudDialogflowV2IntentMessageImage? image; |
| |
| /// The link out suggestion chip for Actions on Google. |
| GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion? linkOutSuggestion; |
| |
| /// The list card response for Actions on Google. |
| GoogleCloudDialogflowV2IntentMessageListSelect? listSelect; |
| |
| /// The media content card for Actions on Google. |
| GoogleCloudDialogflowV2IntentMessageMediaContent? mediaContent; |
| |
| /// A custom platform-specific response. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? payload; |
| |
| /// The platform that this message is intended for. |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "PLATFORM_UNSPECIFIED" : Default platform. |
| /// - "FACEBOOK" : Facebook. |
| /// - "SLACK" : Slack. |
| /// - "TELEGRAM" : Telegram. |
| /// - "KIK" : Kik. |
| /// - "SKYPE" : Skype. |
| /// - "LINE" : Line. |
| /// - "VIBER" : Viber. |
| /// - "ACTIONS_ON_GOOGLE" : Google Assistant See |
| /// [Dialogflow webhook format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) |
| /// - "GOOGLE_HANGOUTS" : Google Hangouts. |
| core.String? platform; |
| |
| /// The quick replies response. |
| GoogleCloudDialogflowV2IntentMessageQuickReplies? quickReplies; |
| |
| /// The voice and text-only responses for Actions on Google. |
| GoogleCloudDialogflowV2IntentMessageSimpleResponses? simpleResponses; |
| |
| /// The suggestion chips for Actions on Google. |
| GoogleCloudDialogflowV2IntentMessageSuggestions? suggestions; |
| |
| /// Table card for Actions on Google. |
| GoogleCloudDialogflowV2IntentMessageTableCard? tableCard; |
| |
| /// The text response. |
| GoogleCloudDialogflowV2IntentMessageText? text; |
| |
| GoogleCloudDialogflowV2IntentMessage({ |
| this.basicCard, |
| this.browseCarouselCard, |
| this.card, |
| this.carouselSelect, |
| this.image, |
| this.linkOutSuggestion, |
| this.listSelect, |
| this.mediaContent, |
| this.payload, |
| this.platform, |
| this.quickReplies, |
| this.simpleResponses, |
| this.suggestions, |
| this.tableCard, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessage.fromJson(core.Map _json) |
| : this( |
| basicCard: _json.containsKey('basicCard') |
| ? GoogleCloudDialogflowV2IntentMessageBasicCard.fromJson( |
| _json['basicCard'] as core.Map<core.String, core.dynamic>) |
| : null, |
| browseCarouselCard: _json.containsKey('browseCarouselCard') |
| ? GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard.fromJson( |
| _json['browseCarouselCard'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| card: _json.containsKey('card') |
| ? GoogleCloudDialogflowV2IntentMessageCard.fromJson( |
| _json['card'] as core.Map<core.String, core.dynamic>) |
| : null, |
| carouselSelect: _json.containsKey('carouselSelect') |
| ? GoogleCloudDialogflowV2IntentMessageCarouselSelect.fromJson( |
| _json['carouselSelect'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| image: _json.containsKey('image') |
| ? GoogleCloudDialogflowV2IntentMessageImage.fromJson( |
| _json['image'] as core.Map<core.String, core.dynamic>) |
| : null, |
| linkOutSuggestion: _json.containsKey('linkOutSuggestion') |
| ? GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion.fromJson( |
| _json['linkOutSuggestion'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| listSelect: _json.containsKey('listSelect') |
| ? GoogleCloudDialogflowV2IntentMessageListSelect.fromJson( |
| _json['listSelect'] as core.Map<core.String, core.dynamic>) |
| : null, |
| mediaContent: _json.containsKey('mediaContent') |
| ? GoogleCloudDialogflowV2IntentMessageMediaContent.fromJson( |
| _json['mediaContent'] as core.Map<core.String, core.dynamic>) |
| : null, |
| payload: _json.containsKey('payload') |
| ? (_json['payload'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| platform: _json.containsKey('platform') |
| ? _json['platform'] as core.String |
| : null, |
| quickReplies: _json.containsKey('quickReplies') |
| ? GoogleCloudDialogflowV2IntentMessageQuickReplies.fromJson( |
| _json['quickReplies'] as core.Map<core.String, core.dynamic>) |
| : null, |
| simpleResponses: _json.containsKey('simpleResponses') |
| ? GoogleCloudDialogflowV2IntentMessageSimpleResponses.fromJson( |
| _json['simpleResponses'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| suggestions: _json.containsKey('suggestions') |
| ? GoogleCloudDialogflowV2IntentMessageSuggestions.fromJson( |
| _json['suggestions'] as core.Map<core.String, core.dynamic>) |
| : null, |
| tableCard: _json.containsKey('tableCard') |
| ? GoogleCloudDialogflowV2IntentMessageTableCard.fromJson( |
| _json['tableCard'] as core.Map<core.String, core.dynamic>) |
| : null, |
| text: _json.containsKey('text') |
| ? GoogleCloudDialogflowV2IntentMessageText.fromJson( |
| _json['text'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (basicCard != null) 'basicCard': basicCard!.toJson(), |
| if (browseCarouselCard != null) |
| 'browseCarouselCard': browseCarouselCard!.toJson(), |
| if (card != null) 'card': card!.toJson(), |
| if (carouselSelect != null) 'carouselSelect': carouselSelect!.toJson(), |
| if (image != null) 'image': image!.toJson(), |
| if (linkOutSuggestion != null) |
| 'linkOutSuggestion': linkOutSuggestion!.toJson(), |
| if (listSelect != null) 'listSelect': listSelect!.toJson(), |
| if (mediaContent != null) 'mediaContent': mediaContent!.toJson(), |
| if (payload != null) 'payload': payload!, |
| if (platform != null) 'platform': platform!, |
| if (quickReplies != null) 'quickReplies': quickReplies!.toJson(), |
| if (simpleResponses != null) |
| 'simpleResponses': simpleResponses!.toJson(), |
| if (suggestions != null) 'suggestions': suggestions!.toJson(), |
| if (tableCard != null) 'tableCard': tableCard!.toJson(), |
| if (text != null) 'text': text!.toJson(), |
| }; |
| } |
| |
| /// The basic card message. |
| /// |
| /// Useful for displaying information. |
| class GoogleCloudDialogflowV2IntentMessageBasicCard { |
| /// The collection of card buttons. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2IntentMessageBasicCardButton>? buttons; |
| |
| /// Required, unless image is present. |
| /// |
| /// The body text of the card. |
| core.String? formattedText; |
| |
| /// The image for the card. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2IntentMessageImage? image; |
| |
| /// The subtitle of the card. |
| /// |
| /// Optional. |
| core.String? subtitle; |
| |
| /// The title of the card. |
| /// |
| /// Optional. |
| core.String? title; |
| |
| GoogleCloudDialogflowV2IntentMessageBasicCard({ |
| this.buttons, |
| this.formattedText, |
| this.image, |
| this.subtitle, |
| this.title, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageBasicCard.fromJson(core.Map _json) |
| : this( |
| buttons: _json.containsKey('buttons') |
| ? (_json['buttons'] as core.List) |
| .map<GoogleCloudDialogflowV2IntentMessageBasicCardButton>( |
| (value) => |
| GoogleCloudDialogflowV2IntentMessageBasicCardButton |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| formattedText: _json.containsKey('formattedText') |
| ? _json['formattedText'] as core.String |
| : null, |
| image: _json.containsKey('image') |
| ? GoogleCloudDialogflowV2IntentMessageImage.fromJson( |
| _json['image'] as core.Map<core.String, core.dynamic>) |
| : null, |
| subtitle: _json.containsKey('subtitle') |
| ? _json['subtitle'] as core.String |
| : null, |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (buttons != null) |
| 'buttons': buttons!.map((value) => value.toJson()).toList(), |
| if (formattedText != null) 'formattedText': formattedText!, |
| if (image != null) 'image': image!.toJson(), |
| if (subtitle != null) 'subtitle': subtitle!, |
| if (title != null) 'title': title!, |
| }; |
| } |
| |
| /// The button object that appears at the bottom of a card. |
| class GoogleCloudDialogflowV2IntentMessageBasicCardButton { |
| /// Action to take when a user taps on the button. |
| /// |
| /// Required. |
| GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction? |
| openUriAction; |
| |
| /// The title of the button. |
| /// |
| /// Required. |
| core.String? title; |
| |
| GoogleCloudDialogflowV2IntentMessageBasicCardButton({ |
| this.openUriAction, |
| this.title, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageBasicCardButton.fromJson(core.Map _json) |
| : this( |
| openUriAction: _json.containsKey('openUriAction') |
| ? GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction |
| .fromJson(_json['openUriAction'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (openUriAction != null) 'openUriAction': openUriAction!.toJson(), |
| if (title != null) 'title': title!, |
| }; |
| } |
| |
| /// Opens the given URI. |
| class GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction { |
| /// The HTTP or HTTPS scheme URI. |
| /// |
| /// Required. |
| core.String? uri; |
| |
| GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction({ |
| this.uri, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction.fromJson( |
| core.Map _json) |
| : this( |
| uri: _json.containsKey('uri') ? _json['uri'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (uri != null) 'uri': uri!, |
| }; |
| } |
| |
| /// Browse Carousel Card for Actions on Google. |
| /// |
| /// https://developers.google.com/actions/assistant/responses#browsing_carousel |
| class GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard { |
| /// Settings for displaying the image. |
| /// |
| /// Applies to every image in items. |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED" : Fill the gaps between the image |
| /// and the image container with gray bars. |
| /// - "GRAY" : Fill the gaps between the image and the image container with |
| /// gray bars. |
| /// - "WHITE" : Fill the gaps between the image and the image container with |
| /// white bars. |
| /// - "CROPPED" : Image is scaled such that the image width and height match |
| /// or exceed the container dimensions. This may crop the top and bottom of |
| /// the image if the scaled image height is greater than the container height, |
| /// or crop the left and right of the image if the scaled image width is |
| /// greater than the container width. This is similar to "Zoom Mode" on a |
| /// widescreen TV when playing a 4:3 video. |
| /// - "BLURRED_BACKGROUND" : Pad the gaps between image and image frame with a |
| /// blurred copy of the same image. |
| core.String? imageDisplayOptions; |
| |
| /// List of items in the Browse Carousel Card. |
| /// |
| /// Minimum of two items, maximum of ten. |
| /// |
| /// Required. |
| core.List< |
| GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItem>? |
| items; |
| |
| GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard({ |
| this.imageDisplayOptions, |
| this.items, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard.fromJson( |
| core.Map _json) |
| : this( |
| imageDisplayOptions: _json.containsKey('imageDisplayOptions') |
| ? _json['imageDisplayOptions'] as core.String |
| : null, |
| items: _json.containsKey('items') |
| ? (_json['items'] as core.List) |
| .map<GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItem>( |
| (value) => |
| GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItem |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (imageDisplayOptions != null) |
| 'imageDisplayOptions': imageDisplayOptions!, |
| if (items != null) |
| 'items': items!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Browsing carousel tile |
| class GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItem { |
| /// Description of the carousel item. |
| /// |
| /// Maximum of four lines of text. |
| /// |
| /// Optional. |
| core.String? description; |
| |
| /// Text that appears at the bottom of the Browse Carousel Card. |
| /// |
| /// Maximum of one line of text. |
| /// |
| /// Optional. |
| core.String? footer; |
| |
| /// Hero image for the carousel item. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2IntentMessageImage? image; |
| |
| /// Action to present to the user. |
| /// |
| /// Required. |
| GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction? |
| openUriAction; |
| |
| /// Title of the carousel item. |
| /// |
| /// Maximum of two lines of text. |
| /// |
| /// Required. |
| core.String? title; |
| |
| GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItem({ |
| this.description, |
| this.footer, |
| this.image, |
| this.openUriAction, |
| this.title, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItem.fromJson( |
| core.Map _json) |
| : this( |
| description: _json.containsKey('description') |
| ? _json['description'] as core.String |
| : null, |
| footer: _json.containsKey('footer') |
| ? _json['footer'] as core.String |
| : null, |
| image: _json.containsKey('image') |
| ? GoogleCloudDialogflowV2IntentMessageImage.fromJson( |
| _json['image'] as core.Map<core.String, core.dynamic>) |
| : null, |
| openUriAction: _json.containsKey('openUriAction') |
| ? GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction |
| .fromJson(_json['openUriAction'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (description != null) 'description': description!, |
| if (footer != null) 'footer': footer!, |
| if (image != null) 'image': image!.toJson(), |
| if (openUriAction != null) 'openUriAction': openUriAction!.toJson(), |
| if (title != null) 'title': title!, |
| }; |
| } |
| |
| /// Actions on Google action to open a given url. |
| class GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction { |
| /// URL |
| /// |
| /// Required. |
| core.String? url; |
| |
| /// Specifies the type of viewer that is used when opening the URL. |
| /// |
| /// Defaults to opening via web browser. |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "URL_TYPE_HINT_UNSPECIFIED" : Unspecified |
| /// - "AMP_ACTION" : Url would be an amp action |
| /// - "AMP_CONTENT" : URL that points directly to AMP content, or to a |
| /// canonical URL which refers to AMP content via . |
| core.String? urlTypeHint; |
| |
| GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction({ |
| this.url, |
| this.urlTypeHint, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction.fromJson( |
| core.Map _json) |
| : this( |
| url: _json.containsKey('url') ? _json['url'] as core.String : null, |
| urlTypeHint: _json.containsKey('urlTypeHint') |
| ? _json['urlTypeHint'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (url != null) 'url': url!, |
| if (urlTypeHint != null) 'urlTypeHint': urlTypeHint!, |
| }; |
| } |
| |
| /// The card response message. |
| class GoogleCloudDialogflowV2IntentMessageCard { |
| /// The collection of card buttons. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2IntentMessageCardButton>? buttons; |
| |
| /// The public URI to an image file for the card. |
| /// |
| /// Optional. |
| core.String? imageUri; |
| |
| /// The subtitle of the card. |
| /// |
| /// Optional. |
| core.String? subtitle; |
| |
| /// The title of the card. |
| /// |
| /// Optional. |
| core.String? title; |
| |
| GoogleCloudDialogflowV2IntentMessageCard({ |
| this.buttons, |
| this.imageUri, |
| this.subtitle, |
| this.title, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageCard.fromJson(core.Map _json) |
| : this( |
| buttons: _json.containsKey('buttons') |
| ? (_json['buttons'] as core.List) |
| .map<GoogleCloudDialogflowV2IntentMessageCardButton>( |
| (value) => GoogleCloudDialogflowV2IntentMessageCardButton |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| imageUri: _json.containsKey('imageUri') |
| ? _json['imageUri'] as core.String |
| : null, |
| subtitle: _json.containsKey('subtitle') |
| ? _json['subtitle'] as core.String |
| : null, |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (buttons != null) |
| 'buttons': buttons!.map((value) => value.toJson()).toList(), |
| if (imageUri != null) 'imageUri': imageUri!, |
| if (subtitle != null) 'subtitle': subtitle!, |
| if (title != null) 'title': title!, |
| }; |
| } |
| |
| /// Contains information about a button. |
| class GoogleCloudDialogflowV2IntentMessageCardButton { |
| /// The text to send back to the Dialogflow API or a URI to open. |
| /// |
| /// Optional. |
| core.String? postback; |
| |
| /// The text to show on the button. |
| /// |
| /// Optional. |
| core.String? text; |
| |
| GoogleCloudDialogflowV2IntentMessageCardButton({ |
| this.postback, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageCardButton.fromJson(core.Map _json) |
| : this( |
| postback: _json.containsKey('postback') |
| ? _json['postback'] as core.String |
| : null, |
| text: _json.containsKey('text') ? _json['text'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (postback != null) 'postback': postback!, |
| if (text != null) 'text': text!, |
| }; |
| } |
| |
| /// The card for presenting a carousel of options to select from. |
| class GoogleCloudDialogflowV2IntentMessageCarouselSelect { |
| /// Carousel items. |
| /// |
| /// Required. |
| core.List<GoogleCloudDialogflowV2IntentMessageCarouselSelectItem>? items; |
| |
| GoogleCloudDialogflowV2IntentMessageCarouselSelect({ |
| this.items, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageCarouselSelect.fromJson(core.Map _json) |
| : this( |
| items: _json.containsKey('items') |
| ? (_json['items'] as core.List) |
| .map<GoogleCloudDialogflowV2IntentMessageCarouselSelectItem>( |
| (value) => |
| GoogleCloudDialogflowV2IntentMessageCarouselSelectItem |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (items != null) |
| 'items': items!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// An item in the carousel. |
| class GoogleCloudDialogflowV2IntentMessageCarouselSelectItem { |
| /// The body text of the card. |
| /// |
| /// Optional. |
| core.String? description; |
| |
| /// The image to display. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2IntentMessageImage? image; |
| |
| /// Additional info about the option item. |
| /// |
| /// Required. |
| GoogleCloudDialogflowV2IntentMessageSelectItemInfo? info; |
| |
| /// Title of the carousel item. |
| /// |
| /// Required. |
| core.String? title; |
| |
| GoogleCloudDialogflowV2IntentMessageCarouselSelectItem({ |
| this.description, |
| this.image, |
| this.info, |
| this.title, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageCarouselSelectItem.fromJson( |
| core.Map _json) |
| : this( |
| description: _json.containsKey('description') |
| ? _json['description'] as core.String |
| : null, |
| image: _json.containsKey('image') |
| ? GoogleCloudDialogflowV2IntentMessageImage.fromJson( |
| _json['image'] as core.Map<core.String, core.dynamic>) |
| : null, |
| info: _json.containsKey('info') |
| ? GoogleCloudDialogflowV2IntentMessageSelectItemInfo.fromJson( |
| _json['info'] as core.Map<core.String, core.dynamic>) |
| : null, |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (description != null) 'description': description!, |
| if (image != null) 'image': image!.toJson(), |
| if (info != null) 'info': info!.toJson(), |
| if (title != null) 'title': title!, |
| }; |
| } |
| |
| /// Column properties for TableCard. |
| class GoogleCloudDialogflowV2IntentMessageColumnProperties { |
| /// Column heading. |
| /// |
| /// Required. |
| core.String? header; |
| |
| /// Defines text alignment for all cells in this column. |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "HORIZONTAL_ALIGNMENT_UNSPECIFIED" : Text is aligned to the leading edge |
| /// of the column. |
| /// - "LEADING" : Text is aligned to the leading edge of the column. |
| /// - "CENTER" : Text is centered in the column. |
| /// - "TRAILING" : Text is aligned to the trailing edge of the column. |
| core.String? horizontalAlignment; |
| |
| GoogleCloudDialogflowV2IntentMessageColumnProperties({ |
| this.header, |
| this.horizontalAlignment, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageColumnProperties.fromJson(core.Map _json) |
| : this( |
| header: _json.containsKey('header') |
| ? _json['header'] as core.String |
| : null, |
| horizontalAlignment: _json.containsKey('horizontalAlignment') |
| ? _json['horizontalAlignment'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (header != null) 'header': header!, |
| if (horizontalAlignment != null) |
| 'horizontalAlignment': horizontalAlignment!, |
| }; |
| } |
| |
| /// The image response message. |
| class GoogleCloudDialogflowV2IntentMessageImage { |
| /// A text description of the image to be used for accessibility, e.g., screen |
| /// readers. |
| /// |
| /// Optional. |
| core.String? accessibilityText; |
| |
| /// The public URI to an image file. |
| /// |
| /// Optional. |
| core.String? imageUri; |
| |
| GoogleCloudDialogflowV2IntentMessageImage({ |
| this.accessibilityText, |
| this.imageUri, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageImage.fromJson(core.Map _json) |
| : this( |
| accessibilityText: _json.containsKey('accessibilityText') |
| ? _json['accessibilityText'] as core.String |
| : null, |
| imageUri: _json.containsKey('imageUri') |
| ? _json['imageUri'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (accessibilityText != null) 'accessibilityText': accessibilityText!, |
| if (imageUri != null) 'imageUri': imageUri!, |
| }; |
| } |
| |
| /// The suggestion chip message that allows the user to jump out to the app or |
| /// website associated with this agent. |
| class GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion { |
| /// The name of the app or site this chip is linking to. |
| /// |
| /// Required. |
| core.String? destinationName; |
| |
| /// The URI of the app or site to open when the user taps the suggestion chip. |
| /// |
| /// Required. |
| core.String? uri; |
| |
| GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion({ |
| this.destinationName, |
| this.uri, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion.fromJson(core.Map _json) |
| : this( |
| destinationName: _json.containsKey('destinationName') |
| ? _json['destinationName'] as core.String |
| : null, |
| uri: _json.containsKey('uri') ? _json['uri'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (destinationName != null) 'destinationName': destinationName!, |
| if (uri != null) 'uri': uri!, |
| }; |
| } |
| |
| /// The card for presenting a list of options to select from. |
| class GoogleCloudDialogflowV2IntentMessageListSelect { |
| /// List items. |
| /// |
| /// Required. |
| core.List<GoogleCloudDialogflowV2IntentMessageListSelectItem>? items; |
| |
| /// Subtitle of the list. |
| /// |
| /// Optional. |
| core.String? subtitle; |
| |
| /// The overall title of the list. |
| /// |
| /// Optional. |
| core.String? title; |
| |
| GoogleCloudDialogflowV2IntentMessageListSelect({ |
| this.items, |
| this.subtitle, |
| this.title, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageListSelect.fromJson(core.Map _json) |
| : this( |
| items: _json.containsKey('items') |
| ? (_json['items'] as core.List) |
| .map<GoogleCloudDialogflowV2IntentMessageListSelectItem>( |
| (value) => |
| GoogleCloudDialogflowV2IntentMessageListSelectItem |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| subtitle: _json.containsKey('subtitle') |
| ? _json['subtitle'] as core.String |
| : null, |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (items != null) |
| 'items': items!.map((value) => value.toJson()).toList(), |
| if (subtitle != null) 'subtitle': subtitle!, |
| if (title != null) 'title': title!, |
| }; |
| } |
| |
| /// An item in the list. |
| class GoogleCloudDialogflowV2IntentMessageListSelectItem { |
| /// The main text describing the item. |
| /// |
| /// Optional. |
| core.String? description; |
| |
| /// The image to display. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2IntentMessageImage? image; |
| |
| /// Additional information about this option. |
| /// |
| /// Required. |
| GoogleCloudDialogflowV2IntentMessageSelectItemInfo? info; |
| |
| /// The title of the list item. |
| /// |
| /// Required. |
| core.String? title; |
| |
| GoogleCloudDialogflowV2IntentMessageListSelectItem({ |
| this.description, |
| this.image, |
| this.info, |
| this.title, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageListSelectItem.fromJson(core.Map _json) |
| : this( |
| description: _json.containsKey('description') |
| ? _json['description'] as core.String |
| : null, |
| image: _json.containsKey('image') |
| ? GoogleCloudDialogflowV2IntentMessageImage.fromJson( |
| _json['image'] as core.Map<core.String, core.dynamic>) |
| : null, |
| info: _json.containsKey('info') |
| ? GoogleCloudDialogflowV2IntentMessageSelectItemInfo.fromJson( |
| _json['info'] as core.Map<core.String, core.dynamic>) |
| : null, |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (description != null) 'description': description!, |
| if (image != null) 'image': image!.toJson(), |
| if (info != null) 'info': info!.toJson(), |
| if (title != null) 'title': title!, |
| }; |
| } |
| |
| /// The media content card for Actions on Google. |
| class GoogleCloudDialogflowV2IntentMessageMediaContent { |
| /// List of media objects. |
| /// |
| /// Required. |
| core.List< |
| GoogleCloudDialogflowV2IntentMessageMediaContentResponseMediaObject>? |
| mediaObjects; |
| |
| /// What type of media is the content (ie "audio"). |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "RESPONSE_MEDIA_TYPE_UNSPECIFIED" : Unspecified. |
| /// - "AUDIO" : Response media type is audio. |
| core.String? mediaType; |
| |
| GoogleCloudDialogflowV2IntentMessageMediaContent({ |
| this.mediaObjects, |
| this.mediaType, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageMediaContent.fromJson(core.Map _json) |
| : this( |
| mediaObjects: _json.containsKey('mediaObjects') |
| ? (_json['mediaObjects'] as core.List) |
| .map<GoogleCloudDialogflowV2IntentMessageMediaContentResponseMediaObject>( |
| (value) => |
| GoogleCloudDialogflowV2IntentMessageMediaContentResponseMediaObject |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| mediaType: _json.containsKey('mediaType') |
| ? _json['mediaType'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (mediaObjects != null) |
| 'mediaObjects': mediaObjects!.map((value) => value.toJson()).toList(), |
| if (mediaType != null) 'mediaType': mediaType!, |
| }; |
| } |
| |
| /// Response media object for media content card. |
| class GoogleCloudDialogflowV2IntentMessageMediaContentResponseMediaObject { |
| /// Url where the media is stored. |
| /// |
| /// Required. |
| core.String? contentUrl; |
| |
| /// Description of media card. |
| /// |
| /// Optional. |
| core.String? description; |
| |
| /// Icon to display above media content. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2IntentMessageImage? icon; |
| |
| /// Image to display above media content. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2IntentMessageImage? largeImage; |
| |
| /// Name of media card. |
| /// |
| /// Required. |
| core.String? name; |
| |
| GoogleCloudDialogflowV2IntentMessageMediaContentResponseMediaObject({ |
| this.contentUrl, |
| this.description, |
| this.icon, |
| this.largeImage, |
| this.name, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageMediaContentResponseMediaObject.fromJson( |
| core.Map _json) |
| : this( |
| contentUrl: _json.containsKey('contentUrl') |
| ? _json['contentUrl'] as core.String |
| : null, |
| description: _json.containsKey('description') |
| ? _json['description'] as core.String |
| : null, |
| icon: _json.containsKey('icon') |
| ? GoogleCloudDialogflowV2IntentMessageImage.fromJson( |
| _json['icon'] as core.Map<core.String, core.dynamic>) |
| : null, |
| largeImage: _json.containsKey('largeImage') |
| ? GoogleCloudDialogflowV2IntentMessageImage.fromJson( |
| _json['largeImage'] as core.Map<core.String, core.dynamic>) |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (contentUrl != null) 'contentUrl': contentUrl!, |
| if (description != null) 'description': description!, |
| if (icon != null) 'icon': icon!.toJson(), |
| if (largeImage != null) 'largeImage': largeImage!.toJson(), |
| if (name != null) 'name': name!, |
| }; |
| } |
| |
| /// The quick replies response message. |
| class GoogleCloudDialogflowV2IntentMessageQuickReplies { |
| /// The collection of quick replies. |
| /// |
| /// Optional. |
| core.List<core.String>? quickReplies; |
| |
| /// The title of the collection of quick replies. |
| /// |
| /// Optional. |
| core.String? title; |
| |
| GoogleCloudDialogflowV2IntentMessageQuickReplies({ |
| this.quickReplies, |
| this.title, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageQuickReplies.fromJson(core.Map _json) |
| : this( |
| quickReplies: _json.containsKey('quickReplies') |
| ? (_json['quickReplies'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (quickReplies != null) 'quickReplies': quickReplies!, |
| if (title != null) 'title': title!, |
| }; |
| } |
| |
| /// Additional info about the select item for when it is triggered in a dialog. |
| class GoogleCloudDialogflowV2IntentMessageSelectItemInfo { |
| /// A unique key that will be sent back to the agent if this response is |
| /// given. |
| /// |
| /// Required. |
| core.String? key; |
| |
| /// A list of synonyms that can also be used to trigger this item in dialog. |
| /// |
| /// Optional. |
| core.List<core.String>? synonyms; |
| |
| GoogleCloudDialogflowV2IntentMessageSelectItemInfo({ |
| this.key, |
| this.synonyms, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageSelectItemInfo.fromJson(core.Map _json) |
| : this( |
| key: _json.containsKey('key') ? _json['key'] as core.String : null, |
| synonyms: _json.containsKey('synonyms') |
| ? (_json['synonyms'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (key != null) 'key': key!, |
| if (synonyms != null) 'synonyms': synonyms!, |
| }; |
| } |
| |
| /// The simple response message containing speech or text. |
| class GoogleCloudDialogflowV2IntentMessageSimpleResponse { |
| /// The text to display. |
| /// |
| /// Optional. |
| core.String? displayText; |
| |
| /// One of text_to_speech or ssml must be provided. |
| /// |
| /// Structured spoken response to the user in the SSML format. Mutually |
| /// exclusive with text_to_speech. |
| core.String? ssml; |
| |
| /// One of text_to_speech or ssml must be provided. |
| /// |
| /// The plain text of the speech output. Mutually exclusive with ssml. |
| core.String? textToSpeech; |
| |
| GoogleCloudDialogflowV2IntentMessageSimpleResponse({ |
| this.displayText, |
| this.ssml, |
| this.textToSpeech, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageSimpleResponse.fromJson(core.Map _json) |
| : this( |
| displayText: _json.containsKey('displayText') |
| ? _json['displayText'] as core.String |
| : null, |
| ssml: _json.containsKey('ssml') ? _json['ssml'] as core.String : null, |
| textToSpeech: _json.containsKey('textToSpeech') |
| ? _json['textToSpeech'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (displayText != null) 'displayText': displayText!, |
| if (ssml != null) 'ssml': ssml!, |
| if (textToSpeech != null) 'textToSpeech': textToSpeech!, |
| }; |
| } |
| |
| /// The collection of simple response candidates. |
| /// |
| /// This message in `QueryResult.fulfillment_messages` and |
| /// `WebhookResponse.fulfillment_messages` should contain only one |
| /// `SimpleResponse`. |
| class GoogleCloudDialogflowV2IntentMessageSimpleResponses { |
| /// The list of simple responses. |
| /// |
| /// Required. |
| core.List<GoogleCloudDialogflowV2IntentMessageSimpleResponse>? |
| simpleResponses; |
| |
| GoogleCloudDialogflowV2IntentMessageSimpleResponses({ |
| this.simpleResponses, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageSimpleResponses.fromJson(core.Map _json) |
| : this( |
| simpleResponses: _json.containsKey('simpleResponses') |
| ? (_json['simpleResponses'] as core.List) |
| .map<GoogleCloudDialogflowV2IntentMessageSimpleResponse>( |
| (value) => |
| GoogleCloudDialogflowV2IntentMessageSimpleResponse |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (simpleResponses != null) |
| 'simpleResponses': |
| simpleResponses!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// The suggestion chip message that the user can tap to quickly post a reply to |
| /// the conversation. |
| class GoogleCloudDialogflowV2IntentMessageSuggestion { |
| /// The text shown the in the suggestion chip. |
| /// |
| /// Required. |
| core.String? title; |
| |
| GoogleCloudDialogflowV2IntentMessageSuggestion({ |
| this.title, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageSuggestion.fromJson(core.Map _json) |
| : this( |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (title != null) 'title': title!, |
| }; |
| } |
| |
| /// The collection of suggestions. |
| class GoogleCloudDialogflowV2IntentMessageSuggestions { |
| /// The list of suggested replies. |
| /// |
| /// Required. |
| core.List<GoogleCloudDialogflowV2IntentMessageSuggestion>? suggestions; |
| |
| GoogleCloudDialogflowV2IntentMessageSuggestions({ |
| this.suggestions, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageSuggestions.fromJson(core.Map _json) |
| : this( |
| suggestions: _json.containsKey('suggestions') |
| ? (_json['suggestions'] as core.List) |
| .map<GoogleCloudDialogflowV2IntentMessageSuggestion>( |
| (value) => GoogleCloudDialogflowV2IntentMessageSuggestion |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (suggestions != null) |
| 'suggestions': suggestions!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Table card for Actions on Google. |
| class GoogleCloudDialogflowV2IntentMessageTableCard { |
| /// List of buttons for the card. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2IntentMessageBasicCardButton>? buttons; |
| |
| /// Display properties for the columns in this table. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2IntentMessageColumnProperties>? |
| columnProperties; |
| |
| /// Image which should be displayed on the card. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2IntentMessageImage? image; |
| |
| /// Rows in this table of data. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2IntentMessageTableCardRow>? rows; |
| |
| /// Subtitle to the title. |
| /// |
| /// Optional. |
| core.String? subtitle; |
| |
| /// Title of the card. |
| /// |
| /// Required. |
| core.String? title; |
| |
| GoogleCloudDialogflowV2IntentMessageTableCard({ |
| this.buttons, |
| this.columnProperties, |
| this.image, |
| this.rows, |
| this.subtitle, |
| this.title, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageTableCard.fromJson(core.Map _json) |
| : this( |
| buttons: _json.containsKey('buttons') |
| ? (_json['buttons'] as core.List) |
| .map<GoogleCloudDialogflowV2IntentMessageBasicCardButton>( |
| (value) => |
| GoogleCloudDialogflowV2IntentMessageBasicCardButton |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| columnProperties: _json.containsKey('columnProperties') |
| ? (_json['columnProperties'] as core.List) |
| .map<GoogleCloudDialogflowV2IntentMessageColumnProperties>( |
| (value) => |
| GoogleCloudDialogflowV2IntentMessageColumnProperties |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| image: _json.containsKey('image') |
| ? GoogleCloudDialogflowV2IntentMessageImage.fromJson( |
| _json['image'] as core.Map<core.String, core.dynamic>) |
| : null, |
| rows: _json.containsKey('rows') |
| ? (_json['rows'] as core.List) |
| .map<GoogleCloudDialogflowV2IntentMessageTableCardRow>( |
| (value) => |
| GoogleCloudDialogflowV2IntentMessageTableCardRow |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| subtitle: _json.containsKey('subtitle') |
| ? _json['subtitle'] as core.String |
| : null, |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (buttons != null) |
| 'buttons': buttons!.map((value) => value.toJson()).toList(), |
| if (columnProperties != null) |
| 'columnProperties': |
| columnProperties!.map((value) => value.toJson()).toList(), |
| if (image != null) 'image': image!.toJson(), |
| if (rows != null) 'rows': rows!.map((value) => value.toJson()).toList(), |
| if (subtitle != null) 'subtitle': subtitle!, |
| if (title != null) 'title': title!, |
| }; |
| } |
| |
| /// Cell of TableCardRow. |
| class GoogleCloudDialogflowV2IntentMessageTableCardCell { |
| /// Text in this cell. |
| /// |
| /// Required. |
| core.String? text; |
| |
| GoogleCloudDialogflowV2IntentMessageTableCardCell({ |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageTableCardCell.fromJson(core.Map _json) |
| : this( |
| text: _json.containsKey('text') ? _json['text'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (text != null) 'text': text!, |
| }; |
| } |
| |
| /// Row of TableCard. |
| class GoogleCloudDialogflowV2IntentMessageTableCardRow { |
| /// List of cells that make up this row. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2IntentMessageTableCardCell>? cells; |
| |
| /// Whether to add a visual divider after this row. |
| /// |
| /// Optional. |
| core.bool? dividerAfter; |
| |
| GoogleCloudDialogflowV2IntentMessageTableCardRow({ |
| this.cells, |
| this.dividerAfter, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageTableCardRow.fromJson(core.Map _json) |
| : this( |
| cells: _json.containsKey('cells') |
| ? (_json['cells'] as core.List) |
| .map<GoogleCloudDialogflowV2IntentMessageTableCardCell>( |
| (value) => |
| GoogleCloudDialogflowV2IntentMessageTableCardCell |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| dividerAfter: _json.containsKey('dividerAfter') |
| ? _json['dividerAfter'] as core.bool |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (cells != null) |
| 'cells': cells!.map((value) => value.toJson()).toList(), |
| if (dividerAfter != null) 'dividerAfter': dividerAfter!, |
| }; |
| } |
| |
| /// The text response message. |
| class GoogleCloudDialogflowV2IntentMessageText { |
| /// The collection of the agent's responses. |
| /// |
| /// Optional. |
| core.List<core.String>? text; |
| |
| GoogleCloudDialogflowV2IntentMessageText({ |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowV2IntentMessageText.fromJson(core.Map _json) |
| : this( |
| text: _json.containsKey('text') |
| ? (_json['text'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (text != null) 'text': text!, |
| }; |
| } |
| |
| /// Represents intent parameters. |
| class GoogleCloudDialogflowV2IntentParameter { |
| /// The default value to use when the `value` yields an empty result. |
| /// |
| /// Default values can be extracted from contexts by using the following |
| /// syntax: `#context_name.parameter_name`. |
| /// |
| /// Optional. |
| core.String? defaultValue; |
| |
| /// The name of the parameter. |
| /// |
| /// Required. |
| core.String? displayName; |
| |
| /// The name of the entity type, prefixed with `@`, that describes values of |
| /// the parameter. |
| /// |
| /// If the parameter is required, this must be provided. |
| /// |
| /// Optional. |
| core.String? entityTypeDisplayName; |
| |
| /// Indicates whether the parameter represents a list of values. |
| /// |
| /// Optional. |
| core.bool? isList; |
| |
| /// Indicates whether the parameter is required. |
| /// |
| /// That is, whether the intent cannot be completed without collecting the |
| /// parameter value. |
| /// |
| /// Optional. |
| core.bool? mandatory; |
| |
| /// The unique identifier of this parameter. |
| core.String? name; |
| |
| /// The collection of prompts that the agent can present to the user in order |
| /// to collect a value for the parameter. |
| /// |
| /// Optional. |
| core.List<core.String>? prompts; |
| |
| /// The definition of the parameter value. |
| /// |
| /// It can be: - a constant string, - a parameter value defined as |
| /// `$parameter_name`, - an original parameter value defined as |
| /// `$parameter_name.original`, - a parameter value from some context defined |
| /// as `#context_name.parameter_name`. |
| /// |
| /// Optional. |
| core.String? value; |
| |
| GoogleCloudDialogflowV2IntentParameter({ |
| this.defaultValue, |
| this.displayName, |
| this.entityTypeDisplayName, |
| this.isList, |
| this.mandatory, |
| this.name, |
| this.prompts, |
| this.value, |
| }); |
| |
| GoogleCloudDialogflowV2IntentParameter.fromJson(core.Map _json) |
| : this( |
| defaultValue: _json.containsKey('defaultValue') |
| ? _json['defaultValue'] as core.String |
| : null, |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| entityTypeDisplayName: _json.containsKey('entityTypeDisplayName') |
| ? _json['entityTypeDisplayName'] as core.String |
| : null, |
| isList: |
| _json.containsKey('isList') ? _json['isList'] as core.bool : null, |
| mandatory: _json.containsKey('mandatory') |
| ? _json['mandatory'] as core.bool |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| prompts: _json.containsKey('prompts') |
| ? (_json['prompts'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| value: |
| _json.containsKey('value') ? _json['value'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (defaultValue != null) 'defaultValue': defaultValue!, |
| if (displayName != null) 'displayName': displayName!, |
| if (entityTypeDisplayName != null) |
| 'entityTypeDisplayName': entityTypeDisplayName!, |
| if (isList != null) 'isList': isList!, |
| if (mandatory != null) 'mandatory': mandatory!, |
| if (name != null) 'name': name!, |
| if (prompts != null) 'prompts': prompts!, |
| if (value != null) 'value': value!, |
| }; |
| } |
| |
| /// Represents an example that the agent is trained on. |
| class GoogleCloudDialogflowV2IntentTrainingPhrase { |
| /// The unique identifier of this training phrase. |
| /// |
| /// Output only. |
| core.String? name; |
| |
| /// The ordered list of training phrase parts. |
| /// |
| /// The parts are concatenated in order to form the training phrase. Note: The |
| /// API does not automatically annotate training phrases like the Dialogflow |
| /// Console does. Note: Do not forget to include whitespace at part |
| /// boundaries, so the training phrase is well formatted when the parts are |
| /// concatenated. If the training phrase does not need to be annotated with |
| /// parameters, you just need a single part with only the Part.text field set. |
| /// If you want to annotate the training phrase, you must create multiple |
| /// parts, where the fields of each part are populated in one of two ways: - |
| /// `Part.text` is set to a part of the phrase that has no parameters. - |
| /// `Part.text` is set to a part of the phrase that you want to annotate, and |
| /// the `entity_type`, `alias`, and `user_defined` fields are all set. |
| /// |
| /// Required. |
| core.List<GoogleCloudDialogflowV2IntentTrainingPhrasePart>? parts; |
| |
| /// Indicates how many times this example was added to the intent. |
| /// |
| /// Each time a developer adds an existing sample by editing an intent or |
| /// training, this counter is increased. |
| /// |
| /// Optional. |
| core.int? timesAddedCount; |
| |
| /// The type of the training phrase. |
| /// |
| /// Required. |
| /// Possible string values are: |
| /// - "TYPE_UNSPECIFIED" : Not specified. This value should never be used. |
| /// - "EXAMPLE" : Examples do not contain @-prefixed entity type names, but |
| /// example parts can be annotated with entity types. |
| /// - "TEMPLATE" : Templates are not annotated with entity types, but they can |
| /// contain @-prefixed entity type names as substrings. Template mode has been |
| /// deprecated. Example mode is the only supported way to create new training |
| /// phrases. If you have existing training phrases that you've created in |
| /// template mode, those will continue to work. |
| core.String? type; |
| |
| GoogleCloudDialogflowV2IntentTrainingPhrase({ |
| this.name, |
| this.parts, |
| this.timesAddedCount, |
| this.type, |
| }); |
| |
| GoogleCloudDialogflowV2IntentTrainingPhrase.fromJson(core.Map _json) |
| : this( |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| parts: _json.containsKey('parts') |
| ? (_json['parts'] as core.List) |
| .map<GoogleCloudDialogflowV2IntentTrainingPhrasePart>( |
| (value) => GoogleCloudDialogflowV2IntentTrainingPhrasePart |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| timesAddedCount: _json.containsKey('timesAddedCount') |
| ? _json['timesAddedCount'] as core.int |
| : null, |
| type: _json.containsKey('type') ? _json['type'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (name != null) 'name': name!, |
| if (parts != null) |
| 'parts': parts!.map((value) => value.toJson()).toList(), |
| if (timesAddedCount != null) 'timesAddedCount': timesAddedCount!, |
| if (type != null) 'type': type!, |
| }; |
| } |
| |
| /// Represents a part of a training phrase. |
| class GoogleCloudDialogflowV2IntentTrainingPhrasePart { |
| /// The parameter name for the value extracted from the annotated part of the |
| /// example. |
| /// |
| /// This field is required for annotated parts of the training phrase. |
| /// |
| /// Optional. |
| core.String? alias; |
| |
| /// The entity type name prefixed with `@`. |
| /// |
| /// This field is required for annotated parts of the training phrase. |
| /// |
| /// Optional. |
| core.String? entityType; |
| |
| /// The text for this part. |
| /// |
| /// Required. |
| core.String? text; |
| |
| /// Indicates whether the text was manually annotated. |
| /// |
| /// This field is set to true when the Dialogflow Console is used to manually |
| /// annotate the part. When creating an annotated part with the API, you must |
| /// set this to true. |
| /// |
| /// Optional. |
| core.bool? userDefined; |
| |
| GoogleCloudDialogflowV2IntentTrainingPhrasePart({ |
| this.alias, |
| this.entityType, |
| this.text, |
| this.userDefined, |
| }); |
| |
| GoogleCloudDialogflowV2IntentTrainingPhrasePart.fromJson(core.Map _json) |
| : this( |
| alias: |
| _json.containsKey('alias') ? _json['alias'] as core.String : null, |
| entityType: _json.containsKey('entityType') |
| ? _json['entityType'] as core.String |
| : null, |
| text: _json.containsKey('text') ? _json['text'] as core.String : null, |
| userDefined: _json.containsKey('userDefined') |
| ? _json['userDefined'] as core.bool |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (alias != null) 'alias': alias!, |
| if (entityType != null) 'entityType': entityType!, |
| if (text != null) 'text': text!, |
| if (userDefined != null) 'userDefined': userDefined!, |
| }; |
| } |
| |
| /// A knowledge base represents a collection of knowledge documents that you |
| /// provide to Dialogflow. |
| /// |
| /// Your knowledge documents contain information that may be useful during |
| /// conversations with end-users. Some Dialogflow features use knowledge bases |
| /// when looking for a response to an end-user input. For more information, see |
| /// the |
| /// [knowledge base guide](https://cloud.google.com/dialogflow/docs/how/knowledge-bases). |
| /// Note: The `projects.agent.knowledgeBases` resource is deprecated; only use |
| /// `projects.knowledgeBases`. |
| class GoogleCloudDialogflowV2KnowledgeBase { |
| /// The display name of the knowledge base. |
| /// |
| /// The name must be 1024 bytes or less; otherwise, the creation request |
| /// fails. |
| /// |
| /// Required. |
| core.String? displayName; |
| |
| /// Language which represents the KnowledgeBase. |
| /// |
| /// When the KnowledgeBase is created/updated, expect this to be present for |
| /// non en-us languages. When unspecified, the default language code en-us |
| /// applies. |
| core.String? languageCode; |
| |
| /// The knowledge base resource name. |
| /// |
| /// The name must be empty when creating a knowledge base. Format: |
| /// `projects//locations//knowledgeBases/`. |
| core.String? name; |
| |
| GoogleCloudDialogflowV2KnowledgeBase({ |
| this.displayName, |
| this.languageCode, |
| this.name, |
| }); |
| |
| GoogleCloudDialogflowV2KnowledgeBase.fromJson(core.Map _json) |
| : this( |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| languageCode: _json.containsKey('languageCode') |
| ? _json['languageCode'] as core.String |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (displayName != null) 'displayName': displayName!, |
| if (languageCode != null) 'languageCode': languageCode!, |
| if (name != null) 'name': name!, |
| }; |
| } |
| |
| /// Metadata in google::longrunning::Operation for Knowledge operations. |
| class GoogleCloudDialogflowV2KnowledgeOperationMetadata { |
| /// The current state of this operation. |
| /// |
| /// Output only. |
| /// Possible string values are: |
| /// - "STATE_UNSPECIFIED" : State unspecified. |
| /// - "PENDING" : The operation has been created. |
| /// - "RUNNING" : The operation is currently running. |
| /// - "DONE" : The operation is done, either cancelled or completed. |
| core.String? state; |
| |
| GoogleCloudDialogflowV2KnowledgeOperationMetadata({ |
| this.state, |
| }); |
| |
| GoogleCloudDialogflowV2KnowledgeOperationMetadata.fromJson(core.Map _json) |
| : this( |
| state: |
| _json.containsKey('state') ? _json['state'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (state != null) 'state': state!, |
| }; |
| } |
| |
| /// Response message for AnswerRecords.ListAnswerRecords. |
| class GoogleCloudDialogflowV2ListAnswerRecordsResponse { |
| /// The list of answer records. |
| core.List<GoogleCloudDialogflowV2AnswerRecord>? answerRecords; |
| |
| /// A token to retrieve next page of results. |
| /// |
| /// Or empty if there are no more results. Pass this value in the |
| /// ListAnswerRecordsRequest.page_token field in the subsequent call to |
| /// `ListAnswerRecords` method to retrieve the next page of results. |
| core.String? nextPageToken; |
| |
| GoogleCloudDialogflowV2ListAnswerRecordsResponse({ |
| this.answerRecords, |
| this.nextPageToken, |
| }); |
| |
| GoogleCloudDialogflowV2ListAnswerRecordsResponse.fromJson(core.Map _json) |
| : this( |
| answerRecords: _json.containsKey('answerRecords') |
| ? (_json['answerRecords'] as core.List) |
| .map<GoogleCloudDialogflowV2AnswerRecord>((value) => |
| GoogleCloudDialogflowV2AnswerRecord.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| nextPageToken: _json.containsKey('nextPageToken') |
| ? _json['nextPageToken'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (answerRecords != null) |
| 'answerRecords': |
| answerRecords!.map((value) => value.toJson()).toList(), |
| if (nextPageToken != null) 'nextPageToken': nextPageToken!, |
| }; |
| } |
| |
| /// The response message for Contexts.ListContexts. |
| class GoogleCloudDialogflowV2ListContextsResponse { |
| /// The list of contexts. |
| /// |
| /// There will be a maximum number of items returned based on the page_size |
| /// field in the request. |
| core.List<GoogleCloudDialogflowV2Context>? contexts; |
| |
| /// Token to retrieve the next page of results, or empty if there are no more |
| /// results in the list. |
| core.String? nextPageToken; |
| |
| GoogleCloudDialogflowV2ListContextsResponse({ |
| this.contexts, |
| this.nextPageToken, |
| }); |
| |
| GoogleCloudDialogflowV2ListContextsResponse.fromJson(core.Map _json) |
| : this( |
| contexts: _json.containsKey('contexts') |
| ? (_json['contexts'] as core.List) |
| .map<GoogleCloudDialogflowV2Context>((value) => |
| GoogleCloudDialogflowV2Context.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| nextPageToken: _json.containsKey('nextPageToken') |
| ? _json['nextPageToken'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (contexts != null) |
| 'contexts': contexts!.map((value) => value.toJson()).toList(), |
| if (nextPageToken != null) 'nextPageToken': nextPageToken!, |
| }; |
| } |
| |
| /// The response message for ConversationProfiles.ListConversationProfiles. |
| class GoogleCloudDialogflowV2ListConversationProfilesResponse { |
| /// The list of project conversation profiles. |
| /// |
| /// There is a maximum number of items returned based on the page_size field |
| /// in the request. |
| core.List<GoogleCloudDialogflowV2ConversationProfile>? conversationProfiles; |
| |
| /// Token to retrieve the next page of results, or empty if there are no more |
| /// results in the list. |
| core.String? nextPageToken; |
| |
| GoogleCloudDialogflowV2ListConversationProfilesResponse({ |
| this.conversationProfiles, |
| this.nextPageToken, |
| }); |
| |
| GoogleCloudDialogflowV2ListConversationProfilesResponse.fromJson( |
| core.Map _json) |
| : this( |
| conversationProfiles: _json.containsKey('conversationProfiles') |
| ? (_json['conversationProfiles'] as core.List) |
| .map<GoogleCloudDialogflowV2ConversationProfile>((value) => |
| GoogleCloudDialogflowV2ConversationProfile.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| nextPageToken: _json.containsKey('nextPageToken') |
| ? _json['nextPageToken'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (conversationProfiles != null) |
| 'conversationProfiles': |
| conversationProfiles!.map((value) => value.toJson()).toList(), |
| if (nextPageToken != null) 'nextPageToken': nextPageToken!, |
| }; |
| } |
| |
| /// The response message for Conversations.ListConversations. |
| class GoogleCloudDialogflowV2ListConversationsResponse { |
| /// The list of conversations. |
| /// |
| /// There will be a maximum number of items returned based on the page_size |
| /// field in the request. |
| core.List<GoogleCloudDialogflowV2Conversation>? conversations; |
| |
| /// Token to retrieve the next page of results, or empty if there are no more |
| /// results in the list. |
| core.String? nextPageToken; |
| |
| GoogleCloudDialogflowV2ListConversationsResponse({ |
| this.conversations, |
| this.nextPageToken, |
| }); |
| |
| GoogleCloudDialogflowV2ListConversationsResponse.fromJson(core.Map _json) |
| : this( |
| conversations: _json.containsKey('conversations') |
| ? (_json['conversations'] as core.List) |
| .map<GoogleCloudDialogflowV2Conversation>((value) => |
| GoogleCloudDialogflowV2Conversation.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| nextPageToken: _json.containsKey('nextPageToken') |
| ? _json['nextPageToken'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (conversations != null) |
| 'conversations': |
| conversations!.map((value) => value.toJson()).toList(), |
| if (nextPageToken != null) 'nextPageToken': nextPageToken!, |
| }; |
| } |
| |
| /// Response message for Documents.ListDocuments. |
| class GoogleCloudDialogflowV2ListDocumentsResponse { |
| /// The list of documents. |
| core.List<GoogleCloudDialogflowV2Document>? documents; |
| |
| /// Token to retrieve the next page of results, or empty if there are no more |
| /// results in the list. |
| core.String? nextPageToken; |
| |
| GoogleCloudDialogflowV2ListDocumentsResponse({ |
| this.documents, |
| this.nextPageToken, |
| }); |
| |
| GoogleCloudDialogflowV2ListDocumentsResponse.fromJson(core.Map _json) |
| : this( |
| documents: _json.containsKey('documents') |
| ? (_json['documents'] as core.List) |
| .map<GoogleCloudDialogflowV2Document>((value) => |
| GoogleCloudDialogflowV2Document.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| nextPageToken: _json.containsKey('nextPageToken') |
| ? _json['nextPageToken'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (documents != null) |
| 'documents': documents!.map((value) => value.toJson()).toList(), |
| if (nextPageToken != null) 'nextPageToken': nextPageToken!, |
| }; |
| } |
| |
| /// The response message for EntityTypes.ListEntityTypes. |
| class GoogleCloudDialogflowV2ListEntityTypesResponse { |
| /// The list of agent entity types. |
| /// |
| /// There will be a maximum number of items returned based on the page_size |
| /// field in the request. |
| core.List<GoogleCloudDialogflowV2EntityType>? entityTypes; |
| |
| /// Token to retrieve the next page of results, or empty if there are no more |
| /// results in the list. |
| core.String? nextPageToken; |
| |
| GoogleCloudDialogflowV2ListEntityTypesResponse({ |
| this.entityTypes, |
| this.nextPageToken, |
| }); |
| |
| GoogleCloudDialogflowV2ListEntityTypesResponse.fromJson(core.Map _json) |
| : this( |
| entityTypes: _json.containsKey('entityTypes') |
| ? (_json['entityTypes'] as core.List) |
| .map<GoogleCloudDialogflowV2EntityType>((value) => |
| GoogleCloudDialogflowV2EntityType.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| nextPageToken: _json.containsKey('nextPageToken') |
| ? _json['nextPageToken'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (entityTypes != null) |
| 'entityTypes': entityTypes!.map((value) => value.toJson()).toList(), |
| if (nextPageToken != null) 'nextPageToken': nextPageToken!, |
| }; |
| } |
| |
| /// The response message for Environments.ListEnvironments. |
| class GoogleCloudDialogflowV2ListEnvironmentsResponse { |
| /// The list of agent environments. |
| /// |
| /// There will be a maximum number of items returned based on the page_size |
| /// field in the request. |
| core.List<GoogleCloudDialogflowV2Environment>? environments; |
| |
| /// Token to retrieve the next page of results, or empty if there are no more |
| /// results in the list. |
| core.String? nextPageToken; |
| |
| GoogleCloudDialogflowV2ListEnvironmentsResponse({ |
| this.environments, |
| this.nextPageToken, |
| }); |
| |
| GoogleCloudDialogflowV2ListEnvironmentsResponse.fromJson(core.Map _json) |
| : this( |
| environments: _json.containsKey('environments') |
| ? (_json['environments'] as core.List) |
| .map<GoogleCloudDialogflowV2Environment>((value) => |
| GoogleCloudDialogflowV2Environment.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| nextPageToken: _json.containsKey('nextPageToken') |
| ? _json['nextPageToken'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (environments != null) |
| 'environments': environments!.map((value) => value.toJson()).toList(), |
| if (nextPageToken != null) 'nextPageToken': nextPageToken!, |
| }; |
| } |
| |
| /// The response message for Intents.ListIntents. |
| class GoogleCloudDialogflowV2ListIntentsResponse { |
| /// The list of agent intents. |
| /// |
| /// There will be a maximum number of items returned based on the page_size |
| /// field in the request. |
| core.List<GoogleCloudDialogflowV2Intent>? intents; |
| |
| /// Token to retrieve the next page of results, or empty if there are no more |
| /// results in the list. |
| core.String? nextPageToken; |
| |
| GoogleCloudDialogflowV2ListIntentsResponse({ |
| this.intents, |
| this.nextPageToken, |
| }); |
| |
| GoogleCloudDialogflowV2ListIntentsResponse.fromJson(core.Map _json) |
| : this( |
| intents: _json.containsKey('intents') |
| ? (_json['intents'] as core.List) |
| .map<GoogleCloudDialogflowV2Intent>((value) => |
| GoogleCloudDialogflowV2Intent.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| nextPageToken: _json.containsKey('nextPageToken') |
| ? _json['nextPageToken'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (intents != null) |
| 'intents': intents!.map((value) => value.toJson()).toList(), |
| if (nextPageToken != null) 'nextPageToken': nextPageToken!, |
| }; |
| } |
| |
| /// Response message for KnowledgeBases.ListKnowledgeBases. |
| class GoogleCloudDialogflowV2ListKnowledgeBasesResponse { |
| /// The list of knowledge bases. |
| core.List<GoogleCloudDialogflowV2KnowledgeBase>? knowledgeBases; |
| |
| /// Token to retrieve the next page of results, or empty if there are no more |
| /// results in the list. |
| core.String? nextPageToken; |
| |
| GoogleCloudDialogflowV2ListKnowledgeBasesResponse({ |
| this.knowledgeBases, |
| this.nextPageToken, |
| }); |
| |
| GoogleCloudDialogflowV2ListKnowledgeBasesResponse.fromJson(core.Map _json) |
| : this( |
| knowledgeBases: _json.containsKey('knowledgeBases') |
| ? (_json['knowledgeBases'] as core.List) |
| .map<GoogleCloudDialogflowV2KnowledgeBase>((value) => |
| GoogleCloudDialogflowV2KnowledgeBase.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| nextPageToken: _json.containsKey('nextPageToken') |
| ? _json['nextPageToken'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (knowledgeBases != null) |
| 'knowledgeBases': |
| knowledgeBases!.map((value) => value.toJson()).toList(), |
| if (nextPageToken != null) 'nextPageToken': nextPageToken!, |
| }; |
| } |
| |
| /// The response message for Conversations.ListMessages. |
| class GoogleCloudDialogflowV2ListMessagesResponse { |
| /// The list of messages. |
| /// |
| /// There will be a maximum number of items returned based on the page_size |
| /// field in the request. `messages` is sorted by `create_time` in descending |
| /// order. |
| core.List<GoogleCloudDialogflowV2Message>? messages; |
| |
| /// Token to retrieve the next page of results, or empty if there are no more |
| /// results in the list. |
| core.String? nextPageToken; |
| |
| GoogleCloudDialogflowV2ListMessagesResponse({ |
| this.messages, |
| this.nextPageToken, |
| }); |
| |
| GoogleCloudDialogflowV2ListMessagesResponse.fromJson(core.Map _json) |
| : this( |
| messages: _json.containsKey('messages') |
| ? (_json['messages'] as core.List) |
| .map<GoogleCloudDialogflowV2Message>((value) => |
| GoogleCloudDialogflowV2Message.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| nextPageToken: _json.containsKey('nextPageToken') |
| ? _json['nextPageToken'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (messages != null) |
| 'messages': messages!.map((value) => value.toJson()).toList(), |
| if (nextPageToken != null) 'nextPageToken': nextPageToken!, |
| }; |
| } |
| |
| /// The response message for Participants.ListParticipants. |
| class GoogleCloudDialogflowV2ListParticipantsResponse { |
| /// Token to retrieve the next page of results or empty if there are no more |
| /// results in the list. |
| core.String? nextPageToken; |
| |
| /// The list of participants. |
| /// |
| /// There is a maximum number of items returned based on the page_size field |
| /// in the request. |
| core.List<GoogleCloudDialogflowV2Participant>? participants; |
| |
| GoogleCloudDialogflowV2ListParticipantsResponse({ |
| this.nextPageToken, |
| this.participants, |
| }); |
| |
| GoogleCloudDialogflowV2ListParticipantsResponse.fromJson(core.Map _json) |
| : this( |
| nextPageToken: _json.containsKey('nextPageToken') |
| ? _json['nextPageToken'] as core.String |
| : null, |
| participants: _json.containsKey('participants') |
| ? (_json['participants'] as core.List) |
| .map<GoogleCloudDialogflowV2Participant>((value) => |
| GoogleCloudDialogflowV2Participant.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (nextPageToken != null) 'nextPageToken': nextPageToken!, |
| if (participants != null) |
| 'participants': participants!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// The response message for SessionEntityTypes.ListSessionEntityTypes. |
| class GoogleCloudDialogflowV2ListSessionEntityTypesResponse { |
| /// Token to retrieve the next page of results, or empty if there are no more |
| /// results in the list. |
| core.String? nextPageToken; |
| |
| /// The list of session entity types. |
| /// |
| /// There will be a maximum number of items returned based on the page_size |
| /// field in the request. |
| core.List<GoogleCloudDialogflowV2SessionEntityType>? sessionEntityTypes; |
| |
| GoogleCloudDialogflowV2ListSessionEntityTypesResponse({ |
| this.nextPageToken, |
| this.sessionEntityTypes, |
| }); |
| |
| GoogleCloudDialogflowV2ListSessionEntityTypesResponse.fromJson(core.Map _json) |
| : this( |
| nextPageToken: _json.containsKey('nextPageToken') |
| ? _json['nextPageToken'] as core.String |
| : null, |
| sessionEntityTypes: _json.containsKey('sessionEntityTypes') |
| ? (_json['sessionEntityTypes'] as core.List) |
| .map<GoogleCloudDialogflowV2SessionEntityType>((value) => |
| GoogleCloudDialogflowV2SessionEntityType.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (nextPageToken != null) 'nextPageToken': nextPageToken!, |
| if (sessionEntityTypes != null) |
| 'sessionEntityTypes': |
| sessionEntityTypes!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// The response message for Versions.ListVersions. |
| class GoogleCloudDialogflowV2ListVersionsResponse { |
| /// Token to retrieve the next page of results, or empty if there are no more |
| /// results in the list. |
| core.String? nextPageToken; |
| |
| /// The list of agent versions. |
| /// |
| /// There will be a maximum number of items returned based on the page_size |
| /// field in the request. |
| core.List<GoogleCloudDialogflowV2Version>? versions; |
| |
| GoogleCloudDialogflowV2ListVersionsResponse({ |
| this.nextPageToken, |
| this.versions, |
| }); |
| |
| GoogleCloudDialogflowV2ListVersionsResponse.fromJson(core.Map _json) |
| : this( |
| nextPageToken: _json.containsKey('nextPageToken') |
| ? _json['nextPageToken'] as core.String |
| : null, |
| versions: _json.containsKey('versions') |
| ? (_json['versions'] as core.List) |
| .map<GoogleCloudDialogflowV2Version>((value) => |
| GoogleCloudDialogflowV2Version.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (nextPageToken != null) 'nextPageToken': nextPageToken!, |
| if (versions != null) |
| 'versions': versions!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Defines logging behavior for conversation lifecycle events. |
| class GoogleCloudDialogflowV2LoggingConfig { |
| /// Whether to log conversation events like CONVERSATION_STARTED to |
| /// Stackdriver in the conversation project as JSON format ConversationEvent |
| /// protos. |
| core.bool? enableStackdriverLogging; |
| |
| GoogleCloudDialogflowV2LoggingConfig({ |
| this.enableStackdriverLogging, |
| }); |
| |
| GoogleCloudDialogflowV2LoggingConfig.fromJson(core.Map _json) |
| : this( |
| enableStackdriverLogging: |
| _json.containsKey('enableStackdriverLogging') |
| ? _json['enableStackdriverLogging'] as core.bool |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (enableStackdriverLogging != null) |
| 'enableStackdriverLogging': enableStackdriverLogging!, |
| }; |
| } |
| |
| /// Represents a message posted into a conversation. |
| class GoogleCloudDialogflowV2Message { |
| /// The message content. |
| /// |
| /// Required. |
| core.String? content; |
| |
| /// The time when the message was created. |
| /// |
| /// Output only. |
| core.String? createTime; |
| |
| /// The message language. |
| /// |
| /// This should be a \[BCP-47\](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) |
| /// language tag. Example: "en-US". |
| /// |
| /// Optional. |
| core.String? languageCode; |
| |
| /// The annotation for the message. |
| /// |
| /// Output only. |
| GoogleCloudDialogflowV2MessageAnnotation? messageAnnotation; |
| |
| /// The unique identifier of the message. |
| /// |
| /// Format: `projects//locations//conversations//messages/`. |
| core.String? name; |
| |
| /// The participant that sends this message. |
| /// |
| /// Output only. |
| core.String? participant; |
| |
| /// The role of the participant. |
| /// |
| /// Output only. |
| /// Possible string values are: |
| /// - "ROLE_UNSPECIFIED" : Participant role not set. |
| /// - "HUMAN_AGENT" : Participant is a human agent. |
| /// - "AUTOMATED_AGENT" : Participant is an automated agent, such as a |
| /// Dialogflow agent. |
| /// - "END_USER" : Participant is an end user that has called or chatted with |
| /// Dialogflow services. |
| core.String? participantRole; |
| |
| GoogleCloudDialogflowV2Message({ |
| this.content, |
| this.createTime, |
| this.languageCode, |
| this.messageAnnotation, |
| this.name, |
| this.participant, |
| this.participantRole, |
| }); |
| |
| GoogleCloudDialogflowV2Message.fromJson(core.Map _json) |
| : this( |
| content: _json.containsKey('content') |
| ? _json['content'] as core.String |
| : null, |
| createTime: _json.containsKey('createTime') |
| ? _json['createTime'] as core.String |
| : null, |
| languageCode: _json.containsKey('languageCode') |
| ? _json['languageCode'] as core.String |
| : null, |
| messageAnnotation: _json.containsKey('messageAnnotation') |
| ? GoogleCloudDialogflowV2MessageAnnotation.fromJson( |
| _json['messageAnnotation'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| participant: _json.containsKey('participant') |
| ? _json['participant'] as core.String |
| : null, |
| participantRole: _json.containsKey('participantRole') |
| ? _json['participantRole'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (content != null) 'content': content!, |
| if (createTime != null) 'createTime': createTime!, |
| if (languageCode != null) 'languageCode': languageCode!, |
| if (messageAnnotation != null) |
| 'messageAnnotation': messageAnnotation!.toJson(), |
| if (name != null) 'name': name!, |
| if (participant != null) 'participant': participant!, |
| if (participantRole != null) 'participantRole': participantRole!, |
| }; |
| } |
| |
| /// Represents the result of annotation for the message. |
| class GoogleCloudDialogflowV2MessageAnnotation { |
| /// Indicates whether the text message contains entities. |
| core.bool? containEntities; |
| |
| /// The collection of annotated message parts ordered by their position in the |
| /// message. |
| /// |
| /// You can recover the annotated message by concatenating |
| /// \[AnnotatedMessagePart.text\]. |
| core.List<GoogleCloudDialogflowV2AnnotatedMessagePart>? parts; |
| |
| GoogleCloudDialogflowV2MessageAnnotation({ |
| this.containEntities, |
| this.parts, |
| }); |
| |
| GoogleCloudDialogflowV2MessageAnnotation.fromJson(core.Map _json) |
| : this( |
| containEntities: _json.containsKey('containEntities') |
| ? _json['containEntities'] as core.bool |
| : null, |
| parts: _json.containsKey('parts') |
| ? (_json['parts'] as core.List) |
| .map<GoogleCloudDialogflowV2AnnotatedMessagePart>((value) => |
| GoogleCloudDialogflowV2AnnotatedMessagePart.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (containEntities != null) 'containEntities': containEntities!, |
| if (parts != null) |
| 'parts': parts!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Defines notification behavior. |
| class GoogleCloudDialogflowV2NotificationConfig { |
| /// Format of message. |
| /// Possible string values are: |
| /// - "MESSAGE_FORMAT_UNSPECIFIED" : If it is unspeified, PROTO will be used. |
| /// - "PROTO" : Pubsub message will be serialized proto. |
| /// - "JSON" : Pubsub message will be json. |
| core.String? messageFormat; |
| |
| /// Name of the Pub/Sub topic to publish conversation events like |
| /// CONVERSATION_STARTED as serialized ConversationEvent protos. |
| /// |
| /// Notification works for phone calls, if this topic either is in the same |
| /// project as the conversation or you grant |
| /// `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow |
| /// Service Agent` role in the topic project. Format: |
| /// `projects//locations//topics/`. |
| core.String? topic; |
| |
| GoogleCloudDialogflowV2NotificationConfig({ |
| this.messageFormat, |
| this.topic, |
| }); |
| |
| GoogleCloudDialogflowV2NotificationConfig.fromJson(core.Map _json) |
| : this( |
| messageFormat: _json.containsKey('messageFormat') |
| ? _json['messageFormat'] as core.String |
| : null, |
| topic: |
| _json.containsKey('topic') ? _json['topic'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (messageFormat != null) 'messageFormat': messageFormat!, |
| if (topic != null) 'topic': topic!, |
| }; |
| } |
| |
| /// Represents the contents of the original request that was passed to the |
| /// `[Streaming]DetectIntent` call. |
| class GoogleCloudDialogflowV2OriginalDetectIntentRequest { |
| /// This field is set to the value of the `QueryParameters.payload` field |
| /// passed in the request. |
| /// |
| /// Some integrations that query a Dialogflow agent may provide additional |
| /// information in the payload. In particular, for the Dialogflow Phone |
| /// Gateway integration, this field has the form: { "telephony": { |
| /// "caller_id": "+18558363987" } } Note: The caller ID field (`caller_id`) |
| /// will be redacted for Trial Edition agents and populated with the caller ID |
| /// in [E.164 format](https://en.wikipedia.org/wiki/E.164) for Essentials |
| /// Edition agents. |
| /// |
| /// Optional. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? payload; |
| |
| /// The source of this request, e.g., `google`, `facebook`, `slack`. |
| /// |
| /// It is set by Dialogflow-owned servers. |
| core.String? source; |
| |
| /// The version of the protocol used for this request. |
| /// |
| /// This field is AoG-specific. |
| /// |
| /// Optional. |
| core.String? version; |
| |
| GoogleCloudDialogflowV2OriginalDetectIntentRequest({ |
| this.payload, |
| this.source, |
| this.version, |
| }); |
| |
| GoogleCloudDialogflowV2OriginalDetectIntentRequest.fromJson(core.Map _json) |
| : this( |
| payload: _json.containsKey('payload') |
| ? (_json['payload'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| source: _json.containsKey('source') |
| ? _json['source'] as core.String |
| : null, |
| version: _json.containsKey('version') |
| ? _json['version'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (payload != null) 'payload': payload!, |
| if (source != null) 'source': source!, |
| if (version != null) 'version': version!, |
| }; |
| } |
| |
| /// Represents the natural language speech audio to be played to the end user. |
| class GoogleCloudDialogflowV2OutputAudio { |
| /// The natural language speech audio. |
| core.String? audio; |
| core.List<core.int> get audioAsBytes => convert.base64.decode(audio!); |
| |
| set audioAsBytes(core.List<core.int> _bytes) { |
| audio = |
| convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); |
| } |
| |
| /// Instructs the speech synthesizer how to generate the speech audio. |
| GoogleCloudDialogflowV2OutputAudioConfig? config; |
| |
| GoogleCloudDialogflowV2OutputAudio({ |
| this.audio, |
| this.config, |
| }); |
| |
| GoogleCloudDialogflowV2OutputAudio.fromJson(core.Map _json) |
| : this( |
| audio: |
| _json.containsKey('audio') ? _json['audio'] as core.String : null, |
| config: _json.containsKey('config') |
| ? GoogleCloudDialogflowV2OutputAudioConfig.fromJson( |
| _json['config'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (audio != null) 'audio': audio!, |
| if (config != null) 'config': config!.toJson(), |
| }; |
| } |
| |
| /// Instructs the speech synthesizer on how to generate the output audio |
| /// content. |
| /// |
| /// If this audio config is supplied in a request, it overrides all existing |
| /// text-to-speech settings applied to the agent. |
| class GoogleCloudDialogflowV2OutputAudioConfig { |
| /// Audio encoding of the synthesized audio content. |
| /// |
| /// Required. |
| /// Possible string values are: |
| /// - "OUTPUT_AUDIO_ENCODING_UNSPECIFIED" : Not specified. |
| /// - "OUTPUT_AUDIO_ENCODING_LINEAR_16" : Uncompressed 16-bit signed |
| /// little-endian samples (Linear PCM). Audio content returned as LINEAR16 |
| /// also contains a WAV header. |
| /// - "OUTPUT_AUDIO_ENCODING_MP3" : MP3 audio at 32kbps. |
| /// - "OUTPUT_AUDIO_ENCODING_MP3_64_KBPS" : MP3 audio at 64kbps. |
| /// - "OUTPUT_AUDIO_ENCODING_OGG_OPUS" : Opus encoded audio wrapped in an ogg |
| /// container. The result will be a file which can be played natively on |
| /// Android, and in browsers (at least Chrome and Firefox). The quality of the |
| /// encoding is considerably higher than MP3 while using approximately the |
| /// same bitrate. |
| /// - "OUTPUT_AUDIO_ENCODING_MULAW" : 8-bit samples that compand 14-bit audio |
| /// samples using G.711 PCMU/mu-law. |
| core.String? audioEncoding; |
| |
| /// The synthesis sample rate (in hertz) for this audio. |
| /// |
| /// If not provided, then the synthesizer will use the default sample rate |
| /// based on the audio encoding. If this is different from the voice's natural |
| /// sample rate, then the synthesizer will honor this request by converting to |
| /// the desired sample rate (which might result in worse audio quality). |
| core.int? sampleRateHertz; |
| |
| /// Configuration of how speech should be synthesized. |
| GoogleCloudDialogflowV2SynthesizeSpeechConfig? synthesizeSpeechConfig; |
| |
| GoogleCloudDialogflowV2OutputAudioConfig({ |
| this.audioEncoding, |
| this.sampleRateHertz, |
| this.synthesizeSpeechConfig, |
| }); |
| |
| GoogleCloudDialogflowV2OutputAudioConfig.fromJson(core.Map _json) |
| : this( |
| audioEncoding: _json.containsKey('audioEncoding') |
| ? _json['audioEncoding'] as core.String |
| : null, |
| sampleRateHertz: _json.containsKey('sampleRateHertz') |
| ? _json['sampleRateHertz'] as core.int |
| : null, |
| synthesizeSpeechConfig: _json.containsKey('synthesizeSpeechConfig') |
| ? GoogleCloudDialogflowV2SynthesizeSpeechConfig.fromJson( |
| _json['synthesizeSpeechConfig'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (audioEncoding != null) 'audioEncoding': audioEncoding!, |
| if (sampleRateHertz != null) 'sampleRateHertz': sampleRateHertz!, |
| if (synthesizeSpeechConfig != null) |
| 'synthesizeSpeechConfig': synthesizeSpeechConfig!.toJson(), |
| }; |
| } |
| |
| /// Represents a conversation participant (human agent, virtual agent, |
| /// end-user). |
| class GoogleCloudDialogflowV2Participant { |
| /// The unique identifier of this participant. |
| /// |
| /// Format: `projects//locations//conversations//participants/`. |
| /// |
| /// Optional. |
| core.String? name; |
| |
| /// The role this participant plays in the conversation. |
| /// |
| /// This field must be set during participant creation and is then immutable. |
| /// |
| /// Immutable. |
| /// Possible string values are: |
| /// - "ROLE_UNSPECIFIED" : Participant role not set. |
| /// - "HUMAN_AGENT" : Participant is a human agent. |
| /// - "AUTOMATED_AGENT" : Participant is an automated agent, such as a |
| /// Dialogflow agent. |
| /// - "END_USER" : Participant is an end user that has called or chatted with |
| /// Dialogflow services. |
| core.String? role; |
| |
| /// Label applied to streams representing this participant in SIPREC XML |
| /// metadata and SDP. |
| /// |
| /// This is used to assign transcriptions from that media stream to this |
| /// participant. This field can be updated. |
| /// |
| /// Optional. |
| core.String? sipRecordingMediaLabel; |
| |
| GoogleCloudDialogflowV2Participant({ |
| this.name, |
| this.role, |
| this.sipRecordingMediaLabel, |
| }); |
| |
| GoogleCloudDialogflowV2Participant.fromJson(core.Map _json) |
| : this( |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| role: _json.containsKey('role') ? _json['role'] as core.String : null, |
| sipRecordingMediaLabel: _json.containsKey('sipRecordingMediaLabel') |
| ? _json['sipRecordingMediaLabel'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (name != null) 'name': name!, |
| if (role != null) 'role': role!, |
| if (sipRecordingMediaLabel != null) |
| 'sipRecordingMediaLabel': sipRecordingMediaLabel!, |
| }; |
| } |
| |
| /// Represents the query input. |
| /// |
| /// It can contain either: 1. An audio config which instructs the speech |
| /// recognizer how to process the speech audio. 2. A conversational query in the |
| /// form of text,. 3. An event that specifies which intent to trigger. |
| class GoogleCloudDialogflowV2QueryInput { |
| /// Instructs the speech recognizer how to process the speech audio. |
| GoogleCloudDialogflowV2InputAudioConfig? audioConfig; |
| |
| /// The event to be processed. |
| GoogleCloudDialogflowV2EventInput? event; |
| |
| /// The natural language text to be processed. |
| GoogleCloudDialogflowV2TextInput? text; |
| |
| GoogleCloudDialogflowV2QueryInput({ |
| this.audioConfig, |
| this.event, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowV2QueryInput.fromJson(core.Map _json) |
| : this( |
| audioConfig: _json.containsKey('audioConfig') |
| ? GoogleCloudDialogflowV2InputAudioConfig.fromJson( |
| _json['audioConfig'] as core.Map<core.String, core.dynamic>) |
| : null, |
| event: _json.containsKey('event') |
| ? GoogleCloudDialogflowV2EventInput.fromJson( |
| _json['event'] as core.Map<core.String, core.dynamic>) |
| : null, |
| text: _json.containsKey('text') |
| ? GoogleCloudDialogflowV2TextInput.fromJson( |
| _json['text'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (audioConfig != null) 'audioConfig': audioConfig!.toJson(), |
| if (event != null) 'event': event!.toJson(), |
| if (text != null) 'text': text!.toJson(), |
| }; |
| } |
| |
| /// Represents the parameters of the conversational query. |
| class GoogleCloudDialogflowV2QueryParameters { |
| /// The collection of contexts to be activated before this query is executed. |
| core.List<GoogleCloudDialogflowV2Context>? contexts; |
| |
| /// The geo location of this conversational query. |
| GoogleTypeLatLng? geoLocation; |
| |
| /// This field can be used to pass custom data to your webhook. |
| /// |
| /// Arbitrary JSON objects are supported. If supplied, the value is used to |
| /// populate the `WebhookRequest.original_detect_intent_request.payload` field |
| /// sent to your webhook. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? payload; |
| |
| /// Specifies whether to delete all contexts in the current session before the |
| /// new ones are activated. |
| core.bool? resetContexts; |
| |
| /// Configures the type of sentiment analysis to perform. |
| /// |
| /// If not provided, sentiment analysis is not performed. |
| GoogleCloudDialogflowV2SentimentAnalysisRequestConfig? |
| sentimentAnalysisRequestConfig; |
| |
| /// Additional session entity types to replace or extend developer entity |
| /// types with. |
| /// |
| /// The entity synonyms apply to all languages and persist for the session of |
| /// this query. |
| core.List<GoogleCloudDialogflowV2SessionEntityType>? sessionEntityTypes; |
| |
| /// The time zone of this conversational query from the |
| /// [time zone database](https://www.iana.org/time-zones), e.g., |
| /// America/New_York, Europe/Paris. |
| /// |
| /// If not provided, the time zone specified in agent settings is used. |
| core.String? timeZone; |
| |
| /// This field can be used to pass HTTP headers for a webhook call. |
| /// |
| /// These headers will be sent to webhook along with the headers that have |
| /// been configured through the Dialogflow web console. The headers defined |
| /// within this field will overwrite the headers configured through the |
| /// Dialogflow console if there is a conflict. Header names are |
| /// case-insensitive. Google's specified headers are not allowed. Including: |
| /// "Host", "Content-Length", "Connection", "From", "User-Agent", |
| /// "Accept-Encoding", "If-Modified-Since", "If-None-Match", |
| /// "X-Forwarded-For", etc. |
| core.Map<core.String, core.String>? webhookHeaders; |
| |
| GoogleCloudDialogflowV2QueryParameters({ |
| this.contexts, |
| this.geoLocation, |
| this.payload, |
| this.resetContexts, |
| this.sentimentAnalysisRequestConfig, |
| this.sessionEntityTypes, |
| this.timeZone, |
| this.webhookHeaders, |
| }); |
| |
| GoogleCloudDialogflowV2QueryParameters.fromJson(core.Map _json) |
| : this( |
| contexts: _json.containsKey('contexts') |
| ? (_json['contexts'] as core.List) |
| .map<GoogleCloudDialogflowV2Context>((value) => |
| GoogleCloudDialogflowV2Context.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| geoLocation: _json.containsKey('geoLocation') |
| ? GoogleTypeLatLng.fromJson( |
| _json['geoLocation'] as core.Map<core.String, core.dynamic>) |
| : null, |
| payload: _json.containsKey('payload') |
| ? (_json['payload'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| resetContexts: _json.containsKey('resetContexts') |
| ? _json['resetContexts'] as core.bool |
| : null, |
| sentimentAnalysisRequestConfig: _json |
| .containsKey('sentimentAnalysisRequestConfig') |
| ? GoogleCloudDialogflowV2SentimentAnalysisRequestConfig.fromJson( |
| _json['sentimentAnalysisRequestConfig'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| sessionEntityTypes: _json.containsKey('sessionEntityTypes') |
| ? (_json['sessionEntityTypes'] as core.List) |
| .map<GoogleCloudDialogflowV2SessionEntityType>((value) => |
| GoogleCloudDialogflowV2SessionEntityType.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| timeZone: _json.containsKey('timeZone') |
| ? _json['timeZone'] as core.String |
| : null, |
| webhookHeaders: _json.containsKey('webhookHeaders') |
| ? (_json['webhookHeaders'] as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.String, |
| ), |
| ) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (contexts != null) |
| 'contexts': contexts!.map((value) => value.toJson()).toList(), |
| if (geoLocation != null) 'geoLocation': geoLocation!.toJson(), |
| if (payload != null) 'payload': payload!, |
| if (resetContexts != null) 'resetContexts': resetContexts!, |
| if (sentimentAnalysisRequestConfig != null) |
| 'sentimentAnalysisRequestConfig': |
| sentimentAnalysisRequestConfig!.toJson(), |
| if (sessionEntityTypes != null) |
| 'sessionEntityTypes': |
| sessionEntityTypes!.map((value) => value.toJson()).toList(), |
| if (timeZone != null) 'timeZone': timeZone!, |
| if (webhookHeaders != null) 'webhookHeaders': webhookHeaders!, |
| }; |
| } |
| |
| /// Represents the result of conversational query or event processing. |
| class GoogleCloudDialogflowV2QueryResult { |
| /// The action name from the matched intent. |
| core.String? action; |
| |
| /// This field is set to: - `false` if the matched intent has required |
| /// parameters and not all of the required parameter values have been |
| /// collected. |
| /// |
| /// - `true` if all required parameter values have been collected, or if the |
| /// matched intent doesn't contain any required parameters. |
| core.bool? allRequiredParamsPresent; |
| |
| /// Indicates whether the conversational query triggers a cancellation for |
| /// slot filling. |
| core.bool? cancelsSlotFilling; |
| |
| /// Free-form diagnostic information for the associated detect intent request. |
| /// |
| /// The fields of this data can change without notice, so you should not write |
| /// code that depends on its structure. The data may contain: - webhook call |
| /// latency - webhook errors |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? diagnosticInfo; |
| |
| /// The collection of rich messages to present to the user. |
| core.List<GoogleCloudDialogflowV2IntentMessage>? fulfillmentMessages; |
| |
| /// The text to be pronounced to the user or shown on the screen. |
| /// |
| /// Note: This is a legacy field, `fulfillment_messages` should be preferred. |
| core.String? fulfillmentText; |
| |
| /// The intent that matched the conversational query. |
| /// |
| /// Some, not all fields are filled in this message, including but not limited |
| /// to: `name`, `display_name`, `end_interaction` and `is_fallback`. |
| GoogleCloudDialogflowV2Intent? intent; |
| |
| /// The intent detection confidence. |
| /// |
| /// Values range from 0.0 (completely uncertain) to 1.0 (completely certain). |
| /// This value is for informational purpose only and is only used to help |
| /// match the best intent within the classification threshold. This value may |
| /// change for the same end-user expression at any time due to a model |
| /// retraining or change in implementation. If there are `multiple |
| /// knowledge_answers` messages, this value is set to the greatest |
| /// `knowledgeAnswers.match_confidence` value in the list. |
| core.double? intentDetectionConfidence; |
| |
| /// The language that was triggered during intent detection. |
| /// |
| /// See |
| /// [Language Support](https://cloud.google.com/dialogflow/docs/reference/language) |
| /// for a list of the currently supported language codes. |
| core.String? languageCode; |
| |
| /// The collection of output contexts. |
| /// |
| /// If applicable, `output_contexts.parameters` contains entries with name |
| /// `.original` containing the original parameter values before the query. |
| core.List<GoogleCloudDialogflowV2Context>? outputContexts; |
| |
| /// The collection of extracted parameters. |
| /// |
| /// Depending on your protocol or client library language, this is a map, |
| /// associative array, symbol table, dictionary, or JSON object composed of a |
| /// collection of (MapKey, MapValue) pairs: - MapKey type: string - MapKey |
| /// value: parameter name - MapValue type: - If parameter's entity type is a |
| /// composite entity: map - Else: depending on parameter value type, could be |
| /// one of string, number, boolean, null, list or map - MapValue value: - If |
| /// parameter's entity type is a composite entity: map from composite entity |
| /// property names to property values - Else: parameter value |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? parameters; |
| |
| /// The original conversational query text: - If natural language text was |
| /// provided as input, `query_text` contains a copy of the input. |
| /// |
| /// - If natural language speech audio was provided as input, `query_text` |
| /// contains the speech recognition result. If speech recognizer produced |
| /// multiple alternatives, a particular one is picked. - If automatic spell |
| /// correction is enabled, `query_text` will contain the corrected user input. |
| core.String? queryText; |
| |
| /// The sentiment analysis result, which depends on the |
| /// `sentiment_analysis_request_config` specified in the request. |
| GoogleCloudDialogflowV2SentimentAnalysisResult? sentimentAnalysisResult; |
| |
| /// The Speech recognition confidence between 0.0 and 1.0. |
| /// |
| /// A higher number indicates an estimated greater likelihood that the |
| /// recognized words are correct. The default of 0.0 is a sentinel value |
| /// indicating that confidence was not set. This field is not guaranteed to be |
| /// accurate or set. In particular this field isn't set for |
| /// StreamingDetectIntent since the streaming endpoint has separate confidence |
| /// estimates per portion of the audio in StreamingRecognitionResult. |
| core.double? speechRecognitionConfidence; |
| |
| /// If the query was fulfilled by a webhook call, this field is set to the |
| /// value of the `payload` field returned in the webhook response. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? webhookPayload; |
| |
| /// If the query was fulfilled by a webhook call, this field is set to the |
| /// value of the `source` field returned in the webhook response. |
| core.String? webhookSource; |
| |
| GoogleCloudDialogflowV2QueryResult({ |
| this.action, |
| this.allRequiredParamsPresent, |
| this.cancelsSlotFilling, |
| this.diagnosticInfo, |
| this.fulfillmentMessages, |
| this.fulfillmentText, |
| this.intent, |
| this.intentDetectionConfidence, |
| this.languageCode, |
| this.outputContexts, |
| this.parameters, |
| this.queryText, |
| this.sentimentAnalysisResult, |
| this.speechRecognitionConfidence, |
| this.webhookPayload, |
| this.webhookSource, |
| }); |
| |
| GoogleCloudDialogflowV2QueryResult.fromJson(core.Map _json) |
| : this( |
| action: _json.containsKey('action') |
| ? _json['action'] as core.String |
| : null, |
| allRequiredParamsPresent: |
| _json.containsKey('allRequiredParamsPresent') |
| ? _json['allRequiredParamsPresent'] as core.bool |
| : null, |
| cancelsSlotFilling: _json.containsKey('cancelsSlotFilling') |
| ? _json['cancelsSlotFilling'] as core.bool |
| : null, |
| diagnosticInfo: _json.containsKey('diagnosticInfo') |
| ? (_json['diagnosticInfo'] as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| fulfillmentMessages: _json.containsKey('fulfillmentMessages') |
| ? (_json['fulfillmentMessages'] as core.List) |
| .map<GoogleCloudDialogflowV2IntentMessage>((value) => |
| GoogleCloudDialogflowV2IntentMessage.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| fulfillmentText: _json.containsKey('fulfillmentText') |
| ? _json['fulfillmentText'] as core.String |
| : null, |
| intent: _json.containsKey('intent') |
| ? GoogleCloudDialogflowV2Intent.fromJson( |
| _json['intent'] as core.Map<core.String, core.dynamic>) |
| : null, |
| intentDetectionConfidence: |
| _json.containsKey('intentDetectionConfidence') |
| ? (_json['intentDetectionConfidence'] as core.num).toDouble() |
| : null, |
| languageCode: _json.containsKey('languageCode') |
| ? _json['languageCode'] as core.String |
| : null, |
| outputContexts: _json.containsKey('outputContexts') |
| ? (_json['outputContexts'] as core.List) |
| .map<GoogleCloudDialogflowV2Context>((value) => |
| GoogleCloudDialogflowV2Context.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| parameters: _json.containsKey('parameters') |
| ? (_json['parameters'] as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| queryText: _json.containsKey('queryText') |
| ? _json['queryText'] as core.String |
| : null, |
| sentimentAnalysisResult: _json.containsKey('sentimentAnalysisResult') |
| ? GoogleCloudDialogflowV2SentimentAnalysisResult.fromJson( |
| _json['sentimentAnalysisResult'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| speechRecognitionConfidence: _json |
| .containsKey('speechRecognitionConfidence') |
| ? (_json['speechRecognitionConfidence'] as core.num).toDouble() |
| : null, |
| webhookPayload: _json.containsKey('webhookPayload') |
| ? (_json['webhookPayload'] as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| webhookSource: _json.containsKey('webhookSource') |
| ? _json['webhookSource'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (action != null) 'action': action!, |
| if (allRequiredParamsPresent != null) |
| 'allRequiredParamsPresent': allRequiredParamsPresent!, |
| if (cancelsSlotFilling != null) |
| 'cancelsSlotFilling': cancelsSlotFilling!, |
| if (diagnosticInfo != null) 'diagnosticInfo': diagnosticInfo!, |
| if (fulfillmentMessages != null) |
| 'fulfillmentMessages': |
| fulfillmentMessages!.map((value) => value.toJson()).toList(), |
| if (fulfillmentText != null) 'fulfillmentText': fulfillmentText!, |
| if (intent != null) 'intent': intent!.toJson(), |
| if (intentDetectionConfidence != null) |
| 'intentDetectionConfidence': intentDetectionConfidence!, |
| if (languageCode != null) 'languageCode': languageCode!, |
| if (outputContexts != null) |
| 'outputContexts': |
| outputContexts!.map((value) => value.toJson()).toList(), |
| if (parameters != null) 'parameters': parameters!, |
| if (queryText != null) 'queryText': queryText!, |
| if (sentimentAnalysisResult != null) |
| 'sentimentAnalysisResult': sentimentAnalysisResult!.toJson(), |
| if (speechRecognitionConfidence != null) |
| 'speechRecognitionConfidence': speechRecognitionConfidence!, |
| if (webhookPayload != null) 'webhookPayload': webhookPayload!, |
| if (webhookSource != null) 'webhookSource': webhookSource!, |
| }; |
| } |
| |
| /// Request message for Documents.ReloadDocument. |
| class GoogleCloudDialogflowV2ReloadDocumentRequest { |
| /// The path of gcs source file for reloading document content. |
| /// |
| /// For now, only gcs uri is supported. For documents stored in Google Cloud |
| /// Storage, these URIs must have the form `gs:///`. |
| /// |
| /// Optional. |
| core.String? contentUri; |
| |
| GoogleCloudDialogflowV2ReloadDocumentRequest({ |
| this.contentUri, |
| }); |
| |
| GoogleCloudDialogflowV2ReloadDocumentRequest.fromJson(core.Map _json) |
| : this( |
| contentUri: _json.containsKey('contentUri') |
| ? _json['contentUri'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (contentUri != null) 'contentUri': contentUri!, |
| }; |
| } |
| |
| /// The request message for Agents.RestoreAgent. |
| class GoogleCloudDialogflowV2RestoreAgentRequest { |
| /// Zip compressed raw byte content for agent. |
| core.String? agentContent; |
| core.List<core.int> get agentContentAsBytes => |
| convert.base64.decode(agentContent!); |
| |
| set agentContentAsBytes(core.List<core.int> _bytes) { |
| agentContent = |
| convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); |
| } |
| |
| /// The URI to a Google Cloud Storage file containing the agent to restore. |
| /// |
| /// Note: The URI must start with "gs://". |
| core.String? agentUri; |
| |
| GoogleCloudDialogflowV2RestoreAgentRequest({ |
| this.agentContent, |
| this.agentUri, |
| }); |
| |
| GoogleCloudDialogflowV2RestoreAgentRequest.fromJson(core.Map _json) |
| : this( |
| agentContent: _json.containsKey('agentContent') |
| ? _json['agentContent'] as core.String |
| : null, |
| agentUri: _json.containsKey('agentUri') |
| ? _json['agentUri'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (agentContent != null) 'agentContent': agentContent!, |
| if (agentUri != null) 'agentUri': agentUri!, |
| }; |
| } |
| |
| /// The response message for Agents.SearchAgents. |
| class GoogleCloudDialogflowV2SearchAgentsResponse { |
| /// The list of agents. |
| /// |
| /// There will be a maximum number of items returned based on the page_size |
| /// field in the request. |
| core.List<GoogleCloudDialogflowV2Agent>? agents; |
| |
| /// Token to retrieve the next page of results, or empty if there are no more |
| /// results in the list. |
| core.String? nextPageToken; |
| |
| GoogleCloudDialogflowV2SearchAgentsResponse({ |
| this.agents, |
| this.nextPageToken, |
| }); |
| |
| GoogleCloudDialogflowV2SearchAgentsResponse.fromJson(core.Map _json) |
| : this( |
| agents: _json.containsKey('agents') |
| ? (_json['agents'] as core.List) |
| .map<GoogleCloudDialogflowV2Agent>((value) => |
| GoogleCloudDialogflowV2Agent.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| nextPageToken: _json.containsKey('nextPageToken') |
| ? _json['nextPageToken'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (agents != null) |
| 'agents': agents!.map((value) => value.toJson()).toList(), |
| if (nextPageToken != null) 'nextPageToken': nextPageToken!, |
| }; |
| } |
| |
| /// The sentiment, such as positive/negative feeling or association, for a unit |
| /// of analysis, such as the query text. |
| class GoogleCloudDialogflowV2Sentiment { |
| /// A non-negative number in the \[0, +inf) range, which represents the |
| /// absolute magnitude of sentiment, regardless of score (positive or |
| /// negative). |
| core.double? magnitude; |
| |
| /// Sentiment score between -1.0 (negative sentiment) and 1.0 (positive |
| /// sentiment). |
| core.double? score; |
| |
| GoogleCloudDialogflowV2Sentiment({ |
| this.magnitude, |
| this.score, |
| }); |
| |
| GoogleCloudDialogflowV2Sentiment.fromJson(core.Map _json) |
| : this( |
| magnitude: _json.containsKey('magnitude') |
| ? (_json['magnitude'] as core.num).toDouble() |
| : null, |
| score: _json.containsKey('score') |
| ? (_json['score'] as core.num).toDouble() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (magnitude != null) 'magnitude': magnitude!, |
| if (score != null) 'score': score!, |
| }; |
| } |
| |
| /// Configures the types of sentiment analysis to perform. |
| class GoogleCloudDialogflowV2SentimentAnalysisRequestConfig { |
| /// Instructs the service to perform sentiment analysis on `query_text`. |
| /// |
| /// If not provided, sentiment analysis is not performed on `query_text`. |
| core.bool? analyzeQueryTextSentiment; |
| |
| GoogleCloudDialogflowV2SentimentAnalysisRequestConfig({ |
| this.analyzeQueryTextSentiment, |
| }); |
| |
| GoogleCloudDialogflowV2SentimentAnalysisRequestConfig.fromJson(core.Map _json) |
| : this( |
| analyzeQueryTextSentiment: |
| _json.containsKey('analyzeQueryTextSentiment') |
| ? _json['analyzeQueryTextSentiment'] as core.bool |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (analyzeQueryTextSentiment != null) |
| 'analyzeQueryTextSentiment': analyzeQueryTextSentiment!, |
| }; |
| } |
| |
| /// The result of sentiment analysis. |
| /// |
| /// Sentiment analysis inspects user input and identifies the prevailing |
| /// subjective opinion, especially to determine a user's attitude as positive, |
| /// negative, or neutral. For Participants.DetectIntent, it needs to be |
| /// configured in DetectIntentRequest.query_params. For |
| /// Participants.StreamingDetectIntent, it needs to be configured in |
| /// StreamingDetectIntentRequest.query_params. And for |
| /// Participants.AnalyzeContent and Participants.StreamingAnalyzeContent, it |
| /// needs to be configured in ConversationProfile.human_agent_assistant_config |
| class GoogleCloudDialogflowV2SentimentAnalysisResult { |
| /// The sentiment analysis result for `query_text`. |
| GoogleCloudDialogflowV2Sentiment? queryTextSentiment; |
| |
| GoogleCloudDialogflowV2SentimentAnalysisResult({ |
| this.queryTextSentiment, |
| }); |
| |
| GoogleCloudDialogflowV2SentimentAnalysisResult.fromJson(core.Map _json) |
| : this( |
| queryTextSentiment: _json.containsKey('queryTextSentiment') |
| ? GoogleCloudDialogflowV2Sentiment.fromJson( |
| _json['queryTextSentiment'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (queryTextSentiment != null) |
| 'queryTextSentiment': queryTextSentiment!.toJson(), |
| }; |
| } |
| |
| /// A session represents a conversation between a Dialogflow agent and an |
| /// end-user. |
| /// |
| /// You can create special entities, called session entities, during a session. |
| /// Session entities can extend or replace custom entity types and only exist |
| /// during the session that they were created for. All session data, including |
| /// session entities, is stored by Dialogflow for 20 minutes. For more |
| /// information, see the |
| /// [session entity guide](https://cloud.google.com/dialogflow/docs/entities-session). |
| class GoogleCloudDialogflowV2SessionEntityType { |
| /// The collection of entities associated with this session entity type. |
| /// |
| /// Required. |
| core.List<GoogleCloudDialogflowV2EntityTypeEntity>? entities; |
| |
| /// Indicates whether the additional data should override or supplement the |
| /// custom entity type definition. |
| /// |
| /// Required. |
| /// Possible string values are: |
| /// - "ENTITY_OVERRIDE_MODE_UNSPECIFIED" : Not specified. This value should be |
| /// never used. |
| /// - "ENTITY_OVERRIDE_MODE_OVERRIDE" : The collection of session entities |
| /// overrides the collection of entities in the corresponding custom entity |
| /// type. |
| /// - "ENTITY_OVERRIDE_MODE_SUPPLEMENT" : The collection of session entities |
| /// extends the collection of entities in the corresponding custom entity |
| /// type. Note: Even in this override mode calls to `ListSessionEntityTypes`, |
| /// `GetSessionEntityType`, `CreateSessionEntityType` and |
| /// `UpdateSessionEntityType` only return the additional entities added in |
| /// this session entity type. If you want to get the supplemented list, please |
| /// call EntityTypes.GetEntityType on the custom entity type and merge. |
| core.String? entityOverrideMode; |
| |
| /// The unique identifier of this session entity type. |
| /// |
| /// Format: `projects//agent/sessions//entityTypes/`, or |
| /// `projects//agent/environments//users//sessions//entityTypes/`. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. `` must be the |
| /// display name of an existing entity type in the same agent that will be |
| /// overridden or supplemented. |
| /// |
| /// Required. |
| core.String? name; |
| |
| GoogleCloudDialogflowV2SessionEntityType({ |
| this.entities, |
| this.entityOverrideMode, |
| this.name, |
| }); |
| |
| GoogleCloudDialogflowV2SessionEntityType.fromJson(core.Map _json) |
| : this( |
| entities: _json.containsKey('entities') |
| ? (_json['entities'] as core.List) |
| .map<GoogleCloudDialogflowV2EntityTypeEntity>((value) => |
| GoogleCloudDialogflowV2EntityTypeEntity.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| entityOverrideMode: _json.containsKey('entityOverrideMode') |
| ? _json['entityOverrideMode'] as core.String |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (entities != null) |
| 'entities': entities!.map((value) => value.toJson()).toList(), |
| if (entityOverrideMode != null) |
| 'entityOverrideMode': entityOverrideMode!, |
| if (name != null) 'name': name!, |
| }; |
| } |
| |
| /// Hints for the speech recognizer to help with recognition in a specific |
| /// conversation state. |
| class GoogleCloudDialogflowV2SpeechContext { |
| /// Boost for this context compared to other contexts: * If the boost is |
| /// positive, Dialogflow will increase the probability that the phrases in |
| /// this context are recognized over similar sounding phrases. |
| /// |
| /// * If the boost is unspecified or non-positive, Dialogflow will not apply |
| /// any boost. Dialogflow recommends that you use boosts in the range (0, 20\] |
| /// and that you find a value that fits your use case with binary search. |
| /// |
| /// Optional. |
| core.double? boost; |
| |
| /// A list of strings containing words and phrases that the speech recognizer |
| /// should recognize with higher likelihood. |
| /// |
| /// This list can be used to: * improve accuracy for words and phrases you |
| /// expect the user to say, e.g. typical commands for your Dialogflow agent * |
| /// add additional words to the speech recognizer vocabulary * ... See the |
| /// [Cloud Speech documentation](https://cloud.google.com/speech-to-text/quotas) |
| /// for usage limits. |
| /// |
| /// Optional. |
| core.List<core.String>? phrases; |
| |
| GoogleCloudDialogflowV2SpeechContext({ |
| this.boost, |
| this.phrases, |
| }); |
| |
| GoogleCloudDialogflowV2SpeechContext.fromJson(core.Map _json) |
| : this( |
| boost: _json.containsKey('boost') |
| ? (_json['boost'] as core.num).toDouble() |
| : null, |
| phrases: _json.containsKey('phrases') |
| ? (_json['phrases'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (boost != null) 'boost': boost!, |
| if (phrases != null) 'phrases': phrases!, |
| }; |
| } |
| |
| /// Configures speech transcription for ConversationProfile. |
| class GoogleCloudDialogflowV2SpeechToTextConfig { |
| /// The speech model used in speech to text. |
| /// |
| /// `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated |
| /// as `USE_ENHANCED`. It can be overridden in AnalyzeContentRequest and |
| /// StreamingAnalyzeContentRequest request. |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "SPEECH_MODEL_VARIANT_UNSPECIFIED" : No model variant specified. In this |
| /// case Dialogflow defaults to USE_BEST_AVAILABLE. |
| /// - "USE_BEST_AVAILABLE" : Use the best available variant of the Speech |
| /// model that the caller is eligible for. Please see the |
| /// [Dialogflow docs](https://cloud.google.com/dialogflow/docs/data-logging) |
| /// for how to make your project eligible for enhanced models. |
| /// - "USE_STANDARD" : Use standard model variant even if an enhanced model is |
| /// available. See the |
| /// [Cloud Speech documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) |
| /// for details about enhanced models. |
| /// - "USE_ENHANCED" : Use an enhanced model variant: * If an enhanced variant |
| /// does not exist for the given model and request language, Dialogflow falls |
| /// back to the standard variant. The |
| /// [Cloud Speech documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) |
| /// describes which models have enhanced variants. * If the API caller isn't |
| /// eligible for enhanced models, Dialogflow returns an error. Please see the |
| /// [Dialogflow docs](https://cloud.google.com/dialogflow/docs/data-logging) |
| /// for how to make your project eligible. |
| core.String? speechModelVariant; |
| |
| GoogleCloudDialogflowV2SpeechToTextConfig({ |
| this.speechModelVariant, |
| }); |
| |
| GoogleCloudDialogflowV2SpeechToTextConfig.fromJson(core.Map _json) |
| : this( |
| speechModelVariant: _json.containsKey('speechModelVariant') |
| ? _json['speechModelVariant'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (speechModelVariant != null) |
| 'speechModelVariant': speechModelVariant!, |
| }; |
| } |
| |
| /// The request message for Participants.SuggestArticles. |
| class GoogleCloudDialogflowV2SuggestArticlesRequest { |
| /// Max number of messages prior to and including latest_message to use as |
| /// context when compiling the suggestion. |
| /// |
| /// By default 20 and at most 50. |
| core.int? contextSize; |
| |
| /// The name of the latest conversation message to compile suggestion for. |
| /// |
| /// If empty, it will be the latest message of the conversation. Format: |
| /// `projects//locations//conversations//messages/`. |
| core.String? latestMessage; |
| |
| GoogleCloudDialogflowV2SuggestArticlesRequest({ |
| this.contextSize, |
| this.latestMessage, |
| }); |
| |
| GoogleCloudDialogflowV2SuggestArticlesRequest.fromJson(core.Map _json) |
| : this( |
| contextSize: _json.containsKey('contextSize') |
| ? _json['contextSize'] as core.int |
| : null, |
| latestMessage: _json.containsKey('latestMessage') |
| ? _json['latestMessage'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (contextSize != null) 'contextSize': contextSize!, |
| if (latestMessage != null) 'latestMessage': latestMessage!, |
| }; |
| } |
| |
| /// The response message for Participants.SuggestArticles. |
| class GoogleCloudDialogflowV2SuggestArticlesResponse { |
| /// Articles ordered by score in descending order. |
| core.List<GoogleCloudDialogflowV2ArticleAnswer>? articleAnswers; |
| |
| /// Number of messages prior to and including latest_message to compile the |
| /// suggestion. |
| /// |
| /// It may be smaller than the SuggestArticlesRequest.context_size field in |
| /// the request if there aren't that many messages in the conversation. |
| core.int? contextSize; |
| |
| /// The name of the latest conversation message used to compile suggestion |
| /// for. |
| /// |
| /// Format: `projects//locations//conversations//messages/`. |
| core.String? latestMessage; |
| |
| GoogleCloudDialogflowV2SuggestArticlesResponse({ |
| this.articleAnswers, |
| this.contextSize, |
| this.latestMessage, |
| }); |
| |
| GoogleCloudDialogflowV2SuggestArticlesResponse.fromJson(core.Map _json) |
| : this( |
| articleAnswers: _json.containsKey('articleAnswers') |
| ? (_json['articleAnswers'] as core.List) |
| .map<GoogleCloudDialogflowV2ArticleAnswer>((value) => |
| GoogleCloudDialogflowV2ArticleAnswer.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| contextSize: _json.containsKey('contextSize') |
| ? _json['contextSize'] as core.int |
| : null, |
| latestMessage: _json.containsKey('latestMessage') |
| ? _json['latestMessage'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (articleAnswers != null) |
| 'articleAnswers': |
| articleAnswers!.map((value) => value.toJson()).toList(), |
| if (contextSize != null) 'contextSize': contextSize!, |
| if (latestMessage != null) 'latestMessage': latestMessage!, |
| }; |
| } |
| |
| /// The request message for Participants.SuggestFaqAnswers. |
| class GoogleCloudDialogflowV2SuggestFaqAnswersRequest { |
| /// Max number of messages prior to and including \[latest_message\] to use as |
| /// context when compiling the suggestion. |
| /// |
| /// By default 20 and at most 50. |
| core.int? contextSize; |
| |
| /// The name of the latest conversation message to compile suggestion for. |
| /// |
| /// If empty, it will be the latest message of the conversation. Format: |
| /// `projects//locations//conversations//messages/`. |
| core.String? latestMessage; |
| |
| GoogleCloudDialogflowV2SuggestFaqAnswersRequest({ |
| this.contextSize, |
| this.latestMessage, |
| }); |
| |
| GoogleCloudDialogflowV2SuggestFaqAnswersRequest.fromJson(core.Map _json) |
| : this( |
| contextSize: _json.containsKey('contextSize') |
| ? _json['contextSize'] as core.int |
| : null, |
| latestMessage: _json.containsKey('latestMessage') |
| ? _json['latestMessage'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (contextSize != null) 'contextSize': contextSize!, |
| if (latestMessage != null) 'latestMessage': latestMessage!, |
| }; |
| } |
| |
| /// The request message for Participants.SuggestFaqAnswers. |
| class GoogleCloudDialogflowV2SuggestFaqAnswersResponse { |
| /// Number of messages prior to and including latest_message to compile the |
| /// suggestion. |
| /// |
| /// It may be smaller than the SuggestFaqAnswersRequest.context_size field in |
| /// the request if there aren't that many messages in the conversation. |
| core.int? contextSize; |
| |
| /// Answers extracted from FAQ documents. |
| core.List<GoogleCloudDialogflowV2FaqAnswer>? faqAnswers; |
| |
| /// The name of the latest conversation message used to compile suggestion |
| /// for. |
| /// |
| /// Format: `projects//locations//conversations//messages/`. |
| core.String? latestMessage; |
| |
| GoogleCloudDialogflowV2SuggestFaqAnswersResponse({ |
| this.contextSize, |
| this.faqAnswers, |
| this.latestMessage, |
| }); |
| |
| GoogleCloudDialogflowV2SuggestFaqAnswersResponse.fromJson(core.Map _json) |
| : this( |
| contextSize: _json.containsKey('contextSize') |
| ? _json['contextSize'] as core.int |
| : null, |
| faqAnswers: _json.containsKey('faqAnswers') |
| ? (_json['faqAnswers'] as core.List) |
| .map<GoogleCloudDialogflowV2FaqAnswer>((value) => |
| GoogleCloudDialogflowV2FaqAnswer.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| latestMessage: _json.containsKey('latestMessage') |
| ? _json['latestMessage'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (contextSize != null) 'contextSize': contextSize!, |
| if (faqAnswers != null) |
| 'faqAnswers': faqAnswers!.map((value) => value.toJson()).toList(), |
| if (latestMessage != null) 'latestMessage': latestMessage!, |
| }; |
| } |
| |
| /// The type of Human Agent Assistant API suggestion to perform, and the maximum |
| /// number of results to return for that type. |
| /// |
| /// Multiple `Feature` objects can be specified in the `features` list. |
| class GoogleCloudDialogflowV2SuggestionFeature { |
| /// Type of Human Agent Assistant API feature to request. |
| /// Possible string values are: |
| /// - "TYPE_UNSPECIFIED" : Unspecified feature type. |
| /// - "ARTICLE_SUGGESTION" : Run article suggestion model. |
| /// - "FAQ" : Run FAQ model. |
| core.String? type; |
| |
| GoogleCloudDialogflowV2SuggestionFeature({ |
| this.type, |
| }); |
| |
| GoogleCloudDialogflowV2SuggestionFeature.fromJson(core.Map _json) |
| : this( |
| type: _json.containsKey('type') ? _json['type'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (type != null) 'type': type!, |
| }; |
| } |
| |
| /// One response of different type of suggestion response which is used in the |
| /// response of Participants.AnalyzeContent and Participants.AnalyzeContent, as |
| /// well as HumanAgentAssistantEvent. |
| class GoogleCloudDialogflowV2SuggestionResult { |
| /// Error status if the request failed. |
| GoogleRpcStatus? error; |
| |
| /// SuggestArticlesResponse if request is for ARTICLE_SUGGESTION. |
| GoogleCloudDialogflowV2SuggestArticlesResponse? suggestArticlesResponse; |
| |
| /// SuggestFaqAnswersResponse if request is for FAQ_ANSWER. |
| GoogleCloudDialogflowV2SuggestFaqAnswersResponse? suggestFaqAnswersResponse; |
| |
| GoogleCloudDialogflowV2SuggestionResult({ |
| this.error, |
| this.suggestArticlesResponse, |
| this.suggestFaqAnswersResponse, |
| }); |
| |
| GoogleCloudDialogflowV2SuggestionResult.fromJson(core.Map _json) |
| : this( |
| error: _json.containsKey('error') |
| ? GoogleRpcStatus.fromJson( |
| _json['error'] as core.Map<core.String, core.dynamic>) |
| : null, |
| suggestArticlesResponse: _json.containsKey('suggestArticlesResponse') |
| ? GoogleCloudDialogflowV2SuggestArticlesResponse.fromJson( |
| _json['suggestArticlesResponse'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| suggestFaqAnswersResponse: |
| _json.containsKey('suggestFaqAnswersResponse') |
| ? GoogleCloudDialogflowV2SuggestFaqAnswersResponse.fromJson( |
| _json['suggestFaqAnswersResponse'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (error != null) 'error': error!.toJson(), |
| if (suggestArticlesResponse != null) |
| 'suggestArticlesResponse': suggestArticlesResponse!.toJson(), |
| if (suggestFaqAnswersResponse != null) |
| 'suggestFaqAnswersResponse': suggestFaqAnswersResponse!.toJson(), |
| }; |
| } |
| |
| /// Configuration of how speech should be synthesized. |
| class GoogleCloudDialogflowV2SynthesizeSpeechConfig { |
| /// An identifier which selects 'audio effects' profiles that are applied on |
| /// (post synthesized) text to speech. |
| /// |
| /// Effects are applied on top of each other in the order they are given. |
| /// |
| /// Optional. |
| core.List<core.String>? effectsProfileId; |
| |
| /// Speaking pitch, in the range \[-20.0, 20.0\]. |
| /// |
| /// 20 means increase 20 semitones from the original pitch. -20 means decrease |
| /// 20 semitones from the original pitch. |
| /// |
| /// Optional. |
| core.double? pitch; |
| |
| /// Speaking rate/speed, in the range \[0.25, 4.0\]. |
| /// |
| /// 1.0 is the normal native speed supported by the specific voice. 2.0 is |
| /// twice as fast, and 0.5 is half as fast. If unset(0.0), defaults to the |
| /// native 1.0 speed. Any other values < 0.25 or > 4.0 will return an error. |
| /// |
| /// Optional. |
| core.double? speakingRate; |
| |
| /// The desired voice of the synthesized audio. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2VoiceSelectionParams? voice; |
| |
| /// Volume gain (in dB) of the normal native volume supported by the specific |
| /// voice, in the range \[-96.0, 16.0\]. |
| /// |
| /// If unset, or set to a value of 0.0 (dB), will play at normal native signal |
| /// amplitude. A value of -6.0 (dB) will play at approximately half the |
| /// amplitude of the normal native signal amplitude. A value of +6.0 (dB) will |
| /// play at approximately twice the amplitude of the normal native signal |
| /// amplitude. We strongly recommend not to exceed +10 (dB) as there's usually |
| /// no effective increase in loudness for any value greater than that. |
| /// |
| /// Optional. |
| core.double? volumeGainDb; |
| |
| GoogleCloudDialogflowV2SynthesizeSpeechConfig({ |
| this.effectsProfileId, |
| this.pitch, |
| this.speakingRate, |
| this.voice, |
| this.volumeGainDb, |
| }); |
| |
| GoogleCloudDialogflowV2SynthesizeSpeechConfig.fromJson(core.Map _json) |
| : this( |
| effectsProfileId: _json.containsKey('effectsProfileId') |
| ? (_json['effectsProfileId'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| pitch: _json.containsKey('pitch') |
| ? (_json['pitch'] as core.num).toDouble() |
| : null, |
| speakingRate: _json.containsKey('speakingRate') |
| ? (_json['speakingRate'] as core.num).toDouble() |
| : null, |
| voice: _json.containsKey('voice') |
| ? GoogleCloudDialogflowV2VoiceSelectionParams.fromJson( |
| _json['voice'] as core.Map<core.String, core.dynamic>) |
| : null, |
| volumeGainDb: _json.containsKey('volumeGainDb') |
| ? (_json['volumeGainDb'] as core.num).toDouble() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (effectsProfileId != null) 'effectsProfileId': effectsProfileId!, |
| if (pitch != null) 'pitch': pitch!, |
| if (speakingRate != null) 'speakingRate': speakingRate!, |
| if (voice != null) 'voice': voice!.toJson(), |
| if (volumeGainDb != null) 'volumeGainDb': volumeGainDb!, |
| }; |
| } |
| |
| /// Represents the natural language text to be processed. |
| class GoogleCloudDialogflowV2TextInput { |
| /// The language of this conversational query. |
| /// |
| /// See |
| /// [Language Support](https://cloud.google.com/dialogflow/docs/reference/language) |
| /// for a list of the currently supported language codes. Note that queries in |
| /// the same session do not necessarily need to specify the same language. |
| /// |
| /// Required. |
| core.String? languageCode; |
| |
| /// The UTF-8 encoded natural language text to be processed. |
| /// |
| /// Text length must not exceed 256 characters. |
| /// |
| /// Required. |
| core.String? text; |
| |
| GoogleCloudDialogflowV2TextInput({ |
| this.languageCode, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowV2TextInput.fromJson(core.Map _json) |
| : this( |
| languageCode: _json.containsKey('languageCode') |
| ? _json['languageCode'] as core.String |
| : null, |
| text: _json.containsKey('text') ? _json['text'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (languageCode != null) 'languageCode': languageCode!, |
| if (text != null) 'text': text!, |
| }; |
| } |
| |
| /// Instructs the speech synthesizer on how to generate the output audio |
| /// content. |
| class GoogleCloudDialogflowV2TextToSpeechSettings { |
| /// Indicates whether text to speech is enabled. |
| /// |
| /// Even when this field is false, other settings in this proto are still |
| /// retained. |
| /// |
| /// Optional. |
| core.bool? enableTextToSpeech; |
| |
| /// Audio encoding of the synthesized audio content. |
| /// |
| /// Required. |
| /// Possible string values are: |
| /// - "OUTPUT_AUDIO_ENCODING_UNSPECIFIED" : Not specified. |
| /// - "OUTPUT_AUDIO_ENCODING_LINEAR_16" : Uncompressed 16-bit signed |
| /// little-endian samples (Linear PCM). Audio content returned as LINEAR16 |
| /// also contains a WAV header. |
| /// - "OUTPUT_AUDIO_ENCODING_MP3" : MP3 audio at 32kbps. |
| /// - "OUTPUT_AUDIO_ENCODING_MP3_64_KBPS" : MP3 audio at 64kbps. |
| /// - "OUTPUT_AUDIO_ENCODING_OGG_OPUS" : Opus encoded audio wrapped in an ogg |
| /// container. The result will be a file which can be played natively on |
| /// Android, and in browsers (at least Chrome and Firefox). The quality of the |
| /// encoding is considerably higher than MP3 while using approximately the |
| /// same bitrate. |
| /// - "OUTPUT_AUDIO_ENCODING_MULAW" : 8-bit samples that compand 14-bit audio |
| /// samples using G.711 PCMU/mu-law. |
| core.String? outputAudioEncoding; |
| |
| /// The synthesis sample rate (in hertz) for this audio. |
| /// |
| /// If not provided, then the synthesizer will use the default sample rate |
| /// based on the audio encoding. If this is different from the voice's natural |
| /// sample rate, then the synthesizer will honor this request by converting to |
| /// the desired sample rate (which might result in worse audio quality). |
| /// |
| /// Optional. |
| core.int? sampleRateHertz; |
| |
| /// Configuration of how speech should be synthesized, mapping from language |
| /// (https://cloud.google.com/dialogflow/docs/reference/language) to |
| /// SynthesizeSpeechConfig. |
| /// |
| /// Optional. |
| core.Map<core.String, GoogleCloudDialogflowV2SynthesizeSpeechConfig>? |
| synthesizeSpeechConfigs; |
| |
| GoogleCloudDialogflowV2TextToSpeechSettings({ |
| this.enableTextToSpeech, |
| this.outputAudioEncoding, |
| this.sampleRateHertz, |
| this.synthesizeSpeechConfigs, |
| }); |
| |
| GoogleCloudDialogflowV2TextToSpeechSettings.fromJson(core.Map _json) |
| : this( |
| enableTextToSpeech: _json.containsKey('enableTextToSpeech') |
| ? _json['enableTextToSpeech'] as core.bool |
| : null, |
| outputAudioEncoding: _json.containsKey('outputAudioEncoding') |
| ? _json['outputAudioEncoding'] as core.String |
| : null, |
| sampleRateHertz: _json.containsKey('sampleRateHertz') |
| ? _json['sampleRateHertz'] as core.int |
| : null, |
| synthesizeSpeechConfigs: _json.containsKey('synthesizeSpeechConfigs') |
| ? (_json['synthesizeSpeechConfigs'] |
| as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| GoogleCloudDialogflowV2SynthesizeSpeechConfig.fromJson( |
| item as core.Map<core.String, core.dynamic>), |
| ), |
| ) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (enableTextToSpeech != null) |
| 'enableTextToSpeech': enableTextToSpeech!, |
| if (outputAudioEncoding != null) |
| 'outputAudioEncoding': outputAudioEncoding!, |
| if (sampleRateHertz != null) 'sampleRateHertz': sampleRateHertz!, |
| if (synthesizeSpeechConfigs != null) |
| 'synthesizeSpeechConfigs': synthesizeSpeechConfigs! |
| .map((key, item) => core.MapEntry(key, item.toJson())), |
| }; |
| } |
| |
| /// The request message for Agents.TrainAgent. |
| class GoogleCloudDialogflowV2TrainAgentRequest { |
| GoogleCloudDialogflowV2TrainAgentRequest(); |
| |
| GoogleCloudDialogflowV2TrainAgentRequest.fromJson( |
| // ignore: avoid_unused_constructor_parameters |
| core.Map _json); |
| |
| core.Map<core.String, core.dynamic> toJson() => {}; |
| } |
| |
| /// Represents a single validation error. |
| class GoogleCloudDialogflowV2ValidationError { |
| /// The names of the entries that the error is associated with. |
| /// |
| /// Format: - "projects//agent", if the error is associated with the entire |
| /// agent. - "projects//agent/intents/", if the error is associated with |
| /// certain intents. - "projects//agent/intents//trainingPhrases/", if the |
| /// error is associated with certain intent training phrases. - |
| /// "projects//agent/intents//parameters/", if the error is associated with |
| /// certain intent parameters. - "projects//agent/entities/", if the error is |
| /// associated with certain entities. |
| core.List<core.String>? entries; |
| |
| /// The detailed error message. |
| core.String? errorMessage; |
| |
| /// The severity of the error. |
| /// Possible string values are: |
| /// - "SEVERITY_UNSPECIFIED" : Not specified. This value should never be used. |
| /// - "INFO" : The agent doesn't follow Dialogflow best practices. |
| /// - "WARNING" : The agent may not behave as expected. |
| /// - "ERROR" : The agent may experience partial failures. |
| /// - "CRITICAL" : The agent may completely fail. |
| core.String? severity; |
| |
| GoogleCloudDialogflowV2ValidationError({ |
| this.entries, |
| this.errorMessage, |
| this.severity, |
| }); |
| |
| GoogleCloudDialogflowV2ValidationError.fromJson(core.Map _json) |
| : this( |
| entries: _json.containsKey('entries') |
| ? (_json['entries'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| errorMessage: _json.containsKey('errorMessage') |
| ? _json['errorMessage'] as core.String |
| : null, |
| severity: _json.containsKey('severity') |
| ? _json['severity'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (entries != null) 'entries': entries!, |
| if (errorMessage != null) 'errorMessage': errorMessage!, |
| if (severity != null) 'severity': severity!, |
| }; |
| } |
| |
| /// Represents the output of agent validation. |
| class GoogleCloudDialogflowV2ValidationResult { |
| /// Contains all validation errors. |
| core.List<GoogleCloudDialogflowV2ValidationError>? validationErrors; |
| |
| GoogleCloudDialogflowV2ValidationResult({ |
| this.validationErrors, |
| }); |
| |
| GoogleCloudDialogflowV2ValidationResult.fromJson(core.Map _json) |
| : this( |
| validationErrors: _json.containsKey('validationErrors') |
| ? (_json['validationErrors'] as core.List) |
| .map<GoogleCloudDialogflowV2ValidationError>((value) => |
| GoogleCloudDialogflowV2ValidationError.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (validationErrors != null) |
| 'validationErrors': |
| validationErrors!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// You can create multiple versions of your agent and publish them to separate |
| /// environments. |
| /// |
| /// When you edit an agent, you are editing the draft agent. At any point, you |
| /// can save the draft agent as an agent version, which is an immutable snapshot |
| /// of your agent. When you save the draft agent, it is published to the default |
| /// environment. When you create agent versions, you can publish them to custom |
| /// environments. You can create a variety of custom environments for: - testing |
| /// - development - production - etc. For more information, see the |
| /// [versions and environments guide](https://cloud.google.com/dialogflow/docs/agents-versions). |
| class GoogleCloudDialogflowV2Version { |
| /// The creation time of this version. |
| /// |
| /// This field is read-only, i.e., it cannot be set by create and update |
| /// methods. |
| /// |
| /// Output only. |
| core.String? createTime; |
| |
| /// The developer-provided description of this version. |
| /// |
| /// Optional. |
| core.String? description; |
| |
| /// The unique identifier of this agent version. |
| /// |
| /// Supported formats: - `projects//agent/versions/` - |
| /// `projects//locations//agent/versions/` |
| /// |
| /// Output only. |
| core.String? name; |
| |
| /// The status of this version. |
| /// |
| /// This field is read-only and cannot be set by create and update methods. |
| /// |
| /// Output only. |
| /// Possible string values are: |
| /// - "VERSION_STATUS_UNSPECIFIED" : Not specified. This value is not used. |
| /// - "IN_PROGRESS" : Version is not ready to serve (e.g. training is in |
| /// progress). |
| /// - "READY" : Version is ready to serve. |
| /// - "FAILED" : Version training failed. |
| core.String? status; |
| |
| /// The sequential number of this version. |
| /// |
| /// This field is read-only which means it cannot be set by create and update |
| /// methods. |
| /// |
| /// Output only. |
| core.int? versionNumber; |
| |
| GoogleCloudDialogflowV2Version({ |
| this.createTime, |
| this.description, |
| this.name, |
| this.status, |
| this.versionNumber, |
| }); |
| |
| GoogleCloudDialogflowV2Version.fromJson(core.Map _json) |
| : this( |
| createTime: _json.containsKey('createTime') |
| ? _json['createTime'] as core.String |
| : null, |
| description: _json.containsKey('description') |
| ? _json['description'] as core.String |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| status: _json.containsKey('status') |
| ? _json['status'] as core.String |
| : null, |
| versionNumber: _json.containsKey('versionNumber') |
| ? _json['versionNumber'] as core.int |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (createTime != null) 'createTime': createTime!, |
| if (description != null) 'description': description!, |
| if (name != null) 'name': name!, |
| if (status != null) 'status': status!, |
| if (versionNumber != null) 'versionNumber': versionNumber!, |
| }; |
| } |
| |
| /// Description of which voice to use for speech synthesis. |
| class GoogleCloudDialogflowV2VoiceSelectionParams { |
| /// The name of the voice. |
| /// |
| /// If not set, the service will choose a voice based on the other parameters |
| /// such as language_code and ssml_gender. |
| /// |
| /// Optional. |
| core.String? name; |
| |
| /// The preferred gender of the voice. |
| /// |
| /// If not set, the service will choose a voice based on the other parameters |
| /// such as language_code and name. Note that this is only a preference, not |
| /// requirement. If a voice of the appropriate gender is not available, the |
| /// synthesizer should substitute a voice with a different gender rather than |
| /// failing the request. |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "SSML_VOICE_GENDER_UNSPECIFIED" : An unspecified gender, which means |
| /// that the client doesn't care which gender the selected voice will have. |
| /// - "SSML_VOICE_GENDER_MALE" : A male voice. |
| /// - "SSML_VOICE_GENDER_FEMALE" : A female voice. |
| /// - "SSML_VOICE_GENDER_NEUTRAL" : A gender-neutral voice. |
| core.String? ssmlGender; |
| |
| GoogleCloudDialogflowV2VoiceSelectionParams({ |
| this.name, |
| this.ssmlGender, |
| }); |
| |
| GoogleCloudDialogflowV2VoiceSelectionParams.fromJson(core.Map _json) |
| : this( |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| ssmlGender: _json.containsKey('ssmlGender') |
| ? _json['ssmlGender'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (name != null) 'name': name!, |
| if (ssmlGender != null) 'ssmlGender': ssmlGender!, |
| }; |
| } |
| |
| /// The request message for a webhook call. |
| class GoogleCloudDialogflowV2WebhookRequest { |
| /// The contents of the original request that was passed to |
| /// `[Streaming]DetectIntent` call. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2OriginalDetectIntentRequest? |
| originalDetectIntentRequest; |
| |
| /// The result of the conversational query or event processing. |
| /// |
| /// Contains the same value as `[Streaming]DetectIntentResponse.query_result`. |
| GoogleCloudDialogflowV2QueryResult? queryResult; |
| |
| /// The unique identifier of the response. |
| /// |
| /// Contains the same value as `[Streaming]DetectIntentResponse.response_id`. |
| core.String? responseId; |
| |
| /// The unique identifier of detectIntent request session. |
| /// |
| /// Can be used to identify end-user inside webhook implementation. Format: |
| /// `projects//agent/sessions/`, or |
| /// `projects//agent/environments//users//sessions/`. |
| core.String? session; |
| |
| GoogleCloudDialogflowV2WebhookRequest({ |
| this.originalDetectIntentRequest, |
| this.queryResult, |
| this.responseId, |
| this.session, |
| }); |
| |
| GoogleCloudDialogflowV2WebhookRequest.fromJson(core.Map _json) |
| : this( |
| originalDetectIntentRequest: |
| _json.containsKey('originalDetectIntentRequest') |
| ? GoogleCloudDialogflowV2OriginalDetectIntentRequest.fromJson( |
| _json['originalDetectIntentRequest'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| queryResult: _json.containsKey('queryResult') |
| ? GoogleCloudDialogflowV2QueryResult.fromJson( |
| _json['queryResult'] as core.Map<core.String, core.dynamic>) |
| : null, |
| responseId: _json.containsKey('responseId') |
| ? _json['responseId'] as core.String |
| : null, |
| session: _json.containsKey('session') |
| ? _json['session'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (originalDetectIntentRequest != null) |
| 'originalDetectIntentRequest': originalDetectIntentRequest!.toJson(), |
| if (queryResult != null) 'queryResult': queryResult!.toJson(), |
| if (responseId != null) 'responseId': responseId!, |
| if (session != null) 'session': session!, |
| }; |
| } |
| |
| /// The response message for a webhook call. |
| /// |
| /// This response is validated by the Dialogflow server. If validation fails, an |
| /// error will be returned in the QueryResult.diagnostic_info field. Setting |
| /// JSON fields to an empty value with the wrong type is a common error. To |
| /// avoid this error: - Use `""` for empty strings - Use `{}` or `null` for |
| /// empty objects - Use `[]` or `null` for empty arrays For more information, |
| /// see the |
| /// [Protocol Buffers Language Guide](https://developers.google.com/protocol-buffers/docs/proto3#json). |
| class GoogleCloudDialogflowV2WebhookResponse { |
| /// Invokes the supplied events. |
| /// |
| /// When this field is set, Dialogflow ignores the `fulfillment_text`, |
| /// `fulfillment_messages`, and `payload` fields. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2EventInput? followupEventInput; |
| |
| /// The rich response messages intended for the end-user. |
| /// |
| /// When provided, Dialogflow uses this field to populate |
| /// QueryResult.fulfillment_messages sent to the integration or API caller. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2IntentMessage>? fulfillmentMessages; |
| |
| /// The text response message intended for the end-user. |
| /// |
| /// It is recommended to use `fulfillment_messages.text.text[0]` instead. When |
| /// provided, Dialogflow uses this field to populate |
| /// QueryResult.fulfillment_text sent to the integration or API caller. |
| /// |
| /// Optional. |
| core.String? fulfillmentText; |
| |
| /// The collection of output contexts that will overwrite currently active |
| /// contexts for the session and reset their lifespans. |
| /// |
| /// When provided, Dialogflow uses this field to populate |
| /// QueryResult.output_contexts sent to the integration or API caller. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2Context>? outputContexts; |
| |
| /// This field can be used to pass custom data from your webhook to the |
| /// integration or API caller. |
| /// |
| /// Arbitrary JSON objects are supported. When provided, Dialogflow uses this |
| /// field to populate QueryResult.webhook_payload sent to the integration or |
| /// API caller. This field is also used by the |
| /// [Google Assistant integration](https://cloud.google.com/dialogflow/docs/integrations/aog) |
| /// for rich response messages. See the format definition at |
| /// [Google Assistant Dialogflow webhook format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) |
| /// |
| /// Optional. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? payload; |
| |
| /// Additional session entity types to replace or extend developer entity |
| /// types with. |
| /// |
| /// The entity synonyms apply to all languages and persist for the session. |
| /// Setting this data from a webhook overwrites the session entity types that |
| /// have been set using `detectIntent`, `streamingDetectIntent` or |
| /// SessionEntityType management methods. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2SessionEntityType>? sessionEntityTypes; |
| |
| /// A custom field used to identify the webhook source. |
| /// |
| /// Arbitrary strings are supported. When provided, Dialogflow uses this field |
| /// to populate QueryResult.webhook_source sent to the integration or API |
| /// caller. |
| /// |
| /// Optional. |
| core.String? source; |
| |
| GoogleCloudDialogflowV2WebhookResponse({ |
| this.followupEventInput, |
| this.fulfillmentMessages, |
| this.fulfillmentText, |
| this.outputContexts, |
| this.payload, |
| this.sessionEntityTypes, |
| this.source, |
| }); |
| |
| GoogleCloudDialogflowV2WebhookResponse.fromJson(core.Map _json) |
| : this( |
| followupEventInput: _json.containsKey('followupEventInput') |
| ? GoogleCloudDialogflowV2EventInput.fromJson( |
| _json['followupEventInput'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| fulfillmentMessages: _json.containsKey('fulfillmentMessages') |
| ? (_json['fulfillmentMessages'] as core.List) |
| .map<GoogleCloudDialogflowV2IntentMessage>((value) => |
| GoogleCloudDialogflowV2IntentMessage.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| fulfillmentText: _json.containsKey('fulfillmentText') |
| ? _json['fulfillmentText'] as core.String |
| : null, |
| outputContexts: _json.containsKey('outputContexts') |
| ? (_json['outputContexts'] as core.List) |
| .map<GoogleCloudDialogflowV2Context>((value) => |
| GoogleCloudDialogflowV2Context.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| payload: _json.containsKey('payload') |
| ? (_json['payload'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| sessionEntityTypes: _json.containsKey('sessionEntityTypes') |
| ? (_json['sessionEntityTypes'] as core.List) |
| .map<GoogleCloudDialogflowV2SessionEntityType>((value) => |
| GoogleCloudDialogflowV2SessionEntityType.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| source: _json.containsKey('source') |
| ? _json['source'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (followupEventInput != null) |
| 'followupEventInput': followupEventInput!.toJson(), |
| if (fulfillmentMessages != null) |
| 'fulfillmentMessages': |
| fulfillmentMessages!.map((value) => value.toJson()).toList(), |
| if (fulfillmentText != null) 'fulfillmentText': fulfillmentText!, |
| if (outputContexts != null) |
| 'outputContexts': |
| outputContexts!.map((value) => value.toJson()).toList(), |
| if (payload != null) 'payload': payload!, |
| if (sessionEntityTypes != null) |
| 'sessionEntityTypes': |
| sessionEntityTypes!.map((value) => value.toJson()).toList(), |
| if (source != null) 'source': source!, |
| }; |
| } |
| |
| /// Represents a part of a message possibly annotated with an entity. |
| /// |
| /// The part can be an entity or purely a part of the message between two |
| /// entities or message start/end. |
| class GoogleCloudDialogflowV2beta1AnnotatedMessagePart { |
| /// The |
| /// [Dialogflow system entity type](https://cloud.google.com/dialogflow/docs/reference/system-entities) |
| /// of this message part. |
| /// |
| /// If this is empty, Dialogflow could not annotate the phrase part with a |
| /// system entity. |
| /// |
| /// Optional. |
| core.String? entityType; |
| |
| /// The |
| /// [Dialogflow system entity formatted value ](https://cloud.google.com/dialogflow/docs/reference/system-entities) |
| /// of this message part. |
| /// |
| /// For example for a system entity of type `@sys.unit-currency`, this may |
| /// contain: { "amount": 5, "currency": "USD" } |
| /// |
| /// Optional. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Object? formattedValue; |
| |
| /// A part of a message possibly annotated with an entity. |
| /// |
| /// Required. |
| core.String? text; |
| |
| GoogleCloudDialogflowV2beta1AnnotatedMessagePart({ |
| this.entityType, |
| this.formattedValue, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowV2beta1AnnotatedMessagePart.fromJson(core.Map _json) |
| : this( |
| entityType: _json.containsKey('entityType') |
| ? _json['entityType'] as core.String |
| : null, |
| formattedValue: _json.containsKey('formattedValue') |
| ? _json['formattedValue'] as core.Object |
| : null, |
| text: _json.containsKey('text') ? _json['text'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (entityType != null) 'entityType': entityType!, |
| if (formattedValue != null) 'formattedValue': formattedValue!, |
| if (text != null) 'text': text!, |
| }; |
| } |
| |
| /// Represents article answer. |
| class GoogleCloudDialogflowV2beta1ArticleAnswer { |
| /// The name of answer record, in the format of |
| /// "projects//locations//answerRecords/" |
| core.String? answerRecord; |
| |
| /// A map that contains metadata about the answer and the document from which |
| /// it originates. |
| core.Map<core.String, core.String>? metadata; |
| |
| /// Article snippets. |
| /// |
| /// Output only. |
| core.List<core.String>? snippets; |
| |
| /// The article title. |
| core.String? title; |
| |
| /// The article URI. |
| core.String? uri; |
| |
| GoogleCloudDialogflowV2beta1ArticleAnswer({ |
| this.answerRecord, |
| this.metadata, |
| this.snippets, |
| this.title, |
| this.uri, |
| }); |
| |
| GoogleCloudDialogflowV2beta1ArticleAnswer.fromJson(core.Map _json) |
| : this( |
| answerRecord: _json.containsKey('answerRecord') |
| ? _json['answerRecord'] as core.String |
| : null, |
| metadata: _json.containsKey('metadata') |
| ? (_json['metadata'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.String, |
| ), |
| ) |
| : null, |
| snippets: _json.containsKey('snippets') |
| ? (_json['snippets'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| uri: _json.containsKey('uri') ? _json['uri'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (answerRecord != null) 'answerRecord': answerRecord!, |
| if (metadata != null) 'metadata': metadata!, |
| if (snippets != null) 'snippets': snippets!, |
| if (title != null) 'title': title!, |
| if (uri != null) 'uri': uri!, |
| }; |
| } |
| |
| /// The response message for EntityTypes.BatchUpdateEntityTypes. |
| class GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse { |
| /// The collection of updated or created entity types. |
| core.List<GoogleCloudDialogflowV2beta1EntityType>? entityTypes; |
| |
| GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse({ |
| this.entityTypes, |
| }); |
| |
| GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse.fromJson( |
| core.Map _json) |
| : this( |
| entityTypes: _json.containsKey('entityTypes') |
| ? (_json['entityTypes'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1EntityType>((value) => |
| GoogleCloudDialogflowV2beta1EntityType.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (entityTypes != null) |
| 'entityTypes': entityTypes!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// The response message for Intents.BatchUpdateIntents. |
| class GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse { |
| /// The collection of updated or created intents. |
| core.List<GoogleCloudDialogflowV2beta1Intent>? intents; |
| |
| GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse({ |
| this.intents, |
| }); |
| |
| GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse.fromJson( |
| core.Map _json) |
| : this( |
| intents: _json.containsKey('intents') |
| ? (_json['intents'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1Intent>((value) => |
| GoogleCloudDialogflowV2beta1Intent.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (intents != null) |
| 'intents': intents!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Dialogflow contexts are similar to natural language context. |
| /// |
| /// If a person says to you "they are orange", you need context in order to |
| /// understand what "they" is referring to. Similarly, for Dialogflow to handle |
| /// an end-user expression like that, it needs to be provided with context in |
| /// order to correctly match an intent. Using contexts, you can control the flow |
| /// of a conversation. You can configure contexts for an intent by setting input |
| /// and output contexts, which are identified by string names. When an intent is |
| /// matched, any configured output contexts for that intent become active. While |
| /// any contexts are active, Dialogflow is more likely to match intents that are |
| /// configured with input contexts that correspond to the currently active |
| /// contexts. For more information about context, see the |
| /// [Contexts guide](https://cloud.google.com/dialogflow/docs/contexts-overview). |
| class GoogleCloudDialogflowV2beta1Context { |
| /// The number of conversational query requests after which the context |
| /// expires. |
| /// |
| /// The default is `0`. If set to `0`, the context expires immediately. |
| /// Contexts expire automatically after 20 minutes if there are no matching |
| /// queries. |
| /// |
| /// Optional. |
| core.int? lifespanCount; |
| |
| /// The unique identifier of the context. |
| /// |
| /// Supported formats: - `projects//agent/sessions//contexts/`, - |
| /// `projects//locations//agent/sessions//contexts/`, - |
| /// `projects//agent/environments//users//sessions//contexts/`, - |
| /// `projects//locations//agent/environments//users//sessions//contexts/`, The |
| /// `Context ID` is always converted to lowercase, may only contain characters |
| /// in a-zA-Z0-9_-% and may be at most 250 bytes long. If `Environment ID` is |
| /// not specified, we assume default 'draft' environment. If `User ID` is not |
| /// specified, we assume default '-' user. The following context names are |
| /// reserved for internal use by Dialogflow. You should not use these contexts |
| /// or create contexts with these names: * `__system_counters__` * |
| /// `*_id_dialog_context` * `*_dialog_params_size` |
| /// |
| /// Required. |
| core.String? name; |
| |
| /// The collection of parameters associated with this context. |
| /// |
| /// Depending on your protocol or client library language, this is a map, |
| /// associative array, symbol table, dictionary, or JSON object composed of a |
| /// collection of (MapKey, MapValue) pairs: - MapKey type: string - MapKey |
| /// value: parameter name - MapValue type: - If parameter's entity type is a |
| /// composite entity: map - Else: depending on parameter value type, could be |
| /// one of string, number, boolean, null, list or map - MapValue value: - If |
| /// parameter's entity type is a composite entity: map from composite entity |
| /// property names to property values - Else: parameter value |
| /// |
| /// Optional. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? parameters; |
| |
| GoogleCloudDialogflowV2beta1Context({ |
| this.lifespanCount, |
| this.name, |
| this.parameters, |
| }); |
| |
| GoogleCloudDialogflowV2beta1Context.fromJson(core.Map _json) |
| : this( |
| lifespanCount: _json.containsKey('lifespanCount') |
| ? _json['lifespanCount'] as core.int |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| parameters: _json.containsKey('parameters') |
| ? (_json['parameters'] as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (lifespanCount != null) 'lifespanCount': lifespanCount!, |
| if (name != null) 'name': name!, |
| if (parameters != null) 'parameters': parameters!, |
| }; |
| } |
| |
| /// Represents a notification sent to Pub/Sub subscribers for conversation |
| /// lifecycle events. |
| class GoogleCloudDialogflowV2beta1ConversationEvent { |
| /// The unique identifier of the conversation this notification refers to. |
| /// |
| /// Format: `projects//conversations/`. |
| /// |
| /// Required. |
| core.String? conversation; |
| |
| /// More detailed information about an error. |
| /// |
| /// Only set for type UNRECOVERABLE_ERROR_IN_PHONE_CALL. |
| /// |
| /// Optional. |
| GoogleRpcStatus? errorStatus; |
| |
| /// Payload of NEW_MESSAGE event. |
| GoogleCloudDialogflowV2beta1Message? newMessagePayload; |
| |
| /// The type of the event that this notification refers to. |
| /// |
| /// Required. |
| /// Possible string values are: |
| /// - "TYPE_UNSPECIFIED" : Type not set. |
| /// - "CONVERSATION_STARTED" : A new conversation has been opened. This is |
| /// fired when a telephone call is answered, or a conversation is created via |
| /// the API. |
| /// - "CONVERSATION_FINISHED" : An existing conversation has closed. This is |
| /// fired when a telephone call is terminated, or a conversation is closed via |
| /// the API. |
| /// - "NEW_MESSAGE" : An existing conversation has received a new message, |
| /// either from API or telephony. It is configured in |
| /// ConversationProfile.new_message_event_notification_config |
| /// - "UNRECOVERABLE_ERROR" : Unrecoverable error during a telephone call. In |
| /// general non-recoverable errors only occur if something was misconfigured |
| /// in the ConversationProfile corresponding to the call. After a |
| /// non-recoverable error, Dialogflow may stop responding. We don't fire this |
| /// event: * in an API call because we can directly return the error, or, * |
| /// when we can recover from an error. |
| core.String? type; |
| |
| GoogleCloudDialogflowV2beta1ConversationEvent({ |
| this.conversation, |
| this.errorStatus, |
| this.newMessagePayload, |
| this.type, |
| }); |
| |
| GoogleCloudDialogflowV2beta1ConversationEvent.fromJson(core.Map _json) |
| : this( |
| conversation: _json.containsKey('conversation') |
| ? _json['conversation'] as core.String |
| : null, |
| errorStatus: _json.containsKey('errorStatus') |
| ? GoogleRpcStatus.fromJson( |
| _json['errorStatus'] as core.Map<core.String, core.dynamic>) |
| : null, |
| newMessagePayload: _json.containsKey('newMessagePayload') |
| ? GoogleCloudDialogflowV2beta1Message.fromJson( |
| _json['newMessagePayload'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| type: _json.containsKey('type') ? _json['type'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (conversation != null) 'conversation': conversation!, |
| if (errorStatus != null) 'errorStatus': errorStatus!.toJson(), |
| if (newMessagePayload != null) |
| 'newMessagePayload': newMessagePayload!.toJson(), |
| if (type != null) 'type': type!, |
| }; |
| } |
| |
| /// Each intent parameter has a type, called the entity type, which dictates |
| /// exactly how data from an end-user expression is extracted. |
| /// |
| /// Dialogflow provides predefined system entities that can match many common |
| /// types of data. For example, there are system entities for matching dates, |
| /// times, colors, email addresses, and so on. You can also create your own |
| /// custom entities for matching custom data. For example, you could define a |
| /// vegetable entity that can match the types of vegetables available for |
| /// purchase with a grocery store agent. For more information, see the |
| /// [Entity guide](https://cloud.google.com/dialogflow/docs/entities-overview). |
| class GoogleCloudDialogflowV2beta1EntityType { |
| /// Indicates whether the entity type can be automatically expanded. |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "AUTO_EXPANSION_MODE_UNSPECIFIED" : Auto expansion disabled for the |
| /// entity. |
| /// - "AUTO_EXPANSION_MODE_DEFAULT" : Allows an agent to recognize values that |
| /// have not been explicitly listed in the entity. |
| core.String? autoExpansionMode; |
| |
| /// The name of the entity type. |
| /// |
| /// Required. |
| core.String? displayName; |
| |
| /// Enables fuzzy entity extraction during classification. |
| /// |
| /// Optional. |
| core.bool? enableFuzzyExtraction; |
| |
| /// The collection of entity entries associated with the entity type. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2beta1EntityTypeEntity>? entities; |
| |
| /// Indicates the kind of entity type. |
| /// |
| /// Required. |
| /// Possible string values are: |
| /// - "KIND_UNSPECIFIED" : Not specified. This value should be never used. |
| /// - "KIND_MAP" : Map entity types allow mapping of a group of synonyms to a |
| /// reference value. |
| /// - "KIND_LIST" : List entity types contain a set of entries that do not map |
| /// to reference values. However, list entity types can contain references to |
| /// other entity types (with or without aliases). |
| /// - "KIND_REGEXP" : Regexp entity types allow to specify regular expressions |
| /// in entries values. |
| core.String? kind; |
| |
| /// The unique identifier of the entity type. |
| /// |
| /// Required for EntityTypes.UpdateEntityType and |
| /// EntityTypes.BatchUpdateEntityTypes methods. Supported formats: - |
| /// `projects//agent/entityTypes/` - `projects//locations//agent/entityTypes/` |
| core.String? name; |
| |
| GoogleCloudDialogflowV2beta1EntityType({ |
| this.autoExpansionMode, |
| this.displayName, |
| this.enableFuzzyExtraction, |
| this.entities, |
| this.kind, |
| this.name, |
| }); |
| |
| GoogleCloudDialogflowV2beta1EntityType.fromJson(core.Map _json) |
| : this( |
| autoExpansionMode: _json.containsKey('autoExpansionMode') |
| ? _json['autoExpansionMode'] as core.String |
| : null, |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| enableFuzzyExtraction: _json.containsKey('enableFuzzyExtraction') |
| ? _json['enableFuzzyExtraction'] as core.bool |
| : null, |
| entities: _json.containsKey('entities') |
| ? (_json['entities'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1EntityTypeEntity>((value) => |
| GoogleCloudDialogflowV2beta1EntityTypeEntity.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| kind: _json.containsKey('kind') ? _json['kind'] as core.String : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (autoExpansionMode != null) 'autoExpansionMode': autoExpansionMode!, |
| if (displayName != null) 'displayName': displayName!, |
| if (enableFuzzyExtraction != null) |
| 'enableFuzzyExtraction': enableFuzzyExtraction!, |
| if (entities != null) |
| 'entities': entities!.map((value) => value.toJson()).toList(), |
| if (kind != null) 'kind': kind!, |
| if (name != null) 'name': name!, |
| }; |
| } |
| |
| /// An **entity entry** for an associated entity type. |
| class GoogleCloudDialogflowV2beta1EntityTypeEntity { |
| /// A collection of value synonyms. |
| /// |
| /// For example, if the entity type is *vegetable*, and `value` is |
| /// *scallions*, a synonym could be *green onions*. For `KIND_LIST` entity |
| /// types: * This collection must contain exactly one synonym equal to |
| /// `value`. |
| /// |
| /// Required. |
| core.List<core.String>? synonyms; |
| |
| /// The primary value associated with this entity entry. |
| /// |
| /// For example, if the entity type is *vegetable*, the value could be |
| /// *scallions*. For `KIND_MAP` entity types: * A reference value to be used |
| /// in place of synonyms. For `KIND_LIST` entity types: * A string that can |
| /// contain references to other entity types (with or without aliases). |
| /// |
| /// Required. |
| core.String? value; |
| |
| GoogleCloudDialogflowV2beta1EntityTypeEntity({ |
| this.synonyms, |
| this.value, |
| }); |
| |
| GoogleCloudDialogflowV2beta1EntityTypeEntity.fromJson(core.Map _json) |
| : this( |
| synonyms: _json.containsKey('synonyms') |
| ? (_json['synonyms'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| value: |
| _json.containsKey('value') ? _json['value'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (synonyms != null) 'synonyms': synonyms!, |
| if (value != null) 'value': value!, |
| }; |
| } |
| |
| /// Events allow for matching intents by event name instead of the natural |
| /// language input. |
| /// |
| /// For instance, input `` can trigger a personalized welcome response. The |
| /// parameter `name` may be used by the agent in the response: `"Hello |
| /// #welcome_event.name! What can I do for you today?"`. |
| class GoogleCloudDialogflowV2beta1EventInput { |
| /// The language of this query. |
| /// |
| /// See |
| /// [Language Support](https://cloud.google.com/dialogflow/docs/reference/language) |
| /// for a list of the currently supported language codes. Note that queries in |
| /// the same session do not necessarily need to specify the same language. |
| /// |
| /// Required. |
| core.String? languageCode; |
| |
| /// The unique identifier of the event. |
| /// |
| /// Required. |
| core.String? name; |
| |
| /// The collection of parameters associated with the event. |
| /// |
| /// Depending on your protocol or client library language, this is a map, |
| /// associative array, symbol table, dictionary, or JSON object composed of a |
| /// collection of (MapKey, MapValue) pairs: - MapKey type: string - MapKey |
| /// value: parameter name - MapValue type: - If parameter's entity type is a |
| /// composite entity: map - Else: depending on parameter value type, could be |
| /// one of string, number, boolean, null, list or map - MapValue value: - If |
| /// parameter's entity type is a composite entity: map from composite entity |
| /// property names to property values - Else: parameter value |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? parameters; |
| |
| GoogleCloudDialogflowV2beta1EventInput({ |
| this.languageCode, |
| this.name, |
| this.parameters, |
| }); |
| |
| GoogleCloudDialogflowV2beta1EventInput.fromJson(core.Map _json) |
| : this( |
| languageCode: _json.containsKey('languageCode') |
| ? _json['languageCode'] as core.String |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| parameters: _json.containsKey('parameters') |
| ? (_json['parameters'] as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (languageCode != null) 'languageCode': languageCode!, |
| if (name != null) 'name': name!, |
| if (parameters != null) 'parameters': parameters!, |
| }; |
| } |
| |
| /// The response message for Agents.ExportAgent. |
| class GoogleCloudDialogflowV2beta1ExportAgentResponse { |
| /// Zip compressed raw byte content for agent. |
| core.String? agentContent; |
| core.List<core.int> get agentContentAsBytes => |
| convert.base64.decode(agentContent!); |
| |
| set agentContentAsBytes(core.List<core.int> _bytes) { |
| agentContent = |
| convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); |
| } |
| |
| /// The URI to a file containing the exported agent. |
| /// |
| /// This field is populated only if `agent_uri` is specified in |
| /// `ExportAgentRequest`. |
| core.String? agentUri; |
| |
| GoogleCloudDialogflowV2beta1ExportAgentResponse({ |
| this.agentContent, |
| this.agentUri, |
| }); |
| |
| GoogleCloudDialogflowV2beta1ExportAgentResponse.fromJson(core.Map _json) |
| : this( |
| agentContent: _json.containsKey('agentContent') |
| ? _json['agentContent'] as core.String |
| : null, |
| agentUri: _json.containsKey('agentUri') |
| ? _json['agentUri'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (agentContent != null) 'agentContent': agentContent!, |
| if (agentUri != null) 'agentUri': agentUri!, |
| }; |
| } |
| |
| /// Represents answer from "frequently asked questions". |
| class GoogleCloudDialogflowV2beta1FaqAnswer { |
| /// The piece of text from the `source` knowledge base document. |
| core.String? answer; |
| |
| /// The name of answer record, in the format of |
| /// "projects//locations//answerRecords/" |
| core.String? answerRecord; |
| |
| /// The system's confidence score that this Knowledge answer is a good match |
| /// for this conversational query, range from 0.0 (completely uncertain) to |
| /// 1.0 (completely certain). |
| core.double? confidence; |
| |
| /// A map that contains metadata about the answer and the document from which |
| /// it originates. |
| core.Map<core.String, core.String>? metadata; |
| |
| /// The corresponding FAQ question. |
| core.String? question; |
| |
| /// Indicates which Knowledge Document this answer was extracted from. |
| /// |
| /// Format: `projects//locations//agent/knowledgeBases//documents/`. |
| core.String? source; |
| |
| GoogleCloudDialogflowV2beta1FaqAnswer({ |
| this.answer, |
| this.answerRecord, |
| this.confidence, |
| this.metadata, |
| this.question, |
| this.source, |
| }); |
| |
| GoogleCloudDialogflowV2beta1FaqAnswer.fromJson(core.Map _json) |
| : this( |
| answer: _json.containsKey('answer') |
| ? _json['answer'] as core.String |
| : null, |
| answerRecord: _json.containsKey('answerRecord') |
| ? _json['answerRecord'] as core.String |
| : null, |
| confidence: _json.containsKey('confidence') |
| ? (_json['confidence'] as core.num).toDouble() |
| : null, |
| metadata: _json.containsKey('metadata') |
| ? (_json['metadata'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.String, |
| ), |
| ) |
| : null, |
| question: _json.containsKey('question') |
| ? _json['question'] as core.String |
| : null, |
| source: _json.containsKey('source') |
| ? _json['source'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (answer != null) 'answer': answer!, |
| if (answerRecord != null) 'answerRecord': answerRecord!, |
| if (confidence != null) 'confidence': confidence!, |
| if (metadata != null) 'metadata': metadata!, |
| if (question != null) 'question': question!, |
| if (source != null) 'source': source!, |
| }; |
| } |
| |
| /// Represents a notification sent to Pub/Sub subscribers for agent assistant |
| /// events in a specific conversation. |
| /// |
| /// Output only. |
| class GoogleCloudDialogflowV2beta1HumanAgentAssistantEvent { |
| /// The conversation this notification refers to. |
| /// |
| /// Format: `projects//conversations/`. |
| core.String? conversation; |
| |
| /// The participant that the suggestion is compiled for. |
| /// |
| /// And This field is used to call Participants.ListSuggestions API. Format: |
| /// `projects//conversations//participants/`. It will not be set in legacy |
| /// workflow. HumanAgentAssistantConfig.name for more information. |
| core.String? participant; |
| |
| /// The suggestion results payload that this notification refers to. |
| /// |
| /// It will only be set when |
| /// HumanAgentAssistantConfig.SuggestionConfig.group_suggestion_responses sets |
| /// to true. |
| core.List<GoogleCloudDialogflowV2beta1SuggestionResult>? suggestionResults; |
| |
| GoogleCloudDialogflowV2beta1HumanAgentAssistantEvent({ |
| this.conversation, |
| this.participant, |
| this.suggestionResults, |
| }); |
| |
| GoogleCloudDialogflowV2beta1HumanAgentAssistantEvent.fromJson(core.Map _json) |
| : this( |
| conversation: _json.containsKey('conversation') |
| ? _json['conversation'] as core.String |
| : null, |
| participant: _json.containsKey('participant') |
| ? _json['participant'] as core.String |
| : null, |
| suggestionResults: _json.containsKey('suggestionResults') |
| ? (_json['suggestionResults'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1SuggestionResult>((value) => |
| GoogleCloudDialogflowV2beta1SuggestionResult.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (conversation != null) 'conversation': conversation!, |
| if (participant != null) 'participant': participant!, |
| if (suggestionResults != null) |
| 'suggestionResults': |
| suggestionResults!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Response message for Documents.ImportDocuments. |
| class GoogleCloudDialogflowV2beta1ImportDocumentsResponse { |
| /// Includes details about skipped documents or any other warnings. |
| core.List<GoogleRpcStatus>? warnings; |
| |
| GoogleCloudDialogflowV2beta1ImportDocumentsResponse({ |
| this.warnings, |
| }); |
| |
| GoogleCloudDialogflowV2beta1ImportDocumentsResponse.fromJson(core.Map _json) |
| : this( |
| warnings: _json.containsKey('warnings') |
| ? (_json['warnings'] as core.List) |
| .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (warnings != null) |
| 'warnings': warnings!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// An intent categorizes an end-user's intention for one conversation turn. |
| /// |
| /// For each agent, you define many intents, where your combined intents can |
| /// handle a complete conversation. When an end-user writes or says something, |
| /// referred to as an end-user expression or end-user input, Dialogflow matches |
| /// the end-user input to the best intent in your agent. Matching an intent is |
| /// also known as intent classification. For more information, see the |
| /// [intent guide](https://cloud.google.com/dialogflow/docs/intents-overview). |
| class GoogleCloudDialogflowV2beta1Intent { |
| /// The name of the action associated with the intent. |
| /// |
| /// Note: The action name must not contain whitespaces. |
| /// |
| /// Optional. |
| core.String? action; |
| |
| /// The list of platforms for which the first responses will be copied from |
| /// the messages in PLATFORM_UNSPECIFIED (i.e. default platform). |
| /// |
| /// Optional. |
| core.List<core.String>? defaultResponsePlatforms; |
| |
| /// The name of this intent. |
| /// |
| /// Required. |
| core.String? displayName; |
| |
| /// Indicates that this intent ends an interaction. |
| /// |
| /// Some integrations (e.g., Actions on Google or Dialogflow phone gateway) |
| /// use this information to close interaction with an end user. Default is |
| /// false. |
| /// |
| /// Optional. |
| core.bool? endInteraction; |
| |
| /// The collection of event names that trigger the intent. |
| /// |
| /// If the collection of input contexts is not empty, all of the contexts must |
| /// be present in the active user session for an event to trigger this intent. |
| /// Event names are limited to 150 characters. |
| /// |
| /// Optional. |
| core.List<core.String>? events; |
| |
| /// Information about all followup intents that have this intent as a direct |
| /// or indirect parent. |
| /// |
| /// We populate this field only in the output. |
| /// |
| /// Output only. |
| core.List<GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo>? |
| followupIntentInfo; |
| |
| /// The list of context names required for this intent to be triggered. |
| /// |
| /// Formats: - `projects//agent/sessions/-/contexts/` - |
| /// `projects//locations//agent/sessions/-/contexts/` |
| /// |
| /// Optional. |
| core.List<core.String>? inputContextNames; |
| |
| /// Indicates whether this is a fallback intent. |
| /// |
| /// Optional. |
| core.bool? isFallback; |
| |
| /// Indicates that a live agent should be brought in to handle the interaction |
| /// with the user. |
| /// |
| /// In most cases, when you set this flag to true, you would also want to set |
| /// end_interaction to true as well. Default is false. |
| /// |
| /// Optional. |
| core.bool? liveAgentHandoff; |
| |
| /// The collection of rich messages corresponding to the `Response` field in |
| /// the Dialogflow console. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2beta1IntentMessage>? messages; |
| |
| /// Indicates whether Machine Learning is disabled for the intent. |
| /// |
| /// Note: If `ml_disabled` setting is set to true, then this intent is not |
| /// taken into account during inference in `ML ONLY` match mode. Also, |
| /// auto-markup in the UI is turned off. |
| /// |
| /// Optional. |
| core.bool? mlDisabled; |
| |
| /// Indicates whether Machine Learning is enabled for the intent. |
| /// |
| /// Note: If `ml_enabled` setting is set to false, then this intent is not |
| /// taken into account during inference in `ML ONLY` match mode. Also, |
| /// auto-markup in the UI is turned off. DEPRECATED! Please use `ml_disabled` |
| /// field instead. NOTE: If both `ml_enabled` and `ml_disabled` are either not |
| /// set or false, then the default value is determined as follows: - Before |
| /// April 15th, 2018 the default is: ml_enabled = false / ml_disabled = true. |
| /// - After April 15th, 2018 the default is: ml_enabled = true / ml_disabled = |
| /// false. |
| /// |
| /// Optional. |
| core.bool? mlEnabled; |
| |
| /// The unique identifier of this intent. |
| /// |
| /// Required for Intents.UpdateIntent and Intents.BatchUpdateIntents methods. |
| /// Supported formats: - `projects//agent/intents/` - |
| /// `projects//locations//agent/intents/` |
| /// |
| /// Optional. |
| core.String? name; |
| |
| /// The collection of contexts that are activated when the intent is matched. |
| /// |
| /// Context messages in this collection should not set the parameters field. |
| /// Setting the `lifespan_count` to 0 will reset the context when the intent |
| /// is matched. Format: `projects//agent/sessions/-/contexts/`. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2beta1Context>? outputContexts; |
| |
| /// The collection of parameters associated with the intent. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2beta1IntentParameter>? parameters; |
| |
| /// The unique identifier of the parent intent in the chain of followup |
| /// intents. |
| /// |
| /// You can set this field when creating an intent, for example with |
| /// CreateIntent or BatchUpdateIntents, in order to make this intent a |
| /// followup intent. It identifies the parent followup intent. Format: |
| /// `projects//agent/intents/`. |
| /// |
| /// Optional. |
| core.String? parentFollowupIntentName; |
| |
| /// The priority of this intent. |
| /// |
| /// Higher numbers represent higher priorities. - If the supplied value is |
| /// unspecified or 0, the service translates the value to 500,000, which |
| /// corresponds to the `Normal` priority in the console. - If the supplied |
| /// value is negative, the intent is ignored in runtime detect intent |
| /// requests. |
| /// |
| /// Optional. |
| core.int? priority; |
| |
| /// Indicates whether to delete all contexts in the current session when this |
| /// intent is matched. |
| /// |
| /// Optional. |
| core.bool? resetContexts; |
| |
| /// The unique identifier of the root intent in the chain of followup intents. |
| /// |
| /// It identifies the correct followup intents chain for this intent. Format: |
| /// `projects//agent/intents/`. |
| /// |
| /// Output only. |
| core.String? rootFollowupIntentName; |
| |
| /// The collection of examples that the agent is trained on. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2beta1IntentTrainingPhrase>? trainingPhrases; |
| |
| /// Indicates whether webhooks are enabled for the intent. |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "WEBHOOK_STATE_UNSPECIFIED" : Webhook is disabled in the agent and in |
| /// the intent. |
| /// - "WEBHOOK_STATE_ENABLED" : Webhook is enabled in the agent and in the |
| /// intent. |
| /// - "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING" : Webhook is enabled in the |
| /// agent and in the intent. Also, each slot filling prompt is forwarded to |
| /// the webhook. |
| core.String? webhookState; |
| |
| GoogleCloudDialogflowV2beta1Intent({ |
| this.action, |
| this.defaultResponsePlatforms, |
| this.displayName, |
| this.endInteraction, |
| this.events, |
| this.followupIntentInfo, |
| this.inputContextNames, |
| this.isFallback, |
| this.liveAgentHandoff, |
| this.messages, |
| this.mlDisabled, |
| this.mlEnabled, |
| this.name, |
| this.outputContexts, |
| this.parameters, |
| this.parentFollowupIntentName, |
| this.priority, |
| this.resetContexts, |
| this.rootFollowupIntentName, |
| this.trainingPhrases, |
| this.webhookState, |
| }); |
| |
| GoogleCloudDialogflowV2beta1Intent.fromJson(core.Map _json) |
| : this( |
| action: _json.containsKey('action') |
| ? _json['action'] as core.String |
| : null, |
| defaultResponsePlatforms: |
| _json.containsKey('defaultResponsePlatforms') |
| ? (_json['defaultResponsePlatforms'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| endInteraction: _json.containsKey('endInteraction') |
| ? _json['endInteraction'] as core.bool |
| : null, |
| events: _json.containsKey('events') |
| ? (_json['events'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| followupIntentInfo: _json.containsKey('followupIntentInfo') |
| ? (_json['followupIntentInfo'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo>( |
| (value) => |
| GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| inputContextNames: _json.containsKey('inputContextNames') |
| ? (_json['inputContextNames'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| isFallback: _json.containsKey('isFallback') |
| ? _json['isFallback'] as core.bool |
| : null, |
| liveAgentHandoff: _json.containsKey('liveAgentHandoff') |
| ? _json['liveAgentHandoff'] as core.bool |
| : null, |
| messages: _json.containsKey('messages') |
| ? (_json['messages'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentMessage>((value) => |
| GoogleCloudDialogflowV2beta1IntentMessage.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| mlDisabled: _json.containsKey('mlDisabled') |
| ? _json['mlDisabled'] as core.bool |
| : null, |
| mlEnabled: _json.containsKey('mlEnabled') |
| ? _json['mlEnabled'] as core.bool |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| outputContexts: _json.containsKey('outputContexts') |
| ? (_json['outputContexts'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1Context>((value) => |
| GoogleCloudDialogflowV2beta1Context.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| parameters: _json.containsKey('parameters') |
| ? (_json['parameters'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentParameter>((value) => |
| GoogleCloudDialogflowV2beta1IntentParameter.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| parentFollowupIntentName: |
| _json.containsKey('parentFollowupIntentName') |
| ? _json['parentFollowupIntentName'] as core.String |
| : null, |
| priority: _json.containsKey('priority') |
| ? _json['priority'] as core.int |
| : null, |
| resetContexts: _json.containsKey('resetContexts') |
| ? _json['resetContexts'] as core.bool |
| : null, |
| rootFollowupIntentName: _json.containsKey('rootFollowupIntentName') |
| ? _json['rootFollowupIntentName'] as core.String |
| : null, |
| trainingPhrases: _json.containsKey('trainingPhrases') |
| ? (_json['trainingPhrases'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentTrainingPhrase>( |
| (value) => |
| GoogleCloudDialogflowV2beta1IntentTrainingPhrase |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| webhookState: _json.containsKey('webhookState') |
| ? _json['webhookState'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (action != null) 'action': action!, |
| if (defaultResponsePlatforms != null) |
| 'defaultResponsePlatforms': defaultResponsePlatforms!, |
| if (displayName != null) 'displayName': displayName!, |
| if (endInteraction != null) 'endInteraction': endInteraction!, |
| if (events != null) 'events': events!, |
| if (followupIntentInfo != null) |
| 'followupIntentInfo': |
| followupIntentInfo!.map((value) => value.toJson()).toList(), |
| if (inputContextNames != null) 'inputContextNames': inputContextNames!, |
| if (isFallback != null) 'isFallback': isFallback!, |
| if (liveAgentHandoff != null) 'liveAgentHandoff': liveAgentHandoff!, |
| if (messages != null) |
| 'messages': messages!.map((value) => value.toJson()).toList(), |
| if (mlDisabled != null) 'mlDisabled': mlDisabled!, |
| if (mlEnabled != null) 'mlEnabled': mlEnabled!, |
| if (name != null) 'name': name!, |
| if (outputContexts != null) |
| 'outputContexts': |
| outputContexts!.map((value) => value.toJson()).toList(), |
| if (parameters != null) |
| 'parameters': parameters!.map((value) => value.toJson()).toList(), |
| if (parentFollowupIntentName != null) |
| 'parentFollowupIntentName': parentFollowupIntentName!, |
| if (priority != null) 'priority': priority!, |
| if (resetContexts != null) 'resetContexts': resetContexts!, |
| if (rootFollowupIntentName != null) |
| 'rootFollowupIntentName': rootFollowupIntentName!, |
| if (trainingPhrases != null) |
| 'trainingPhrases': |
| trainingPhrases!.map((value) => value.toJson()).toList(), |
| if (webhookState != null) 'webhookState': webhookState!, |
| }; |
| } |
| |
| /// Represents a single followup intent in the chain. |
| class GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo { |
| /// The unique identifier of the followup intent. |
| /// |
| /// Format: `projects//agent/intents/`. |
| core.String? followupIntentName; |
| |
| /// The unique identifier of the followup intent's parent. |
| /// |
| /// Format: `projects//agent/intents/`. |
| core.String? parentFollowupIntentName; |
| |
| GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo({ |
| this.followupIntentName, |
| this.parentFollowupIntentName, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo.fromJson(core.Map _json) |
| : this( |
| followupIntentName: _json.containsKey('followupIntentName') |
| ? _json['followupIntentName'] as core.String |
| : null, |
| parentFollowupIntentName: |
| _json.containsKey('parentFollowupIntentName') |
| ? _json['parentFollowupIntentName'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (followupIntentName != null) |
| 'followupIntentName': followupIntentName!, |
| if (parentFollowupIntentName != null) |
| 'parentFollowupIntentName': parentFollowupIntentName!, |
| }; |
| } |
| |
| /// Corresponds to the `Response` field in the Dialogflow console. |
| class GoogleCloudDialogflowV2beta1IntentMessage { |
| /// Displays a basic card for Actions on Google. |
| GoogleCloudDialogflowV2beta1IntentMessageBasicCard? basicCard; |
| |
| /// Browse carousel card for Actions on Google. |
| GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard? |
| browseCarouselCard; |
| |
| /// Displays a card. |
| GoogleCloudDialogflowV2beta1IntentMessageCard? card; |
| |
| /// Displays a carousel card for Actions on Google. |
| GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect? carouselSelect; |
| |
| /// Displays an image. |
| GoogleCloudDialogflowV2beta1IntentMessageImage? image; |
| |
| /// Displays a link out suggestion chip for Actions on Google. |
| GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion? linkOutSuggestion; |
| |
| /// Displays a list card for Actions on Google. |
| GoogleCloudDialogflowV2beta1IntentMessageListSelect? listSelect; |
| |
| /// The media content card for Actions on Google. |
| GoogleCloudDialogflowV2beta1IntentMessageMediaContent? mediaContent; |
| |
| /// A custom platform-specific response. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? payload; |
| |
| /// The platform that this message is intended for. |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "PLATFORM_UNSPECIFIED" : Not specified. |
| /// - "FACEBOOK" : Facebook. |
| /// - "SLACK" : Slack. |
| /// - "TELEGRAM" : Telegram. |
| /// - "KIK" : Kik. |
| /// - "SKYPE" : Skype. |
| /// - "LINE" : Line. |
| /// - "VIBER" : Viber. |
| /// - "ACTIONS_ON_GOOGLE" : Google Assistant See |
| /// [Dialogflow webhook format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) |
| /// - "TELEPHONY" : Telephony Gateway. |
| /// - "GOOGLE_HANGOUTS" : Google Hangouts. |
| core.String? platform; |
| |
| /// Displays quick replies. |
| GoogleCloudDialogflowV2beta1IntentMessageQuickReplies? quickReplies; |
| |
| /// Rich Business Messaging (RBM) carousel rich card response. |
| GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard? rbmCarouselRichCard; |
| |
| /// Standalone Rich Business Messaging (RBM) rich card response. |
| GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard? |
| rbmStandaloneRichCard; |
| |
| /// Rich Business Messaging (RBM) text response. |
| /// |
| /// RBM allows businesses to send enriched and branded versions of SMS. See |
| /// https://jibe.google.com/business-messaging. |
| GoogleCloudDialogflowV2beta1IntentMessageRbmText? rbmText; |
| |
| /// Returns a voice or text-only response for Actions on Google. |
| GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses? simpleResponses; |
| |
| /// Displays suggestion chips for Actions on Google. |
| GoogleCloudDialogflowV2beta1IntentMessageSuggestions? suggestions; |
| |
| /// Table card for Actions on Google. |
| GoogleCloudDialogflowV2beta1IntentMessageTableCard? tableCard; |
| |
| /// Plays audio from a file in Telephony Gateway. |
| GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio? |
| telephonyPlayAudio; |
| |
| /// Synthesizes speech in Telephony Gateway. |
| GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech? |
| telephonySynthesizeSpeech; |
| |
| /// Transfers the call in Telephony Gateway. |
| GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall? |
| telephonyTransferCall; |
| |
| /// Returns a text response. |
| GoogleCloudDialogflowV2beta1IntentMessageText? text; |
| |
| GoogleCloudDialogflowV2beta1IntentMessage({ |
| this.basicCard, |
| this.browseCarouselCard, |
| this.card, |
| this.carouselSelect, |
| this.image, |
| this.linkOutSuggestion, |
| this.listSelect, |
| this.mediaContent, |
| this.payload, |
| this.platform, |
| this.quickReplies, |
| this.rbmCarouselRichCard, |
| this.rbmStandaloneRichCard, |
| this.rbmText, |
| this.simpleResponses, |
| this.suggestions, |
| this.tableCard, |
| this.telephonyPlayAudio, |
| this.telephonySynthesizeSpeech, |
| this.telephonyTransferCall, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessage.fromJson(core.Map _json) |
| : this( |
| basicCard: _json.containsKey('basicCard') |
| ? GoogleCloudDialogflowV2beta1IntentMessageBasicCard.fromJson( |
| _json['basicCard'] as core.Map<core.String, core.dynamic>) |
| : null, |
| browseCarouselCard: _json.containsKey('browseCarouselCard') |
| ? GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard |
| .fromJson(_json['browseCarouselCard'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| card: _json.containsKey('card') |
| ? GoogleCloudDialogflowV2beta1IntentMessageCard.fromJson( |
| _json['card'] as core.Map<core.String, core.dynamic>) |
| : null, |
| carouselSelect: _json.containsKey('carouselSelect') |
| ? GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect |
| .fromJson(_json['carouselSelect'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| image: _json.containsKey('image') |
| ? GoogleCloudDialogflowV2beta1IntentMessageImage.fromJson( |
| _json['image'] as core.Map<core.String, core.dynamic>) |
| : null, |
| linkOutSuggestion: _json.containsKey('linkOutSuggestion') |
| ? GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion |
| .fromJson(_json['linkOutSuggestion'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| listSelect: _json.containsKey('listSelect') |
| ? GoogleCloudDialogflowV2beta1IntentMessageListSelect.fromJson( |
| _json['listSelect'] as core.Map<core.String, core.dynamic>) |
| : null, |
| mediaContent: _json.containsKey('mediaContent') |
| ? GoogleCloudDialogflowV2beta1IntentMessageMediaContent.fromJson( |
| _json['mediaContent'] as core.Map<core.String, core.dynamic>) |
| : null, |
| payload: _json.containsKey('payload') |
| ? (_json['payload'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| platform: _json.containsKey('platform') |
| ? _json['platform'] as core.String |
| : null, |
| quickReplies: _json.containsKey('quickReplies') |
| ? GoogleCloudDialogflowV2beta1IntentMessageQuickReplies.fromJson( |
| _json['quickReplies'] as core.Map<core.String, core.dynamic>) |
| : null, |
| rbmCarouselRichCard: _json.containsKey('rbmCarouselRichCard') |
| ? GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard |
| .fromJson(_json['rbmCarouselRichCard'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| rbmStandaloneRichCard: _json.containsKey('rbmStandaloneRichCard') |
| ? GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard |
| .fromJson(_json['rbmStandaloneRichCard'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| rbmText: _json.containsKey('rbmText') |
| ? GoogleCloudDialogflowV2beta1IntentMessageRbmText.fromJson( |
| _json['rbmText'] as core.Map<core.String, core.dynamic>) |
| : null, |
| simpleResponses: _json.containsKey('simpleResponses') |
| ? GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses |
| .fromJson(_json['simpleResponses'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| suggestions: _json.containsKey('suggestions') |
| ? GoogleCloudDialogflowV2beta1IntentMessageSuggestions.fromJson( |
| _json['suggestions'] as core.Map<core.String, core.dynamic>) |
| : null, |
| tableCard: _json.containsKey('tableCard') |
| ? GoogleCloudDialogflowV2beta1IntentMessageTableCard.fromJson( |
| _json['tableCard'] as core.Map<core.String, core.dynamic>) |
| : null, |
| telephonyPlayAudio: _json.containsKey('telephonyPlayAudio') |
| ? GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio |
| .fromJson(_json['telephonyPlayAudio'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| telephonySynthesizeSpeech: _json |
| .containsKey('telephonySynthesizeSpeech') |
| ? GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech |
| .fromJson(_json['telephonySynthesizeSpeech'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| telephonyTransferCall: _json.containsKey('telephonyTransferCall') |
| ? GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall |
| .fromJson(_json['telephonyTransferCall'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| text: _json.containsKey('text') |
| ? GoogleCloudDialogflowV2beta1IntentMessageText.fromJson( |
| _json['text'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (basicCard != null) 'basicCard': basicCard!.toJson(), |
| if (browseCarouselCard != null) |
| 'browseCarouselCard': browseCarouselCard!.toJson(), |
| if (card != null) 'card': card!.toJson(), |
| if (carouselSelect != null) 'carouselSelect': carouselSelect!.toJson(), |
| if (image != null) 'image': image!.toJson(), |
| if (linkOutSuggestion != null) |
| 'linkOutSuggestion': linkOutSuggestion!.toJson(), |
| if (listSelect != null) 'listSelect': listSelect!.toJson(), |
| if (mediaContent != null) 'mediaContent': mediaContent!.toJson(), |
| if (payload != null) 'payload': payload!, |
| if (platform != null) 'platform': platform!, |
| if (quickReplies != null) 'quickReplies': quickReplies!.toJson(), |
| if (rbmCarouselRichCard != null) |
| 'rbmCarouselRichCard': rbmCarouselRichCard!.toJson(), |
| if (rbmStandaloneRichCard != null) |
| 'rbmStandaloneRichCard': rbmStandaloneRichCard!.toJson(), |
| if (rbmText != null) 'rbmText': rbmText!.toJson(), |
| if (simpleResponses != null) |
| 'simpleResponses': simpleResponses!.toJson(), |
| if (suggestions != null) 'suggestions': suggestions!.toJson(), |
| if (tableCard != null) 'tableCard': tableCard!.toJson(), |
| if (telephonyPlayAudio != null) |
| 'telephonyPlayAudio': telephonyPlayAudio!.toJson(), |
| if (telephonySynthesizeSpeech != null) |
| 'telephonySynthesizeSpeech': telephonySynthesizeSpeech!.toJson(), |
| if (telephonyTransferCall != null) |
| 'telephonyTransferCall': telephonyTransferCall!.toJson(), |
| if (text != null) 'text': text!.toJson(), |
| }; |
| } |
| |
| /// The basic card message. |
| /// |
| /// Useful for displaying information. |
| class GoogleCloudDialogflowV2beta1IntentMessageBasicCard { |
| /// The collection of card buttons. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton>? buttons; |
| |
| /// Required, unless image is present. |
| /// |
| /// The body text of the card. |
| core.String? formattedText; |
| |
| /// The image for the card. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2beta1IntentMessageImage? image; |
| |
| /// The subtitle of the card. |
| /// |
| /// Optional. |
| core.String? subtitle; |
| |
| /// The title of the card. |
| /// |
| /// Optional. |
| core.String? title; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageBasicCard({ |
| this.buttons, |
| this.formattedText, |
| this.image, |
| this.subtitle, |
| this.title, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageBasicCard.fromJson(core.Map _json) |
| : this( |
| buttons: _json.containsKey('buttons') |
| ? (_json['buttons'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton>( |
| (value) => |
| GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| formattedText: _json.containsKey('formattedText') |
| ? _json['formattedText'] as core.String |
| : null, |
| image: _json.containsKey('image') |
| ? GoogleCloudDialogflowV2beta1IntentMessageImage.fromJson( |
| _json['image'] as core.Map<core.String, core.dynamic>) |
| : null, |
| subtitle: _json.containsKey('subtitle') |
| ? _json['subtitle'] as core.String |
| : null, |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (buttons != null) |
| 'buttons': buttons!.map((value) => value.toJson()).toList(), |
| if (formattedText != null) 'formattedText': formattedText!, |
| if (image != null) 'image': image!.toJson(), |
| if (subtitle != null) 'subtitle': subtitle!, |
| if (title != null) 'title': title!, |
| }; |
| } |
| |
| /// The button object that appears at the bottom of a card. |
| class GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton { |
| /// Action to take when a user taps on the button. |
| /// |
| /// Required. |
| GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction? |
| openUriAction; |
| |
| /// The title of the button. |
| /// |
| /// Required. |
| core.String? title; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton({ |
| this.openUriAction, |
| this.title, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton.fromJson( |
| core.Map _json) |
| : this( |
| openUriAction: _json.containsKey('openUriAction') |
| ? GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction |
| .fromJson(_json['openUriAction'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (openUriAction != null) 'openUriAction': openUriAction!.toJson(), |
| if (title != null) 'title': title!, |
| }; |
| } |
| |
| /// Opens the given URI. |
| class GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction { |
| /// The HTTP or HTTPS scheme URI. |
| /// |
| /// Required. |
| core.String? uri; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction({ |
| this.uri, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction.fromJson( |
| core.Map _json) |
| : this( |
| uri: _json.containsKey('uri') ? _json['uri'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (uri != null) 'uri': uri!, |
| }; |
| } |
| |
| /// Browse Carousel Card for Actions on Google. |
| /// |
| /// https://developers.google.com/actions/assistant/responses#browsing_carousel |
| class GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard { |
| /// Settings for displaying the image. |
| /// |
| /// Applies to every image in items. |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED" : Fill the gaps between the image |
| /// and the image container with gray bars. |
| /// - "GRAY" : Fill the gaps between the image and the image container with |
| /// gray bars. |
| /// - "WHITE" : Fill the gaps between the image and the image container with |
| /// white bars. |
| /// - "CROPPED" : Image is scaled such that the image width and height match |
| /// or exceed the container dimensions. This may crop the top and bottom of |
| /// the image if the scaled image height is greater than the container height, |
| /// or crop the left and right of the image if the scaled image width is |
| /// greater than the container width. This is similar to "Zoom Mode" on a |
| /// widescreen TV when playing a 4:3 video. |
| /// - "BLURRED_BACKGROUND" : Pad the gaps between image and image frame with a |
| /// blurred copy of the same image. |
| core.String? imageDisplayOptions; |
| |
| /// List of items in the Browse Carousel Card. |
| /// |
| /// Minimum of two items, maximum of ten. |
| /// |
| /// Required. |
| core.List< |
| GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItem>? |
| items; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard({ |
| this.imageDisplayOptions, |
| this.items, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard.fromJson( |
| core.Map _json) |
| : this( |
| imageDisplayOptions: _json.containsKey('imageDisplayOptions') |
| ? _json['imageDisplayOptions'] as core.String |
| : null, |
| items: _json.containsKey('items') |
| ? (_json['items'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItem>( |
| (value) => |
| GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItem |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (imageDisplayOptions != null) |
| 'imageDisplayOptions': imageDisplayOptions!, |
| if (items != null) |
| 'items': items!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Browsing carousel tile |
| class GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItem { |
| /// Description of the carousel item. |
| /// |
| /// Maximum of four lines of text. |
| /// |
| /// Optional. |
| core.String? description; |
| |
| /// Text that appears at the bottom of the Browse Carousel Card. |
| /// |
| /// Maximum of one line of text. |
| /// |
| /// Optional. |
| core.String? footer; |
| |
| /// Hero image for the carousel item. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2beta1IntentMessageImage? image; |
| |
| /// Action to present to the user. |
| /// |
| /// Required. |
| GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction? |
| openUriAction; |
| |
| /// Title of the carousel item. |
| /// |
| /// Maximum of two lines of text. |
| /// |
| /// Required. |
| core.String? title; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItem({ |
| this.description, |
| this.footer, |
| this.image, |
| this.openUriAction, |
| this.title, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItem.fromJson( |
| core.Map _json) |
| : this( |
| description: _json.containsKey('description') |
| ? _json['description'] as core.String |
| : null, |
| footer: _json.containsKey('footer') |
| ? _json['footer'] as core.String |
| : null, |
| image: _json.containsKey('image') |
| ? GoogleCloudDialogflowV2beta1IntentMessageImage.fromJson( |
| _json['image'] as core.Map<core.String, core.dynamic>) |
| : null, |
| openUriAction: _json.containsKey('openUriAction') |
| ? GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction |
| .fromJson(_json['openUriAction'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (description != null) 'description': description!, |
| if (footer != null) 'footer': footer!, |
| if (image != null) 'image': image!.toJson(), |
| if (openUriAction != null) 'openUriAction': openUriAction!.toJson(), |
| if (title != null) 'title': title!, |
| }; |
| } |
| |
| /// Actions on Google action to open a given url. |
| class GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction { |
| /// URL |
| /// |
| /// Required. |
| core.String? url; |
| |
| /// Specifies the type of viewer that is used when opening the URL. |
| /// |
| /// Defaults to opening via web browser. |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "URL_TYPE_HINT_UNSPECIFIED" : Unspecified |
| /// - "AMP_ACTION" : Url would be an amp action |
| /// - "AMP_CONTENT" : URL that points directly to AMP content, or to a |
| /// canonical URL which refers to AMP content via . |
| core.String? urlTypeHint; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction({ |
| this.url, |
| this.urlTypeHint, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction.fromJson( |
| core.Map _json) |
| : this( |
| url: _json.containsKey('url') ? _json['url'] as core.String : null, |
| urlTypeHint: _json.containsKey('urlTypeHint') |
| ? _json['urlTypeHint'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (url != null) 'url': url!, |
| if (urlTypeHint != null) 'urlTypeHint': urlTypeHint!, |
| }; |
| } |
| |
| /// The card response message. |
| class GoogleCloudDialogflowV2beta1IntentMessageCard { |
| /// The collection of card buttons. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2beta1IntentMessageCardButton>? buttons; |
| |
| /// The public URI to an image file for the card. |
| /// |
| /// Optional. |
| core.String? imageUri; |
| |
| /// The subtitle of the card. |
| /// |
| /// Optional. |
| core.String? subtitle; |
| |
| /// The title of the card. |
| /// |
| /// Optional. |
| core.String? title; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageCard({ |
| this.buttons, |
| this.imageUri, |
| this.subtitle, |
| this.title, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageCard.fromJson(core.Map _json) |
| : this( |
| buttons: _json.containsKey('buttons') |
| ? (_json['buttons'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentMessageCardButton>( |
| (value) => |
| GoogleCloudDialogflowV2beta1IntentMessageCardButton |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| imageUri: _json.containsKey('imageUri') |
| ? _json['imageUri'] as core.String |
| : null, |
| subtitle: _json.containsKey('subtitle') |
| ? _json['subtitle'] as core.String |
| : null, |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (buttons != null) |
| 'buttons': buttons!.map((value) => value.toJson()).toList(), |
| if (imageUri != null) 'imageUri': imageUri!, |
| if (subtitle != null) 'subtitle': subtitle!, |
| if (title != null) 'title': title!, |
| }; |
| } |
| |
| /// Contains information about a button. |
| /// |
| /// Optional. |
| class GoogleCloudDialogflowV2beta1IntentMessageCardButton { |
| /// The text to send back to the Dialogflow API or a URI to open. |
| /// |
| /// Optional. |
| core.String? postback; |
| |
| /// The text to show on the button. |
| /// |
| /// Optional. |
| core.String? text; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageCardButton({ |
| this.postback, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageCardButton.fromJson(core.Map _json) |
| : this( |
| postback: _json.containsKey('postback') |
| ? _json['postback'] as core.String |
| : null, |
| text: _json.containsKey('text') ? _json['text'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (postback != null) 'postback': postback!, |
| if (text != null) 'text': text!, |
| }; |
| } |
| |
| /// The card for presenting a carousel of options to select from. |
| class GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect { |
| /// Carousel items. |
| /// |
| /// Required. |
| core.List<GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem>? items; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect({ |
| this.items, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect.fromJson( |
| core.Map _json) |
| : this( |
| items: _json.containsKey('items') |
| ? (_json['items'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem>( |
| (value) => |
| GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (items != null) |
| 'items': items!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// An item in the carousel. |
| class GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem { |
| /// The body text of the card. |
| /// |
| /// Optional. |
| core.String? description; |
| |
| /// The image to display. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2beta1IntentMessageImage? image; |
| |
| /// Additional info about the option item. |
| /// |
| /// Required. |
| GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo? info; |
| |
| /// Title of the carousel item. |
| /// |
| /// Required. |
| core.String? title; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem({ |
| this.description, |
| this.image, |
| this.info, |
| this.title, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem.fromJson( |
| core.Map _json) |
| : this( |
| description: _json.containsKey('description') |
| ? _json['description'] as core.String |
| : null, |
| image: _json.containsKey('image') |
| ? GoogleCloudDialogflowV2beta1IntentMessageImage.fromJson( |
| _json['image'] as core.Map<core.String, core.dynamic>) |
| : null, |
| info: _json.containsKey('info') |
| ? GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo |
| .fromJson( |
| _json['info'] as core.Map<core.String, core.dynamic>) |
| : null, |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (description != null) 'description': description!, |
| if (image != null) 'image': image!.toJson(), |
| if (info != null) 'info': info!.toJson(), |
| if (title != null) 'title': title!, |
| }; |
| } |
| |
| /// Column properties for TableCard. |
| class GoogleCloudDialogflowV2beta1IntentMessageColumnProperties { |
| /// Column heading. |
| /// |
| /// Required. |
| core.String? header; |
| |
| /// Defines text alignment for all cells in this column. |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "HORIZONTAL_ALIGNMENT_UNSPECIFIED" : Text is aligned to the leading edge |
| /// of the column. |
| /// - "LEADING" : Text is aligned to the leading edge of the column. |
| /// - "CENTER" : Text is centered in the column. |
| /// - "TRAILING" : Text is aligned to the trailing edge of the column. |
| core.String? horizontalAlignment; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageColumnProperties({ |
| this.header, |
| this.horizontalAlignment, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageColumnProperties.fromJson( |
| core.Map _json) |
| : this( |
| header: _json.containsKey('header') |
| ? _json['header'] as core.String |
| : null, |
| horizontalAlignment: _json.containsKey('horizontalAlignment') |
| ? _json['horizontalAlignment'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (header != null) 'header': header!, |
| if (horizontalAlignment != null) |
| 'horizontalAlignment': horizontalAlignment!, |
| }; |
| } |
| |
| /// The image response message. |
| class GoogleCloudDialogflowV2beta1IntentMessageImage { |
| /// A text description of the image to be used for accessibility, e.g., screen |
| /// readers. |
| /// |
| /// Required if image_uri is set for CarouselSelect. |
| core.String? accessibilityText; |
| |
| /// The public URI to an image file. |
| /// |
| /// Optional. |
| core.String? imageUri; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageImage({ |
| this.accessibilityText, |
| this.imageUri, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageImage.fromJson(core.Map _json) |
| : this( |
| accessibilityText: _json.containsKey('accessibilityText') |
| ? _json['accessibilityText'] as core.String |
| : null, |
| imageUri: _json.containsKey('imageUri') |
| ? _json['imageUri'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (accessibilityText != null) 'accessibilityText': accessibilityText!, |
| if (imageUri != null) 'imageUri': imageUri!, |
| }; |
| } |
| |
| /// The suggestion chip message that allows the user to jump out to the app or |
| /// website associated with this agent. |
| class GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion { |
| /// The name of the app or site this chip is linking to. |
| /// |
| /// Required. |
| core.String? destinationName; |
| |
| /// The URI of the app or site to open when the user taps the suggestion chip. |
| /// |
| /// Required. |
| core.String? uri; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion({ |
| this.destinationName, |
| this.uri, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion.fromJson( |
| core.Map _json) |
| : this( |
| destinationName: _json.containsKey('destinationName') |
| ? _json['destinationName'] as core.String |
| : null, |
| uri: _json.containsKey('uri') ? _json['uri'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (destinationName != null) 'destinationName': destinationName!, |
| if (uri != null) 'uri': uri!, |
| }; |
| } |
| |
| /// The card for presenting a list of options to select from. |
| class GoogleCloudDialogflowV2beta1IntentMessageListSelect { |
| /// List items. |
| /// |
| /// Required. |
| core.List<GoogleCloudDialogflowV2beta1IntentMessageListSelectItem>? items; |
| |
| /// Subtitle of the list. |
| /// |
| /// Optional. |
| core.String? subtitle; |
| |
| /// The overall title of the list. |
| /// |
| /// Optional. |
| core.String? title; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageListSelect({ |
| this.items, |
| this.subtitle, |
| this.title, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageListSelect.fromJson(core.Map _json) |
| : this( |
| items: _json.containsKey('items') |
| ? (_json['items'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentMessageListSelectItem>( |
| (value) => |
| GoogleCloudDialogflowV2beta1IntentMessageListSelectItem |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| subtitle: _json.containsKey('subtitle') |
| ? _json['subtitle'] as core.String |
| : null, |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (items != null) |
| 'items': items!.map((value) => value.toJson()).toList(), |
| if (subtitle != null) 'subtitle': subtitle!, |
| if (title != null) 'title': title!, |
| }; |
| } |
| |
| /// An item in the list. |
| class GoogleCloudDialogflowV2beta1IntentMessageListSelectItem { |
| /// The main text describing the item. |
| /// |
| /// Optional. |
| core.String? description; |
| |
| /// The image to display. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2beta1IntentMessageImage? image; |
| |
| /// Additional information about this option. |
| /// |
| /// Required. |
| GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo? info; |
| |
| /// The title of the list item. |
| /// |
| /// Required. |
| core.String? title; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageListSelectItem({ |
| this.description, |
| this.image, |
| this.info, |
| this.title, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageListSelectItem.fromJson( |
| core.Map _json) |
| : this( |
| description: _json.containsKey('description') |
| ? _json['description'] as core.String |
| : null, |
| image: _json.containsKey('image') |
| ? GoogleCloudDialogflowV2beta1IntentMessageImage.fromJson( |
| _json['image'] as core.Map<core.String, core.dynamic>) |
| : null, |
| info: _json.containsKey('info') |
| ? GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo |
| .fromJson( |
| _json['info'] as core.Map<core.String, core.dynamic>) |
| : null, |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (description != null) 'description': description!, |
| if (image != null) 'image': image!.toJson(), |
| if (info != null) 'info': info!.toJson(), |
| if (title != null) 'title': title!, |
| }; |
| } |
| |
| /// The media content card for Actions on Google. |
| class GoogleCloudDialogflowV2beta1IntentMessageMediaContent { |
| /// List of media objects. |
| /// |
| /// Required. |
| core.List< |
| GoogleCloudDialogflowV2beta1IntentMessageMediaContentResponseMediaObject>? |
| mediaObjects; |
| |
| /// What type of media is the content (ie "audio"). |
| /// |
| /// Optional. |
| /// Possible string values are: |
| /// - "RESPONSE_MEDIA_TYPE_UNSPECIFIED" : Unspecified. |
| /// - "AUDIO" : Response media type is audio. |
| core.String? mediaType; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageMediaContent({ |
| this.mediaObjects, |
| this.mediaType, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageMediaContent.fromJson(core.Map _json) |
| : this( |
| mediaObjects: _json.containsKey('mediaObjects') |
| ? (_json['mediaObjects'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentMessageMediaContentResponseMediaObject>( |
| (value) => |
| GoogleCloudDialogflowV2beta1IntentMessageMediaContentResponseMediaObject |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| mediaType: _json.containsKey('mediaType') |
| ? _json['mediaType'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (mediaObjects != null) |
| 'mediaObjects': mediaObjects!.map((value) => value.toJson()).toList(), |
| if (mediaType != null) 'mediaType': mediaType!, |
| }; |
| } |
| |
| /// Response media object for media content card. |
| class GoogleCloudDialogflowV2beta1IntentMessageMediaContentResponseMediaObject { |
| /// Url where the media is stored. |
| /// |
| /// Required. |
| core.String? contentUrl; |
| |
| /// Description of media card. |
| /// |
| /// Optional. |
| core.String? description; |
| |
| /// Icon to display above media content. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2beta1IntentMessageImage? icon; |
| |
| /// Image to display above media content. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2beta1IntentMessageImage? largeImage; |
| |
| /// Name of media card. |
| /// |
| /// Required. |
| core.String? name; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageMediaContentResponseMediaObject({ |
| this.contentUrl, |
| this.description, |
| this.icon, |
| this.largeImage, |
| this.name, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageMediaContentResponseMediaObject.fromJson( |
| core.Map _json) |
| : this( |
| contentUrl: _json.containsKey('contentUrl') |
| ? _json['contentUrl'] as core.String |
| : null, |
| description: _json.containsKey('description') |
| ? _json['description'] as core.String |
| : null, |
| icon: _json.containsKey('icon') |
| ? GoogleCloudDialogflowV2beta1IntentMessageImage.fromJson( |
| _json['icon'] as core.Map<core.String, core.dynamic>) |
| : null, |
| largeImage: _json.containsKey('largeImage') |
| ? GoogleCloudDialogflowV2beta1IntentMessageImage.fromJson( |
| _json['largeImage'] as core.Map<core.String, core.dynamic>) |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (contentUrl != null) 'contentUrl': contentUrl!, |
| if (description != null) 'description': description!, |
| if (icon != null) 'icon': icon!.toJson(), |
| if (largeImage != null) 'largeImage': largeImage!.toJson(), |
| if (name != null) 'name': name!, |
| }; |
| } |
| |
| /// The quick replies response message. |
| class GoogleCloudDialogflowV2beta1IntentMessageQuickReplies { |
| /// The collection of quick replies. |
| /// |
| /// Optional. |
| core.List<core.String>? quickReplies; |
| |
| /// The title of the collection of quick replies. |
| /// |
| /// Optional. |
| core.String? title; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageQuickReplies({ |
| this.quickReplies, |
| this.title, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageQuickReplies.fromJson(core.Map _json) |
| : this( |
| quickReplies: _json.containsKey('quickReplies') |
| ? (_json['quickReplies'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (quickReplies != null) 'quickReplies': quickReplies!, |
| if (title != null) 'title': title!, |
| }; |
| } |
| |
| /// Rich Business Messaging (RBM) Card content |
| class GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent { |
| /// Description of the card (at most 2000 bytes). |
| /// |
| /// At least one of the title, description or media must be set. |
| /// |
| /// Optional. |
| core.String? description; |
| |
| /// However at least one of the title, description or media must be set. |
| /// |
| /// Media (image, GIF or a video) to include in the card. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia? media; |
| |
| /// List of suggestions to include in the card. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion>? |
| suggestions; |
| |
| /// Title of the card (at most 200 bytes). |
| /// |
| /// At least one of the title, description or media must be set. |
| /// |
| /// Optional. |
| core.String? title; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent({ |
| this.description, |
| this.media, |
| this.suggestions, |
| this.title, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent.fromJson( |
| core.Map _json) |
| : this( |
| description: _json.containsKey('description') |
| ? _json['description'] as core.String |
| : null, |
| media: _json.containsKey('media') |
| ? GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia |
| .fromJson( |
| _json['media'] as core.Map<core.String, core.dynamic>) |
| : null, |
| suggestions: _json.containsKey('suggestions') |
| ? (_json['suggestions'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion>( |
| (value) => |
| GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (description != null) 'description': description!, |
| if (media != null) 'media': media!.toJson(), |
| if (suggestions != null) |
| 'suggestions': suggestions!.map((value) => value.toJson()).toList(), |
| if (title != null) 'title': title!, |
| }; |
| } |
| |
| /// Rich Business Messaging (RBM) Media displayed in Cards The following |
| /// media-types are currently supported: Image Types * image/jpeg * image/jpg' * |
| /// image/gif * image/png Video Types * video/h263 * video/m4v * video/mp4 * |
| /// video/mpeg * video/mpeg4 * video/webm |
| class GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia { |
| /// Publicly reachable URI of the file. |
| /// |
| /// The RBM platform determines the MIME type of the file from the |
| /// content-type field in the HTTP headers when the platform fetches the file. |
| /// The content-type field must be present and accurate in the HTTP response |
| /// from the URL. |
| /// |
| /// Required. |
| core.String? fileUri; |
| |
| /// Required for cards with vertical orientation. |
| /// |
| /// The height of the media within a rich card with a vertical layout. For a |
| /// standalone card with horizontal layout, height is not customizable, and |
| /// this field is ignored. |
| /// Possible string values are: |
| /// - "HEIGHT_UNSPECIFIED" : Not specified. |
| /// - "SHORT" : 112 DP. |
| /// - "MEDIUM" : 168 DP. |
| /// - "TALL" : 264 DP. Not available for rich card carousels when the card |
| /// width is set to small. |
| core.String? height; |
| |
| /// Publicly reachable URI of the thumbnail.If you don't provide a thumbnail |
| /// URI, the RBM platform displays a blank placeholder thumbnail until the |
| /// user's device downloads the file. |
| /// |
| /// Depending on the user's setting, the file may not download automatically |
| /// and may require the user to tap a download button. |
| /// |
| /// Optional. |
| core.String? thumbnailUri; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia({ |
| this.fileUri, |
| this.height, |
| this.thumbnailUri, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia.fromJson( |
| core.Map _json) |
| : this( |
| fileUri: _json.containsKey('fileUri') |
| ? _json['fileUri'] as core.String |
| : null, |
| height: _json.containsKey('height') |
| ? _json['height'] as core.String |
| : null, |
| thumbnailUri: _json.containsKey('thumbnailUri') |
| ? _json['thumbnailUri'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (fileUri != null) 'fileUri': fileUri!, |
| if (height != null) 'height': height!, |
| if (thumbnailUri != null) 'thumbnailUri': thumbnailUri!, |
| }; |
| } |
| |
| /// Carousel Rich Business Messaging (RBM) rich card. |
| /// |
| /// Rich cards allow you to respond to users with more vivid content, e.g. with |
| /// media and suggestions. If you want to show a single card with more control |
| /// over the layout, please use RbmStandaloneCard instead. |
| class GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard { |
| /// The cards in the carousel. |
| /// |
| /// A carousel must have at least 2 cards and at most 10. |
| /// |
| /// Required. |
| core.List<GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent>? |
| cardContents; |
| |
| /// The width of the cards in the carousel. |
| /// |
| /// Required. |
| /// Possible string values are: |
| /// - "CARD_WIDTH_UNSPECIFIED" : Not specified. |
| /// - "SMALL" : 120 DP. Note that tall media cannot be used. |
| /// - "MEDIUM" : 232 DP. |
| core.String? cardWidth; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard({ |
| this.cardContents, |
| this.cardWidth, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard.fromJson( |
| core.Map _json) |
| : this( |
| cardContents: _json.containsKey('cardContents') |
| ? (_json['cardContents'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent>( |
| (value) => |
| GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| cardWidth: _json.containsKey('cardWidth') |
| ? _json['cardWidth'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (cardContents != null) |
| 'cardContents': cardContents!.map((value) => value.toJson()).toList(), |
| if (cardWidth != null) 'cardWidth': cardWidth!, |
| }; |
| } |
| |
| /// Standalone Rich Business Messaging (RBM) rich card. |
| /// |
| /// Rich cards allow you to respond to users with more vivid content, e.g. with |
| /// media and suggestions. You can group multiple rich cards into one using |
| /// RbmCarouselCard but carousel cards will give you less control over the card |
| /// layout. |
| class GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard { |
| /// Card content. |
| /// |
| /// Required. |
| GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent? cardContent; |
| |
| /// Orientation of the card. |
| /// |
| /// Required. |
| /// Possible string values are: |
| /// - "CARD_ORIENTATION_UNSPECIFIED" : Not specified. |
| /// - "HORIZONTAL" : Horizontal layout. |
| /// - "VERTICAL" : Vertical layout. |
| core.String? cardOrientation; |
| |
| /// Required if orientation is horizontal. |
| /// |
| /// Image preview alignment for standalone cards with horizontal layout. |
| /// Possible string values are: |
| /// - "THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED" : Not specified. |
| /// - "LEFT" : Thumbnail preview is left-aligned. |
| /// - "RIGHT" : Thumbnail preview is right-aligned. |
| core.String? thumbnailImageAlignment; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard({ |
| this.cardContent, |
| this.cardOrientation, |
| this.thumbnailImageAlignment, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard.fromJson( |
| core.Map _json) |
| : this( |
| cardContent: _json.containsKey('cardContent') |
| ? GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent |
| .fromJson(_json['cardContent'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| cardOrientation: _json.containsKey('cardOrientation') |
| ? _json['cardOrientation'] as core.String |
| : null, |
| thumbnailImageAlignment: _json.containsKey('thumbnailImageAlignment') |
| ? _json['thumbnailImageAlignment'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (cardContent != null) 'cardContent': cardContent!.toJson(), |
| if (cardOrientation != null) 'cardOrientation': cardOrientation!, |
| if (thumbnailImageAlignment != null) |
| 'thumbnailImageAlignment': thumbnailImageAlignment!, |
| }; |
| } |
| |
| /// Rich Business Messaging (RBM) suggested client-side action that the user can |
| /// choose from the card. |
| class GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedAction { |
| /// Suggested client side action: Dial a phone number |
| GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionDial? |
| dial; |
| |
| /// Suggested client side action: Open a URI on device |
| GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionOpenUri? |
| openUrl; |
| |
| /// Opaque payload that the Dialogflow receives in a user event when the user |
| /// taps the suggested action. |
| /// |
| /// This data will be also forwarded to webhook to allow performing custom |
| /// business logic. |
| core.String? postbackData; |
| |
| /// Suggested client side action: Share user location |
| GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionShareLocation? |
| shareLocation; |
| |
| /// Text to display alongside the action. |
| core.String? text; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedAction({ |
| this.dial, |
| this.openUrl, |
| this.postbackData, |
| this.shareLocation, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedAction.fromJson( |
| core.Map _json) |
| : this( |
| dial: _json.containsKey('dial') |
| ? GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionDial |
| .fromJson( |
| _json['dial'] as core.Map<core.String, core.dynamic>) |
| : null, |
| openUrl: _json.containsKey('openUrl') |
| ? GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionOpenUri |
| .fromJson( |
| _json['openUrl'] as core.Map<core.String, core.dynamic>) |
| : null, |
| postbackData: _json.containsKey('postbackData') |
| ? _json['postbackData'] as core.String |
| : null, |
| shareLocation: _json.containsKey('shareLocation') |
| ? GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionShareLocation |
| .fromJson(_json['shareLocation'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| text: _json.containsKey('text') ? _json['text'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (dial != null) 'dial': dial!.toJson(), |
| if (openUrl != null) 'openUrl': openUrl!.toJson(), |
| if (postbackData != null) 'postbackData': postbackData!, |
| if (shareLocation != null) 'shareLocation': shareLocation!.toJson(), |
| if (text != null) 'text': text!, |
| }; |
| } |
| |
| /// Opens the user's default dialer app with the specified phone number but does |
| /// not dial automatically. |
| class GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionDial { |
| /// The phone number to fill in the default dialer app. |
| /// |
| /// This field should be in [E.164](https://en.wikipedia.org/wiki/E.164) |
| /// format. An example of a correctly formatted phone number: +15556767888. |
| /// |
| /// Required. |
| core.String? phoneNumber; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionDial({ |
| this.phoneNumber, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionDial.fromJson( |
| core.Map _json) |
| : this( |
| phoneNumber: _json.containsKey('phoneNumber') |
| ? _json['phoneNumber'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (phoneNumber != null) 'phoneNumber': phoneNumber!, |
| }; |
| } |
| |
| /// Opens the user's default web browser app to the specified uri If the user |
| /// has an app installed that is registered as the default handler for the URL, |
| /// then this app will be opened instead, and its icon will be used in the |
| /// suggested action UI. |
| class GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionOpenUri { |
| /// The uri to open on the user device |
| /// |
| /// Required. |
| core.String? uri; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionOpenUri({ |
| this.uri, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionOpenUri.fromJson( |
| core.Map _json) |
| : this( |
| uri: _json.containsKey('uri') ? _json['uri'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (uri != null) 'uri': uri!, |
| }; |
| } |
| |
| /// Opens the device's location chooser so the user can pick a location to send |
| /// back to the agent. |
| class GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionShareLocation { |
| GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionShareLocation(); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionShareLocation.fromJson( |
| // ignore: avoid_unused_constructor_parameters |
| core.Map _json); |
| |
| core.Map<core.String, core.dynamic> toJson() => {}; |
| } |
| |
| /// Rich Business Messaging (RBM) suggested reply that the user can click |
| /// instead of typing in their own response. |
| class GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedReply { |
| /// Opaque payload that the Dialogflow receives in a user event when the user |
| /// taps the suggested reply. |
| /// |
| /// This data will be also forwarded to webhook to allow performing custom |
| /// business logic. |
| core.String? postbackData; |
| |
| /// Suggested reply text. |
| core.String? text; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedReply({ |
| this.postbackData, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedReply.fromJson( |
| core.Map _json) |
| : this( |
| postbackData: _json.containsKey('postbackData') |
| ? _json['postbackData'] as core.String |
| : null, |
| text: _json.containsKey('text') ? _json['text'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (postbackData != null) 'postbackData': postbackData!, |
| if (text != null) 'text': text!, |
| }; |
| } |
| |
| /// Rich Business Messaging (RBM) suggestion. |
| /// |
| /// Suggestions allow user to easily select/click a predefined response or |
| /// perform an action (like opening a web uri). |
| class GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion { |
| /// Predefined client side actions that user can choose |
| GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedAction? action; |
| |
| /// Predefined replies for user to select instead of typing |
| GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedReply? reply; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion({ |
| this.action, |
| this.reply, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion.fromJson( |
| core.Map _json) |
| : this( |
| action: _json.containsKey('action') |
| ? GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedAction |
| .fromJson( |
| _json['action'] as core.Map<core.String, core.dynamic>) |
| : null, |
| reply: _json.containsKey('reply') |
| ? GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedReply |
| .fromJson( |
| _json['reply'] as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (action != null) 'action': action!.toJson(), |
| if (reply != null) 'reply': reply!.toJson(), |
| }; |
| } |
| |
| /// Rich Business Messaging (RBM) text response with suggestions. |
| class GoogleCloudDialogflowV2beta1IntentMessageRbmText { |
| /// One or more suggestions to show to the user. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion>? |
| rbmSuggestion; |
| |
| /// Text sent and displayed to the user. |
| /// |
| /// Required. |
| core.String? text; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageRbmText({ |
| this.rbmSuggestion, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageRbmText.fromJson(core.Map _json) |
| : this( |
| rbmSuggestion: _json.containsKey('rbmSuggestion') |
| ? (_json['rbmSuggestion'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion>( |
| (value) => |
| GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| text: _json.containsKey('text') ? _json['text'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (rbmSuggestion != null) |
| 'rbmSuggestion': |
| rbmSuggestion!.map((value) => value.toJson()).toList(), |
| if (text != null) 'text': text!, |
| }; |
| } |
| |
| /// Additional info about the select item for when it is triggered in a dialog. |
| class GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo { |
| /// A unique key that will be sent back to the agent if this response is |
| /// given. |
| /// |
| /// Required. |
| core.String? key; |
| |
| /// A list of synonyms that can also be used to trigger this item in dialog. |
| /// |
| /// Optional. |
| core.List<core.String>? synonyms; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo({ |
| this.key, |
| this.synonyms, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo.fromJson( |
| core.Map _json) |
| : this( |
| key: _json.containsKey('key') ? _json['key'] as core.String : null, |
| synonyms: _json.containsKey('synonyms') |
| ? (_json['synonyms'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (key != null) 'key': key!, |
| if (synonyms != null) 'synonyms': synonyms!, |
| }; |
| } |
| |
| /// The simple response message containing speech or text. |
| class GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse { |
| /// The text to display. |
| /// |
| /// Optional. |
| core.String? displayText; |
| |
| /// One of text_to_speech or ssml must be provided. |
| /// |
| /// Structured spoken response to the user in the SSML format. Mutually |
| /// exclusive with text_to_speech. |
| core.String? ssml; |
| |
| /// One of text_to_speech or ssml must be provided. |
| /// |
| /// The plain text of the speech output. Mutually exclusive with ssml. |
| core.String? textToSpeech; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse({ |
| this.displayText, |
| this.ssml, |
| this.textToSpeech, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse.fromJson( |
| core.Map _json) |
| : this( |
| displayText: _json.containsKey('displayText') |
| ? _json['displayText'] as core.String |
| : null, |
| ssml: _json.containsKey('ssml') ? _json['ssml'] as core.String : null, |
| textToSpeech: _json.containsKey('textToSpeech') |
| ? _json['textToSpeech'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (displayText != null) 'displayText': displayText!, |
| if (ssml != null) 'ssml': ssml!, |
| if (textToSpeech != null) 'textToSpeech': textToSpeech!, |
| }; |
| } |
| |
| /// The collection of simple response candidates. |
| /// |
| /// This message in `QueryResult.fulfillment_messages` and |
| /// `WebhookResponse.fulfillment_messages` should contain only one |
| /// `SimpleResponse`. |
| class GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses { |
| /// The list of simple responses. |
| /// |
| /// Required. |
| core.List<GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse>? |
| simpleResponses; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses({ |
| this.simpleResponses, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses.fromJson( |
| core.Map _json) |
| : this( |
| simpleResponses: _json.containsKey('simpleResponses') |
| ? (_json['simpleResponses'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse>( |
| (value) => |
| GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (simpleResponses != null) |
| 'simpleResponses': |
| simpleResponses!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// The suggestion chip message that the user can tap to quickly post a reply to |
| /// the conversation. |
| class GoogleCloudDialogflowV2beta1IntentMessageSuggestion { |
| /// The text shown the in the suggestion chip. |
| /// |
| /// Required. |
| core.String? title; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageSuggestion({ |
| this.title, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageSuggestion.fromJson(core.Map _json) |
| : this( |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (title != null) 'title': title!, |
| }; |
| } |
| |
| /// The collection of suggestions. |
| class GoogleCloudDialogflowV2beta1IntentMessageSuggestions { |
| /// The list of suggested replies. |
| /// |
| /// Required. |
| core.List<GoogleCloudDialogflowV2beta1IntentMessageSuggestion>? suggestions; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageSuggestions({ |
| this.suggestions, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageSuggestions.fromJson(core.Map _json) |
| : this( |
| suggestions: _json.containsKey('suggestions') |
| ? (_json['suggestions'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentMessageSuggestion>( |
| (value) => |
| GoogleCloudDialogflowV2beta1IntentMessageSuggestion |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (suggestions != null) |
| 'suggestions': suggestions!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Table card for Actions on Google. |
| class GoogleCloudDialogflowV2beta1IntentMessageTableCard { |
| /// List of buttons for the card. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton>? buttons; |
| |
| /// Display properties for the columns in this table. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2beta1IntentMessageColumnProperties>? |
| columnProperties; |
| |
| /// Image which should be displayed on the card. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2beta1IntentMessageImage? image; |
| |
| /// Rows in this table of data. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2beta1IntentMessageTableCardRow>? rows; |
| |
| /// Subtitle to the title. |
| /// |
| /// Optional. |
| core.String? subtitle; |
| |
| /// Title of the card. |
| /// |
| /// Required. |
| core.String? title; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageTableCard({ |
| this.buttons, |
| this.columnProperties, |
| this.image, |
| this.rows, |
| this.subtitle, |
| this.title, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageTableCard.fromJson(core.Map _json) |
| : this( |
| buttons: _json.containsKey('buttons') |
| ? (_json['buttons'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton>( |
| (value) => |
| GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| columnProperties: _json.containsKey('columnProperties') |
| ? (_json['columnProperties'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentMessageColumnProperties>( |
| (value) => |
| GoogleCloudDialogflowV2beta1IntentMessageColumnProperties |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| image: _json.containsKey('image') |
| ? GoogleCloudDialogflowV2beta1IntentMessageImage.fromJson( |
| _json['image'] as core.Map<core.String, core.dynamic>) |
| : null, |
| rows: _json.containsKey('rows') |
| ? (_json['rows'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentMessageTableCardRow>( |
| (value) => |
| GoogleCloudDialogflowV2beta1IntentMessageTableCardRow |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| subtitle: _json.containsKey('subtitle') |
| ? _json['subtitle'] as core.String |
| : null, |
| title: |
| _json.containsKey('title') ? _json['title'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (buttons != null) |
| 'buttons': buttons!.map((value) => value.toJson()).toList(), |
| if (columnProperties != null) |
| 'columnProperties': |
| columnProperties!.map((value) => value.toJson()).toList(), |
| if (image != null) 'image': image!.toJson(), |
| if (rows != null) 'rows': rows!.map((value) => value.toJson()).toList(), |
| if (subtitle != null) 'subtitle': subtitle!, |
| if (title != null) 'title': title!, |
| }; |
| } |
| |
| /// Cell of TableCardRow. |
| class GoogleCloudDialogflowV2beta1IntentMessageTableCardCell { |
| /// Text in this cell. |
| /// |
| /// Required. |
| core.String? text; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageTableCardCell({ |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageTableCardCell.fromJson( |
| core.Map _json) |
| : this( |
| text: _json.containsKey('text') ? _json['text'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (text != null) 'text': text!, |
| }; |
| } |
| |
| /// Row of TableCard. |
| class GoogleCloudDialogflowV2beta1IntentMessageTableCardRow { |
| /// List of cells that make up this row. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2beta1IntentMessageTableCardCell>? cells; |
| |
| /// Whether to add a visual divider after this row. |
| /// |
| /// Optional. |
| core.bool? dividerAfter; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageTableCardRow({ |
| this.cells, |
| this.dividerAfter, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageTableCardRow.fromJson(core.Map _json) |
| : this( |
| cells: _json.containsKey('cells') |
| ? (_json['cells'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentMessageTableCardCell>( |
| (value) => |
| GoogleCloudDialogflowV2beta1IntentMessageTableCardCell |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| dividerAfter: _json.containsKey('dividerAfter') |
| ? _json['dividerAfter'] as core.bool |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (cells != null) |
| 'cells': cells!.map((value) => value.toJson()).toList(), |
| if (dividerAfter != null) 'dividerAfter': dividerAfter!, |
| }; |
| } |
| |
| /// Plays audio from a file in Telephony Gateway. |
| class GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio { |
| /// URI to a Google Cloud Storage object containing the audio to play, e.g., |
| /// "gs://bucket/object". |
| /// |
| /// The object must contain a single channel (mono) of linear PCM audio (2 |
| /// bytes / sample) at 8kHz. This object must be readable by the |
| /// `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` service account where |
| /// is the number of the Telephony Gateway project (usually the same as the |
| /// Dialogflow agent project). If the Google Cloud Storage bucket is in the |
| /// Telephony Gateway project, this permission is added by default when |
| /// enabling the Dialogflow V2 API. For audio from other sources, consider |
| /// using the `TelephonySynthesizeSpeech` message with SSML. |
| /// |
| /// Required. |
| core.String? audioUri; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio({ |
| this.audioUri, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio.fromJson( |
| core.Map _json) |
| : this( |
| audioUri: _json.containsKey('audioUri') |
| ? _json['audioUri'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (audioUri != null) 'audioUri': audioUri!, |
| }; |
| } |
| |
| /// Synthesizes speech and plays back the synthesized audio to the caller in |
| /// Telephony Gateway. |
| /// |
| /// Telephony Gateway takes the synthesizer settings from |
| /// `DetectIntentResponse.output_audio_config` which can either be set at |
| /// request-level or can come from the agent-level synthesizer config. |
| class GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech { |
| /// The SSML to be synthesized. |
| /// |
| /// For more information, see |
| /// [SSML](https://developers.google.com/actions/reference/ssml). |
| core.String? ssml; |
| |
| /// The raw text to be synthesized. |
| core.String? text; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech({ |
| this.ssml, |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech.fromJson( |
| core.Map _json) |
| : this( |
| ssml: _json.containsKey('ssml') ? _json['ssml'] as core.String : null, |
| text: _json.containsKey('text') ? _json['text'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (ssml != null) 'ssml': ssml!, |
| if (text != null) 'text': text!, |
| }; |
| } |
| |
| /// Transfers the call in Telephony Gateway. |
| class GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall { |
| /// The phone number to transfer the call to in |
| /// [E.164 format](https://en.wikipedia.org/wiki/E.164). |
| /// |
| /// We currently only allow transferring to US numbers (+1xxxyyyzzzz). |
| /// |
| /// Required. |
| core.String? phoneNumber; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall({ |
| this.phoneNumber, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall.fromJson( |
| core.Map _json) |
| : this( |
| phoneNumber: _json.containsKey('phoneNumber') |
| ? _json['phoneNumber'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (phoneNumber != null) 'phoneNumber': phoneNumber!, |
| }; |
| } |
| |
| /// The text response message. |
| class GoogleCloudDialogflowV2beta1IntentMessageText { |
| /// The collection of the agent's responses. |
| /// |
| /// Optional. |
| core.List<core.String>? text; |
| |
| GoogleCloudDialogflowV2beta1IntentMessageText({ |
| this.text, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentMessageText.fromJson(core.Map _json) |
| : this( |
| text: _json.containsKey('text') |
| ? (_json['text'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (text != null) 'text': text!, |
| }; |
| } |
| |
| /// Represents intent parameters. |
| class GoogleCloudDialogflowV2beta1IntentParameter { |
| /// The default value to use when the `value` yields an empty result. |
| /// |
| /// Default values can be extracted from contexts by using the following |
| /// syntax: `#context_name.parameter_name`. |
| /// |
| /// Optional. |
| core.String? defaultValue; |
| |
| /// The name of the parameter. |
| /// |
| /// Required. |
| core.String? displayName; |
| |
| /// The name of the entity type, prefixed with `@`, that describes values of |
| /// the parameter. |
| /// |
| /// If the parameter is required, this must be provided. |
| /// |
| /// Optional. |
| core.String? entityTypeDisplayName; |
| |
| /// Indicates whether the parameter represents a list of values. |
| /// |
| /// Optional. |
| core.bool? isList; |
| |
| /// Indicates whether the parameter is required. |
| /// |
| /// That is, whether the intent cannot be completed without collecting the |
| /// parameter value. |
| /// |
| /// Optional. |
| core.bool? mandatory; |
| |
| /// The unique identifier of this parameter. |
| core.String? name; |
| |
| /// The collection of prompts that the agent can present to the user in order |
| /// to collect a value for the parameter. |
| /// |
| /// Optional. |
| core.List<core.String>? prompts; |
| |
| /// The definition of the parameter value. |
| /// |
| /// It can be: - a constant string, - a parameter value defined as |
| /// `$parameter_name`, - an original parameter value defined as |
| /// `$parameter_name.original`, - a parameter value from some context defined |
| /// as `#context_name.parameter_name`. |
| /// |
| /// Optional. |
| core.String? value; |
| |
| GoogleCloudDialogflowV2beta1IntentParameter({ |
| this.defaultValue, |
| this.displayName, |
| this.entityTypeDisplayName, |
| this.isList, |
| this.mandatory, |
| this.name, |
| this.prompts, |
| this.value, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentParameter.fromJson(core.Map _json) |
| : this( |
| defaultValue: _json.containsKey('defaultValue') |
| ? _json['defaultValue'] as core.String |
| : null, |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| entityTypeDisplayName: _json.containsKey('entityTypeDisplayName') |
| ? _json['entityTypeDisplayName'] as core.String |
| : null, |
| isList: |
| _json.containsKey('isList') ? _json['isList'] as core.bool : null, |
| mandatory: _json.containsKey('mandatory') |
| ? _json['mandatory'] as core.bool |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| prompts: _json.containsKey('prompts') |
| ? (_json['prompts'] as core.List) |
| .map<core.String>((value) => value as core.String) |
| .toList() |
| : null, |
| value: |
| _json.containsKey('value') ? _json['value'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (defaultValue != null) 'defaultValue': defaultValue!, |
| if (displayName != null) 'displayName': displayName!, |
| if (entityTypeDisplayName != null) |
| 'entityTypeDisplayName': entityTypeDisplayName!, |
| if (isList != null) 'isList': isList!, |
| if (mandatory != null) 'mandatory': mandatory!, |
| if (name != null) 'name': name!, |
| if (prompts != null) 'prompts': prompts!, |
| if (value != null) 'value': value!, |
| }; |
| } |
| |
| /// Represents an example that the agent is trained on. |
| class GoogleCloudDialogflowV2beta1IntentTrainingPhrase { |
| /// The unique identifier of this training phrase. |
| /// |
| /// Output only. |
| core.String? name; |
| |
| /// The ordered list of training phrase parts. |
| /// |
| /// The parts are concatenated in order to form the training phrase. Note: The |
| /// API does not automatically annotate training phrases like the Dialogflow |
| /// Console does. Note: Do not forget to include whitespace at part |
| /// boundaries, so the training phrase is well formatted when the parts are |
| /// concatenated. If the training phrase does not need to be annotated with |
| /// parameters, you just need a single part with only the Part.text field set. |
| /// If you want to annotate the training phrase, you must create multiple |
| /// parts, where the fields of each part are populated in one of two ways: - |
| /// `Part.text` is set to a part of the phrase that has no parameters. - |
| /// `Part.text` is set to a part of the phrase that you want to annotate, and |
| /// the `entity_type`, `alias`, and `user_defined` fields are all set. |
| /// |
| /// Required. |
| core.List<GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart>? parts; |
| |
| /// Indicates how many times this example was added to the intent. |
| /// |
| /// Each time a developer adds an existing sample by editing an intent or |
| /// training, this counter is increased. |
| /// |
| /// Optional. |
| core.int? timesAddedCount; |
| |
| /// The type of the training phrase. |
| /// |
| /// Required. |
| /// Possible string values are: |
| /// - "TYPE_UNSPECIFIED" : Not specified. This value should never be used. |
| /// - "EXAMPLE" : Examples do not contain @-prefixed entity type names, but |
| /// example parts can be annotated with entity types. |
| /// - "TEMPLATE" : Templates are not annotated with entity types, but they can |
| /// contain @-prefixed entity type names as substrings. Template mode has been |
| /// deprecated. Example mode is the only supported way to create new training |
| /// phrases. If you have existing training phrases that you've created in |
| /// template mode, those will continue to work. |
| core.String? type; |
| |
| GoogleCloudDialogflowV2beta1IntentTrainingPhrase({ |
| this.name, |
| this.parts, |
| this.timesAddedCount, |
| this.type, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentTrainingPhrase.fromJson(core.Map _json) |
| : this( |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| parts: _json.containsKey('parts') |
| ? (_json['parts'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart>( |
| (value) => |
| GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| timesAddedCount: _json.containsKey('timesAddedCount') |
| ? _json['timesAddedCount'] as core.int |
| : null, |
| type: _json.containsKey('type') ? _json['type'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (name != null) 'name': name!, |
| if (parts != null) |
| 'parts': parts!.map((value) => value.toJson()).toList(), |
| if (timesAddedCount != null) 'timesAddedCount': timesAddedCount!, |
| if (type != null) 'type': type!, |
| }; |
| } |
| |
| /// Represents a part of a training phrase. |
| class GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart { |
| /// The parameter name for the value extracted from the annotated part of the |
| /// example. |
| /// |
| /// This field is required for annotated parts of the training phrase. |
| /// |
| /// Optional. |
| core.String? alias; |
| |
| /// The entity type name prefixed with `@`. |
| /// |
| /// This field is required for annotated parts of the training phrase. |
| /// |
| /// Optional. |
| core.String? entityType; |
| |
| /// The text for this part. |
| /// |
| /// Required. |
| core.String? text; |
| |
| /// Indicates whether the text was manually annotated. |
| /// |
| /// This field is set to true when the Dialogflow Console is used to manually |
| /// annotate the part. When creating an annotated part with the API, you must |
| /// set this to true. |
| /// |
| /// Optional. |
| core.bool? userDefined; |
| |
| GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart({ |
| this.alias, |
| this.entityType, |
| this.text, |
| this.userDefined, |
| }); |
| |
| GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart.fromJson(core.Map _json) |
| : this( |
| alias: |
| _json.containsKey('alias') ? _json['alias'] as core.String : null, |
| entityType: _json.containsKey('entityType') |
| ? _json['entityType'] as core.String |
| : null, |
| text: _json.containsKey('text') ? _json['text'] as core.String : null, |
| userDefined: _json.containsKey('userDefined') |
| ? _json['userDefined'] as core.bool |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (alias != null) 'alias': alias!, |
| if (entityType != null) 'entityType': entityType!, |
| if (text != null) 'text': text!, |
| if (userDefined != null) 'userDefined': userDefined!, |
| }; |
| } |
| |
| /// Represents the result of querying a Knowledge base. |
| class GoogleCloudDialogflowV2beta1KnowledgeAnswers { |
| /// A list of answers from Knowledge Connector. |
| core.List<GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer>? answers; |
| |
| GoogleCloudDialogflowV2beta1KnowledgeAnswers({ |
| this.answers, |
| }); |
| |
| GoogleCloudDialogflowV2beta1KnowledgeAnswers.fromJson(core.Map _json) |
| : this( |
| answers: _json.containsKey('answers') |
| ? (_json['answers'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer>( |
| (value) => |
| GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (answers != null) |
| 'answers': answers!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// An answer from Knowledge Connector. |
| class GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer { |
| /// The piece of text from the `source` knowledge base document that answers |
| /// this conversational query. |
| core.String? answer; |
| |
| /// The corresponding FAQ question if the answer was extracted from a FAQ |
| /// Document, empty otherwise. |
| core.String? faqQuestion; |
| |
| /// The system's confidence score that this Knowledge answer is a good match |
| /// for this conversational query. |
| /// |
| /// The range is from 0.0 (completely uncertain) to 1.0 (completely certain). |
| /// Note: The confidence score is likely to vary somewhat (possibly even for |
| /// identical requests), as the underlying model is under constant |
| /// improvement. It may be deprecated in the future. We recommend using |
| /// `match_confidence_level` which should be generally more stable. |
| core.double? matchConfidence; |
| |
| /// The system's confidence level that this knowledge answer is a good match |
| /// for this conversational query. |
| /// |
| /// NOTE: The confidence level for a given `` pair may change without notice, |
| /// as it depends on models that are constantly being improved. However, it |
| /// will change less frequently than the confidence score below, and should be |
| /// preferred for referencing the quality of an answer. |
| /// Possible string values are: |
| /// - "MATCH_CONFIDENCE_LEVEL_UNSPECIFIED" : Not specified. |
| /// - "LOW" : Indicates that the confidence is low. |
| /// - "MEDIUM" : Indicates our confidence is medium. |
| /// - "HIGH" : Indicates our confidence is high. |
| core.String? matchConfidenceLevel; |
| |
| /// Indicates which Knowledge Document this answer was extracted from. |
| /// |
| /// Format: `projects//knowledgeBases//documents/`. |
| core.String? source; |
| |
| GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer({ |
| this.answer, |
| this.faqQuestion, |
| this.matchConfidence, |
| this.matchConfidenceLevel, |
| this.source, |
| }); |
| |
| GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer.fromJson(core.Map _json) |
| : this( |
| answer: _json.containsKey('answer') |
| ? _json['answer'] as core.String |
| : null, |
| faqQuestion: _json.containsKey('faqQuestion') |
| ? _json['faqQuestion'] as core.String |
| : null, |
| matchConfidence: _json.containsKey('matchConfidence') |
| ? (_json['matchConfidence'] as core.num).toDouble() |
| : null, |
| matchConfidenceLevel: _json.containsKey('matchConfidenceLevel') |
| ? _json['matchConfidenceLevel'] as core.String |
| : null, |
| source: _json.containsKey('source') |
| ? _json['source'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (answer != null) 'answer': answer!, |
| if (faqQuestion != null) 'faqQuestion': faqQuestion!, |
| if (matchConfidence != null) 'matchConfidence': matchConfidence!, |
| if (matchConfidenceLevel != null) |
| 'matchConfidenceLevel': matchConfidenceLevel!, |
| if (source != null) 'source': source!, |
| }; |
| } |
| |
| /// Metadata in google::longrunning::Operation for Knowledge operations. |
| class GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata { |
| /// The current state of this operation. |
| /// |
| /// Required. Output only. |
| /// Possible string values are: |
| /// - "STATE_UNSPECIFIED" : State unspecified. |
| /// - "PENDING" : The operation has been created. |
| /// - "RUNNING" : The operation is currently running. |
| /// - "DONE" : The operation is done, either cancelled or completed. |
| core.String? state; |
| |
| GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata({ |
| this.state, |
| }); |
| |
| GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata.fromJson( |
| core.Map _json) |
| : this( |
| state: |
| _json.containsKey('state') ? _json['state'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (state != null) 'state': state!, |
| }; |
| } |
| |
| /// Represents a message posted into a conversation. |
| class GoogleCloudDialogflowV2beta1Message { |
| /// The message content. |
| /// |
| /// Required. |
| core.String? content; |
| |
| /// The time when the message was created in Contact Center AI. |
| /// |
| /// Output only. |
| core.String? createTime; |
| |
| /// The message language. |
| /// |
| /// This should be a \[BCP-47\](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) |
| /// language tag. Example: "en-US". |
| /// |
| /// Optional. |
| core.String? languageCode; |
| |
| /// The annotation for the message. |
| /// |
| /// Output only. |
| GoogleCloudDialogflowV2beta1MessageAnnotation? messageAnnotation; |
| |
| /// The unique identifier of the message. |
| /// |
| /// Format: `projects//locations//conversations//messages/`. |
| /// |
| /// Optional. |
| core.String? name; |
| |
| /// The participant that sends this message. |
| /// |
| /// Output only. |
| core.String? participant; |
| |
| /// The role of the participant. |
| /// |
| /// Output only. |
| /// Possible string values are: |
| /// - "ROLE_UNSPECIFIED" : Participant role not set. |
| /// - "HUMAN_AGENT" : Participant is a human agent. |
| /// - "AUTOMATED_AGENT" : Participant is an automated agent, such as a |
| /// Dialogflow agent. |
| /// - "END_USER" : Participant is an end user that has called or chatted with |
| /// Dialogflow services. |
| core.String? participantRole; |
| |
| /// The time when the message was sent. |
| /// |
| /// Optional. |
| core.String? sendTime; |
| |
| /// The sentiment analysis result for the message. |
| /// |
| /// Output only. |
| GoogleCloudDialogflowV2beta1SentimentAnalysisResult? sentimentAnalysis; |
| |
| GoogleCloudDialogflowV2beta1Message({ |
| this.content, |
| this.createTime, |
| this.languageCode, |
| this.messageAnnotation, |
| this.name, |
| this.participant, |
| this.participantRole, |
| this.sendTime, |
| this.sentimentAnalysis, |
| }); |
| |
| GoogleCloudDialogflowV2beta1Message.fromJson(core.Map _json) |
| : this( |
| content: _json.containsKey('content') |
| ? _json['content'] as core.String |
| : null, |
| createTime: _json.containsKey('createTime') |
| ? _json['createTime'] as core.String |
| : null, |
| languageCode: _json.containsKey('languageCode') |
| ? _json['languageCode'] as core.String |
| : null, |
| messageAnnotation: _json.containsKey('messageAnnotation') |
| ? GoogleCloudDialogflowV2beta1MessageAnnotation.fromJson( |
| _json['messageAnnotation'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| participant: _json.containsKey('participant') |
| ? _json['participant'] as core.String |
| : null, |
| participantRole: _json.containsKey('participantRole') |
| ? _json['participantRole'] as core.String |
| : null, |
| sendTime: _json.containsKey('sendTime') |
| ? _json['sendTime'] as core.String |
| : null, |
| sentimentAnalysis: _json.containsKey('sentimentAnalysis') |
| ? GoogleCloudDialogflowV2beta1SentimentAnalysisResult.fromJson( |
| _json['sentimentAnalysis'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (content != null) 'content': content!, |
| if (createTime != null) 'createTime': createTime!, |
| if (languageCode != null) 'languageCode': languageCode!, |
| if (messageAnnotation != null) |
| 'messageAnnotation': messageAnnotation!.toJson(), |
| if (name != null) 'name': name!, |
| if (participant != null) 'participant': participant!, |
| if (participantRole != null) 'participantRole': participantRole!, |
| if (sendTime != null) 'sendTime': sendTime!, |
| if (sentimentAnalysis != null) |
| 'sentimentAnalysis': sentimentAnalysis!.toJson(), |
| }; |
| } |
| |
| /// Represents the result of annotation for the message. |
| class GoogleCloudDialogflowV2beta1MessageAnnotation { |
| /// Indicates whether the text message contains entities. |
| /// |
| /// Required. |
| core.bool? containEntities; |
| |
| /// The collection of annotated message parts ordered by their position in the |
| /// message. |
| /// |
| /// You can recover the annotated message by concatenating |
| /// \[AnnotatedMessagePart.text\]. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2beta1AnnotatedMessagePart>? parts; |
| |
| GoogleCloudDialogflowV2beta1MessageAnnotation({ |
| this.containEntities, |
| this.parts, |
| }); |
| |
| GoogleCloudDialogflowV2beta1MessageAnnotation.fromJson(core.Map _json) |
| : this( |
| containEntities: _json.containsKey('containEntities') |
| ? _json['containEntities'] as core.bool |
| : null, |
| parts: _json.containsKey('parts') |
| ? (_json['parts'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1AnnotatedMessagePart>( |
| (value) => |
| GoogleCloudDialogflowV2beta1AnnotatedMessagePart |
| .fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (containEntities != null) 'containEntities': containEntities!, |
| if (parts != null) |
| 'parts': parts!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Represents the contents of the original request that was passed to the |
| /// `[Streaming]DetectIntent` call. |
| class GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest { |
| /// This field is set to the value of the `QueryParameters.payload` field |
| /// passed in the request. |
| /// |
| /// Some integrations that query a Dialogflow agent may provide additional |
| /// information in the payload. In particular, for the Dialogflow Phone |
| /// Gateway integration, this field has the form: { "telephony": { |
| /// "caller_id": "+18558363987" } } Note: The caller ID field (`caller_id`) |
| /// will be redacted for Trial Edition agents and populated with the caller ID |
| /// in [E.164 format](https://en.wikipedia.org/wiki/E.164) for Essentials |
| /// Edition agents. |
| /// |
| /// Optional. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? payload; |
| |
| /// The source of this request, e.g., `google`, `facebook`, `slack`. |
| /// |
| /// It is set by Dialogflow-owned servers. |
| core.String? source; |
| |
| /// The version of the protocol used for this request. |
| /// |
| /// This field is AoG-specific. |
| /// |
| /// Optional. |
| core.String? version; |
| |
| GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest({ |
| this.payload, |
| this.source, |
| this.version, |
| }); |
| |
| GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest.fromJson( |
| core.Map _json) |
| : this( |
| payload: _json.containsKey('payload') |
| ? (_json['payload'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| source: _json.containsKey('source') |
| ? _json['source'] as core.String |
| : null, |
| version: _json.containsKey('version') |
| ? _json['version'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (payload != null) 'payload': payload!, |
| if (source != null) 'source': source!, |
| if (version != null) 'version': version!, |
| }; |
| } |
| |
| /// Represents the result of conversational query or event processing. |
| class GoogleCloudDialogflowV2beta1QueryResult { |
| /// The action name from the matched intent. |
| core.String? action; |
| |
| /// This field is set to: - `false` if the matched intent has required |
| /// parameters and not all of the required parameter values have been |
| /// collected. |
| /// |
| /// - `true` if all required parameter values have been collected, or if the |
| /// matched intent doesn't contain any required parameters. |
| core.bool? allRequiredParamsPresent; |
| |
| /// Indicates whether the conversational query triggers a cancellation for |
| /// slot filling. |
| core.bool? cancelsSlotFilling; |
| |
| /// Free-form diagnostic information for the associated detect intent request. |
| /// |
| /// The fields of this data can change without notice, so you should not write |
| /// code that depends on its structure. The data may contain: - webhook call |
| /// latency - webhook errors |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? diagnosticInfo; |
| |
| /// The collection of rich messages to present to the user. |
| core.List<GoogleCloudDialogflowV2beta1IntentMessage>? fulfillmentMessages; |
| |
| /// The text to be pronounced to the user or shown on the screen. |
| /// |
| /// Note: This is a legacy field, `fulfillment_messages` should be preferred. |
| core.String? fulfillmentText; |
| |
| /// The intent that matched the conversational query. |
| /// |
| /// Some, not all fields are filled in this message, including but not limited |
| /// to: `name`, `display_name`, `end_interaction` and `is_fallback`. |
| GoogleCloudDialogflowV2beta1Intent? intent; |
| |
| /// The intent detection confidence. |
| /// |
| /// Values range from 0.0 (completely uncertain) to 1.0 (completely certain). |
| /// This value is for informational purpose only and is only used to help |
| /// match the best intent within the classification threshold. This value may |
| /// change for the same end-user expression at any time due to a model |
| /// retraining or change in implementation. If there are `multiple |
| /// knowledge_answers` messages, this value is set to the greatest |
| /// `knowledgeAnswers.match_confidence` value in the list. |
| core.double? intentDetectionConfidence; |
| |
| /// The result from Knowledge Connector (if any), ordered by decreasing |
| /// `KnowledgeAnswers.match_confidence`. |
| GoogleCloudDialogflowV2beta1KnowledgeAnswers? knowledgeAnswers; |
| |
| /// The language that was triggered during intent detection. |
| /// |
| /// See |
| /// [Language Support](https://cloud.google.com/dialogflow/docs/reference/language) |
| /// for a list of the currently supported language codes. |
| core.String? languageCode; |
| |
| /// The collection of output contexts. |
| /// |
| /// If applicable, `output_contexts.parameters` contains entries with name |
| /// `.original` containing the original parameter values before the query. |
| core.List<GoogleCloudDialogflowV2beta1Context>? outputContexts; |
| |
| /// The collection of extracted parameters. |
| /// |
| /// Depending on your protocol or client library language, this is a map, |
| /// associative array, symbol table, dictionary, or JSON object composed of a |
| /// collection of (MapKey, MapValue) pairs: - MapKey type: string - MapKey |
| /// value: parameter name - MapValue type: - If parameter's entity type is a |
| /// composite entity: map - Else: depending on parameter value type, could be |
| /// one of string, number, boolean, null, list or map - MapValue value: - If |
| /// parameter's entity type is a composite entity: map from composite entity |
| /// property names to property values - Else: parameter value |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? parameters; |
| |
| /// The original conversational query text: - If natural language text was |
| /// provided as input, `query_text` contains a copy of the input. |
| /// |
| /// - If natural language speech audio was provided as input, `query_text` |
| /// contains the speech recognition result. If speech recognizer produced |
| /// multiple alternatives, a particular one is picked. - If automatic spell |
| /// correction is enabled, `query_text` will contain the corrected user input. |
| core.String? queryText; |
| |
| /// The sentiment analysis result, which depends on the |
| /// `sentiment_analysis_request_config` specified in the request. |
| GoogleCloudDialogflowV2beta1SentimentAnalysisResult? sentimentAnalysisResult; |
| |
| /// The Speech recognition confidence between 0.0 and 1.0. |
| /// |
| /// A higher number indicates an estimated greater likelihood that the |
| /// recognized words are correct. The default of 0.0 is a sentinel value |
| /// indicating that confidence was not set. This field is not guaranteed to be |
| /// accurate or set. In particular this field isn't set for |
| /// StreamingDetectIntent since the streaming endpoint has separate confidence |
| /// estimates per portion of the audio in StreamingRecognitionResult. |
| core.double? speechRecognitionConfidence; |
| |
| /// If the query was fulfilled by a webhook call, this field is set to the |
| /// value of the `payload` field returned in the webhook response. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? webhookPayload; |
| |
| /// If the query was fulfilled by a webhook call, this field is set to the |
| /// value of the `source` field returned in the webhook response. |
| core.String? webhookSource; |
| |
| GoogleCloudDialogflowV2beta1QueryResult({ |
| this.action, |
| this.allRequiredParamsPresent, |
| this.cancelsSlotFilling, |
| this.diagnosticInfo, |
| this.fulfillmentMessages, |
| this.fulfillmentText, |
| this.intent, |
| this.intentDetectionConfidence, |
| this.knowledgeAnswers, |
| this.languageCode, |
| this.outputContexts, |
| this.parameters, |
| this.queryText, |
| this.sentimentAnalysisResult, |
| this.speechRecognitionConfidence, |
| this.webhookPayload, |
| this.webhookSource, |
| }); |
| |
| GoogleCloudDialogflowV2beta1QueryResult.fromJson(core.Map _json) |
| : this( |
| action: _json.containsKey('action') |
| ? _json['action'] as core.String |
| : null, |
| allRequiredParamsPresent: |
| _json.containsKey('allRequiredParamsPresent') |
| ? _json['allRequiredParamsPresent'] as core.bool |
| : null, |
| cancelsSlotFilling: _json.containsKey('cancelsSlotFilling') |
| ? _json['cancelsSlotFilling'] as core.bool |
| : null, |
| diagnosticInfo: _json.containsKey('diagnosticInfo') |
| ? (_json['diagnosticInfo'] as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| fulfillmentMessages: _json.containsKey('fulfillmentMessages') |
| ? (_json['fulfillmentMessages'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentMessage>((value) => |
| GoogleCloudDialogflowV2beta1IntentMessage.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| fulfillmentText: _json.containsKey('fulfillmentText') |
| ? _json['fulfillmentText'] as core.String |
| : null, |
| intent: _json.containsKey('intent') |
| ? GoogleCloudDialogflowV2beta1Intent.fromJson( |
| _json['intent'] as core.Map<core.String, core.dynamic>) |
| : null, |
| intentDetectionConfidence: |
| _json.containsKey('intentDetectionConfidence') |
| ? (_json['intentDetectionConfidence'] as core.num).toDouble() |
| : null, |
| knowledgeAnswers: _json.containsKey('knowledgeAnswers') |
| ? GoogleCloudDialogflowV2beta1KnowledgeAnswers.fromJson( |
| _json['knowledgeAnswers'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| languageCode: _json.containsKey('languageCode') |
| ? _json['languageCode'] as core.String |
| : null, |
| outputContexts: _json.containsKey('outputContexts') |
| ? (_json['outputContexts'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1Context>((value) => |
| GoogleCloudDialogflowV2beta1Context.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| parameters: _json.containsKey('parameters') |
| ? (_json['parameters'] as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| queryText: _json.containsKey('queryText') |
| ? _json['queryText'] as core.String |
| : null, |
| sentimentAnalysisResult: _json.containsKey('sentimentAnalysisResult') |
| ? GoogleCloudDialogflowV2beta1SentimentAnalysisResult.fromJson( |
| _json['sentimentAnalysisResult'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| speechRecognitionConfidence: _json |
| .containsKey('speechRecognitionConfidence') |
| ? (_json['speechRecognitionConfidence'] as core.num).toDouble() |
| : null, |
| webhookPayload: _json.containsKey('webhookPayload') |
| ? (_json['webhookPayload'] as core.Map<core.String, core.dynamic>) |
| .map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| webhookSource: _json.containsKey('webhookSource') |
| ? _json['webhookSource'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (action != null) 'action': action!, |
| if (allRequiredParamsPresent != null) |
| 'allRequiredParamsPresent': allRequiredParamsPresent!, |
| if (cancelsSlotFilling != null) |
| 'cancelsSlotFilling': cancelsSlotFilling!, |
| if (diagnosticInfo != null) 'diagnosticInfo': diagnosticInfo!, |
| if (fulfillmentMessages != null) |
| 'fulfillmentMessages': |
| fulfillmentMessages!.map((value) => value.toJson()).toList(), |
| if (fulfillmentText != null) 'fulfillmentText': fulfillmentText!, |
| if (intent != null) 'intent': intent!.toJson(), |
| if (intentDetectionConfidence != null) |
| 'intentDetectionConfidence': intentDetectionConfidence!, |
| if (knowledgeAnswers != null) |
| 'knowledgeAnswers': knowledgeAnswers!.toJson(), |
| if (languageCode != null) 'languageCode': languageCode!, |
| if (outputContexts != null) |
| 'outputContexts': |
| outputContexts!.map((value) => value.toJson()).toList(), |
| if (parameters != null) 'parameters': parameters!, |
| if (queryText != null) 'queryText': queryText!, |
| if (sentimentAnalysisResult != null) |
| 'sentimentAnalysisResult': sentimentAnalysisResult!.toJson(), |
| if (speechRecognitionConfidence != null) |
| 'speechRecognitionConfidence': speechRecognitionConfidence!, |
| if (webhookPayload != null) 'webhookPayload': webhookPayload!, |
| if (webhookSource != null) 'webhookSource': webhookSource!, |
| }; |
| } |
| |
| /// The sentiment, such as positive/negative feeling or association, for a unit |
| /// of analysis, such as the query text. |
| class GoogleCloudDialogflowV2beta1Sentiment { |
| /// A non-negative number in the \[0, +inf) range, which represents the |
| /// absolute magnitude of sentiment, regardless of score (positive or |
| /// negative). |
| core.double? magnitude; |
| |
| /// Sentiment score between -1.0 (negative sentiment) and 1.0 (positive |
| /// sentiment). |
| core.double? score; |
| |
| GoogleCloudDialogflowV2beta1Sentiment({ |
| this.magnitude, |
| this.score, |
| }); |
| |
| GoogleCloudDialogflowV2beta1Sentiment.fromJson(core.Map _json) |
| : this( |
| magnitude: _json.containsKey('magnitude') |
| ? (_json['magnitude'] as core.num).toDouble() |
| : null, |
| score: _json.containsKey('score') |
| ? (_json['score'] as core.num).toDouble() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (magnitude != null) 'magnitude': magnitude!, |
| if (score != null) 'score': score!, |
| }; |
| } |
| |
| /// The result of sentiment analysis. |
| /// |
| /// Sentiment analysis inspects user input and identifies the prevailing |
| /// subjective opinion, especially to determine a user's attitude as positive, |
| /// negative, or neutral. For Participants.DetectIntent, it needs to be |
| /// configured in DetectIntentRequest.query_params. For |
| /// Participants.StreamingDetectIntent, it needs to be configured in |
| /// StreamingDetectIntentRequest.query_params. And for |
| /// Participants.AnalyzeContent and Participants.StreamingAnalyzeContent, it |
| /// needs to be configured in ConversationProfile.human_agent_assistant_config |
| class GoogleCloudDialogflowV2beta1SentimentAnalysisResult { |
| /// The sentiment analysis result for `query_text`. |
| GoogleCloudDialogflowV2beta1Sentiment? queryTextSentiment; |
| |
| GoogleCloudDialogflowV2beta1SentimentAnalysisResult({ |
| this.queryTextSentiment, |
| }); |
| |
| GoogleCloudDialogflowV2beta1SentimentAnalysisResult.fromJson(core.Map _json) |
| : this( |
| queryTextSentiment: _json.containsKey('queryTextSentiment') |
| ? GoogleCloudDialogflowV2beta1Sentiment.fromJson( |
| _json['queryTextSentiment'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (queryTextSentiment != null) |
| 'queryTextSentiment': queryTextSentiment!.toJson(), |
| }; |
| } |
| |
| /// A session represents a conversation between a Dialogflow agent and an |
| /// end-user. |
| /// |
| /// You can create special entities, called session entities, during a session. |
| /// Session entities can extend or replace custom entity types and only exist |
| /// during the session that they were created for. All session data, including |
| /// session entities, is stored by Dialogflow for 20 minutes. For more |
| /// information, see the |
| /// [session entity guide](https://cloud.google.com/dialogflow/docs/entities-session). |
| class GoogleCloudDialogflowV2beta1SessionEntityType { |
| /// The collection of entities associated with this session entity type. |
| /// |
| /// Required. |
| core.List<GoogleCloudDialogflowV2beta1EntityTypeEntity>? entities; |
| |
| /// Indicates whether the additional data should override or supplement the |
| /// custom entity type definition. |
| /// |
| /// Required. |
| /// Possible string values are: |
| /// - "ENTITY_OVERRIDE_MODE_UNSPECIFIED" : Not specified. This value should be |
| /// never used. |
| /// - "ENTITY_OVERRIDE_MODE_OVERRIDE" : The collection of session entities |
| /// overrides the collection of entities in the corresponding custom entity |
| /// type. |
| /// - "ENTITY_OVERRIDE_MODE_SUPPLEMENT" : The collection of session entities |
| /// extends the collection of entities in the corresponding custom entity |
| /// type. Note: Even in this override mode calls to `ListSessionEntityTypes`, |
| /// `GetSessionEntityType`, `CreateSessionEntityType` and |
| /// `UpdateSessionEntityType` only return the additional entities added in |
| /// this session entity type. If you want to get the supplemented list, please |
| /// call EntityTypes.GetEntityType on the custom entity type and merge. |
| core.String? entityOverrideMode; |
| |
| /// The unique identifier of this session entity type. |
| /// |
| /// Supported formats: - `projects//agent/sessions//entityTypes/` - |
| /// `projects//locations//agent/sessions//entityTypes/` - |
| /// `projects//agent/environments//users//sessions//entityTypes/` - |
| /// `projects//locations//agent/environments/ /users//sessions//entityTypes/` |
| /// If `Location ID` is not specified we assume default 'us' location. If |
| /// `Environment ID` is not specified, we assume default 'draft' environment. |
| /// If `User ID` is not specified, we assume default '-' user. `` must be the |
| /// display name of an existing entity type in the same agent that will be |
| /// overridden or supplemented. |
| /// |
| /// Required. |
| core.String? name; |
| |
| GoogleCloudDialogflowV2beta1SessionEntityType({ |
| this.entities, |
| this.entityOverrideMode, |
| this.name, |
| }); |
| |
| GoogleCloudDialogflowV2beta1SessionEntityType.fromJson(core.Map _json) |
| : this( |
| entities: _json.containsKey('entities') |
| ? (_json['entities'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1EntityTypeEntity>((value) => |
| GoogleCloudDialogflowV2beta1EntityTypeEntity.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| entityOverrideMode: _json.containsKey('entityOverrideMode') |
| ? _json['entityOverrideMode'] as core.String |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (entities != null) |
| 'entities': entities!.map((value) => value.toJson()).toList(), |
| if (entityOverrideMode != null) |
| 'entityOverrideMode': entityOverrideMode!, |
| if (name != null) 'name': name!, |
| }; |
| } |
| |
| /// Represents a smart reply answer. |
| class GoogleCloudDialogflowV2beta1SmartReplyAnswer { |
| /// The name of answer record, in the format of |
| /// "projects//locations//answerRecords/" |
| core.String? answerRecord; |
| |
| /// Smart reply confidence. |
| /// |
| /// The system's confidence score that this reply is a good match for this |
| /// conversation, as a value from 0.0 (completely uncertain) to 1.0 |
| /// (completely certain). |
| core.double? confidence; |
| |
| /// The content of the reply. |
| core.String? reply; |
| |
| GoogleCloudDialogflowV2beta1SmartReplyAnswer({ |
| this.answerRecord, |
| this.confidence, |
| this.reply, |
| }); |
| |
| GoogleCloudDialogflowV2beta1SmartReplyAnswer.fromJson(core.Map _json) |
| : this( |
| answerRecord: _json.containsKey('answerRecord') |
| ? _json['answerRecord'] as core.String |
| : null, |
| confidence: _json.containsKey('confidence') |
| ? (_json['confidence'] as core.num).toDouble() |
| : null, |
| reply: |
| _json.containsKey('reply') ? _json['reply'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (answerRecord != null) 'answerRecord': answerRecord!, |
| if (confidence != null) 'confidence': confidence!, |
| if (reply != null) 'reply': reply!, |
| }; |
| } |
| |
| /// The response message for Participants.SuggestArticles. |
| class GoogleCloudDialogflowV2beta1SuggestArticlesResponse { |
| /// Articles ordered by score in descending order. |
| /// |
| /// Output only. |
| core.List<GoogleCloudDialogflowV2beta1ArticleAnswer>? articleAnswers; |
| |
| /// Number of messages prior to and including latest_message to compile the |
| /// suggestion. |
| /// |
| /// It may be smaller than the SuggestArticlesResponse.context_size field in |
| /// the request if there aren't that many messages in the conversation. |
| core.int? contextSize; |
| |
| /// The name of the latest conversation message used to compile suggestion |
| /// for. |
| /// |
| /// Format: `projects//locations//conversations//messages/`. |
| core.String? latestMessage; |
| |
| GoogleCloudDialogflowV2beta1SuggestArticlesResponse({ |
| this.articleAnswers, |
| this.contextSize, |
| this.latestMessage, |
| }); |
| |
| GoogleCloudDialogflowV2beta1SuggestArticlesResponse.fromJson(core.Map _json) |
| : this( |
| articleAnswers: _json.containsKey('articleAnswers') |
| ? (_json['articleAnswers'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1ArticleAnswer>((value) => |
| GoogleCloudDialogflowV2beta1ArticleAnswer.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| contextSize: _json.containsKey('contextSize') |
| ? _json['contextSize'] as core.int |
| : null, |
| latestMessage: _json.containsKey('latestMessage') |
| ? _json['latestMessage'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (articleAnswers != null) |
| 'articleAnswers': |
| articleAnswers!.map((value) => value.toJson()).toList(), |
| if (contextSize != null) 'contextSize': contextSize!, |
| if (latestMessage != null) 'latestMessage': latestMessage!, |
| }; |
| } |
| |
| /// The request message for Participants.SuggestFaqAnswers. |
| class GoogleCloudDialogflowV2beta1SuggestFaqAnswersResponse { |
| /// Number of messages prior to and including latest_message to compile the |
| /// suggestion. |
| /// |
| /// It may be smaller than the SuggestFaqAnswersRequest.context_size field in |
| /// the request if there aren't that many messages in the conversation. |
| core.int? contextSize; |
| |
| /// Answers extracted from FAQ documents. |
| /// |
| /// Output only. |
| core.List<GoogleCloudDialogflowV2beta1FaqAnswer>? faqAnswers; |
| |
| /// The name of the latest conversation message used to compile suggestion |
| /// for. |
| /// |
| /// Format: `projects//locations//conversations//messages/`. |
| core.String? latestMessage; |
| |
| GoogleCloudDialogflowV2beta1SuggestFaqAnswersResponse({ |
| this.contextSize, |
| this.faqAnswers, |
| this.latestMessage, |
| }); |
| |
| GoogleCloudDialogflowV2beta1SuggestFaqAnswersResponse.fromJson(core.Map _json) |
| : this( |
| contextSize: _json.containsKey('contextSize') |
| ? _json['contextSize'] as core.int |
| : null, |
| faqAnswers: _json.containsKey('faqAnswers') |
| ? (_json['faqAnswers'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1FaqAnswer>((value) => |
| GoogleCloudDialogflowV2beta1FaqAnswer.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| latestMessage: _json.containsKey('latestMessage') |
| ? _json['latestMessage'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (contextSize != null) 'contextSize': contextSize!, |
| if (faqAnswers != null) |
| 'faqAnswers': faqAnswers!.map((value) => value.toJson()).toList(), |
| if (latestMessage != null) 'latestMessage': latestMessage!, |
| }; |
| } |
| |
| /// The response message for Participants.SuggestSmartReplies. |
| class GoogleCloudDialogflowV2beta1SuggestSmartRepliesResponse { |
| /// Number of messages prior to and including latest_message to compile the |
| /// suggestion. |
| /// |
| /// It may be smaller than the SuggestSmartRepliesRequest.context_size field |
| /// in the request if there aren't that many messages in the conversation. |
| core.int? contextSize; |
| |
| /// The name of the latest conversation message used to compile suggestion |
| /// for. |
| /// |
| /// Format: `projects//locations//conversations//messages/`. |
| core.String? latestMessage; |
| |
| /// Multiple reply options provided by smart reply service. |
| /// |
| /// The order is based on the rank of the model prediction. The maximum number |
| /// of the returned replies is set in SmartReplyConfig. |
| /// |
| /// Output only. |
| core.List<GoogleCloudDialogflowV2beta1SmartReplyAnswer>? smartReplyAnswers; |
| |
| GoogleCloudDialogflowV2beta1SuggestSmartRepliesResponse({ |
| this.contextSize, |
| this.latestMessage, |
| this.smartReplyAnswers, |
| }); |
| |
| GoogleCloudDialogflowV2beta1SuggestSmartRepliesResponse.fromJson( |
| core.Map _json) |
| : this( |
| contextSize: _json.containsKey('contextSize') |
| ? _json['contextSize'] as core.int |
| : null, |
| latestMessage: _json.containsKey('latestMessage') |
| ? _json['latestMessage'] as core.String |
| : null, |
| smartReplyAnswers: _json.containsKey('smartReplyAnswers') |
| ? (_json['smartReplyAnswers'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1SmartReplyAnswer>((value) => |
| GoogleCloudDialogflowV2beta1SmartReplyAnswer.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (contextSize != null) 'contextSize': contextSize!, |
| if (latestMessage != null) 'latestMessage': latestMessage!, |
| if (smartReplyAnswers != null) |
| 'smartReplyAnswers': |
| smartReplyAnswers!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// One response of different type of suggestion response which is used in the |
| /// response of Participants.AnalyzeContent and Participants.AnalyzeContent, as |
| /// well as HumanAgentAssistantEvent. |
| class GoogleCloudDialogflowV2beta1SuggestionResult { |
| /// Error status if the request failed. |
| GoogleRpcStatus? error; |
| |
| /// SuggestArticlesResponse if request is for ARTICLE_SUGGESTION. |
| GoogleCloudDialogflowV2beta1SuggestArticlesResponse? suggestArticlesResponse; |
| |
| /// SuggestFaqAnswersResponse if request is for FAQ_ANSWER. |
| GoogleCloudDialogflowV2beta1SuggestFaqAnswersResponse? |
| suggestFaqAnswersResponse; |
| |
| /// SuggestSmartRepliesResponse if request is for SMART_REPLY. |
| GoogleCloudDialogflowV2beta1SuggestSmartRepliesResponse? |
| suggestSmartRepliesResponse; |
| |
| GoogleCloudDialogflowV2beta1SuggestionResult({ |
| this.error, |
| this.suggestArticlesResponse, |
| this.suggestFaqAnswersResponse, |
| this.suggestSmartRepliesResponse, |
| }); |
| |
| GoogleCloudDialogflowV2beta1SuggestionResult.fromJson(core.Map _json) |
| : this( |
| error: _json.containsKey('error') |
| ? GoogleRpcStatus.fromJson( |
| _json['error'] as core.Map<core.String, core.dynamic>) |
| : null, |
| suggestArticlesResponse: _json.containsKey('suggestArticlesResponse') |
| ? GoogleCloudDialogflowV2beta1SuggestArticlesResponse.fromJson( |
| _json['suggestArticlesResponse'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| suggestFaqAnswersResponse: _json |
| .containsKey('suggestFaqAnswersResponse') |
| ? GoogleCloudDialogflowV2beta1SuggestFaqAnswersResponse.fromJson( |
| _json['suggestFaqAnswersResponse'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| suggestSmartRepliesResponse: |
| _json.containsKey('suggestSmartRepliesResponse') |
| ? GoogleCloudDialogflowV2beta1SuggestSmartRepliesResponse |
| .fromJson(_json['suggestSmartRepliesResponse'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (error != null) 'error': error!.toJson(), |
| if (suggestArticlesResponse != null) |
| 'suggestArticlesResponse': suggestArticlesResponse!.toJson(), |
| if (suggestFaqAnswersResponse != null) |
| 'suggestFaqAnswersResponse': suggestFaqAnswersResponse!.toJson(), |
| if (suggestSmartRepliesResponse != null) |
| 'suggestSmartRepliesResponse': suggestSmartRepliesResponse!.toJson(), |
| }; |
| } |
| |
| /// The request message for a webhook call. |
| class GoogleCloudDialogflowV2beta1WebhookRequest { |
| /// Alternative query results from KnowledgeService. |
| core.List<GoogleCloudDialogflowV2beta1QueryResult>? alternativeQueryResults; |
| |
| /// The contents of the original request that was passed to |
| /// `[Streaming]DetectIntent` call. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest? |
| originalDetectIntentRequest; |
| |
| /// The result of the conversational query or event processing. |
| /// |
| /// Contains the same value as `[Streaming]DetectIntentResponse.query_result`. |
| GoogleCloudDialogflowV2beta1QueryResult? queryResult; |
| |
| /// The unique identifier of the response. |
| /// |
| /// Contains the same value as `[Streaming]DetectIntentResponse.response_id`. |
| core.String? responseId; |
| |
| /// The unique identifier of detectIntent request session. |
| /// |
| /// Can be used to identify end-user inside webhook implementation. Supported |
| /// formats: - \`projects//agent/sessions/, - |
| /// \`projects//locations//agent/sessions/\`, - |
| /// \`projects//agent/environments//users//sessions/\`, - |
| /// \`projects//locations//agent/environments//users//sessions/\`, |
| core.String? session; |
| |
| GoogleCloudDialogflowV2beta1WebhookRequest({ |
| this.alternativeQueryResults, |
| this.originalDetectIntentRequest, |
| this.queryResult, |
| this.responseId, |
| this.session, |
| }); |
| |
| GoogleCloudDialogflowV2beta1WebhookRequest.fromJson(core.Map _json) |
| : this( |
| alternativeQueryResults: _json.containsKey('alternativeQueryResults') |
| ? (_json['alternativeQueryResults'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1QueryResult>((value) => |
| GoogleCloudDialogflowV2beta1QueryResult.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| originalDetectIntentRequest: |
| _json.containsKey('originalDetectIntentRequest') |
| ? GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest |
| .fromJson(_json['originalDetectIntentRequest'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| queryResult: _json.containsKey('queryResult') |
| ? GoogleCloudDialogflowV2beta1QueryResult.fromJson( |
| _json['queryResult'] as core.Map<core.String, core.dynamic>) |
| : null, |
| responseId: _json.containsKey('responseId') |
| ? _json['responseId'] as core.String |
| : null, |
| session: _json.containsKey('session') |
| ? _json['session'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (alternativeQueryResults != null) |
| 'alternativeQueryResults': |
| alternativeQueryResults!.map((value) => value.toJson()).toList(), |
| if (originalDetectIntentRequest != null) |
| 'originalDetectIntentRequest': originalDetectIntentRequest!.toJson(), |
| if (queryResult != null) 'queryResult': queryResult!.toJson(), |
| if (responseId != null) 'responseId': responseId!, |
| if (session != null) 'session': session!, |
| }; |
| } |
| |
| /// The response message for a webhook call. |
| /// |
| /// This response is validated by the Dialogflow server. If validation fails, an |
| /// error will be returned in the QueryResult.diagnostic_info field. Setting |
| /// JSON fields to an empty value with the wrong type is a common error. To |
| /// avoid this error: - Use `""` for empty strings - Use `{}` or `null` for |
| /// empty objects - Use `[]` or `null` for empty arrays For more information, |
| /// see the |
| /// [Protocol Buffers Language Guide](https://developers.google.com/protocol-buffers/docs/proto3#json). |
| class GoogleCloudDialogflowV2beta1WebhookResponse { |
| /// Indicates that this intent ends an interaction. |
| /// |
| /// Some integrations (e.g., Actions on Google or Dialogflow phone gateway) |
| /// use this information to close interaction with an end user. Default is |
| /// false. |
| /// |
| /// Optional. |
| core.bool? endInteraction; |
| |
| /// Invokes the supplied events. |
| /// |
| /// When this field is set, Dialogflow ignores the `fulfillment_text`, |
| /// `fulfillment_messages`, and `payload` fields. |
| /// |
| /// Optional. |
| GoogleCloudDialogflowV2beta1EventInput? followupEventInput; |
| |
| /// The rich response messages intended for the end-user. |
| /// |
| /// When provided, Dialogflow uses this field to populate |
| /// QueryResult.fulfillment_messages sent to the integration or API caller. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2beta1IntentMessage>? fulfillmentMessages; |
| |
| /// The text response message intended for the end-user. |
| /// |
| /// It is recommended to use `fulfillment_messages.text.text[0]` instead. When |
| /// provided, Dialogflow uses this field to populate |
| /// QueryResult.fulfillment_text sent to the integration or API caller. |
| /// |
| /// Optional. |
| core.String? fulfillmentText; |
| |
| /// Indicates that a live agent should be brought in to handle the interaction |
| /// with the user. |
| /// |
| /// In most cases, when you set this flag to true, you would also want to set |
| /// end_interaction to true as well. Default is false. |
| core.bool? liveAgentHandoff; |
| |
| /// The collection of output contexts that will overwrite currently active |
| /// contexts for the session and reset their lifespans. |
| /// |
| /// When provided, Dialogflow uses this field to populate |
| /// QueryResult.output_contexts sent to the integration or API caller. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2beta1Context>? outputContexts; |
| |
| /// This field can be used to pass custom data from your webhook to the |
| /// integration or API caller. |
| /// |
| /// Arbitrary JSON objects are supported. When provided, Dialogflow uses this |
| /// field to populate QueryResult.webhook_payload sent to the integration or |
| /// API caller. This field is also used by the |
| /// [Google Assistant integration](https://cloud.google.com/dialogflow/docs/integrations/aog) |
| /// for rich response messages. See the format definition at |
| /// [Google Assistant Dialogflow webhook format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) |
| /// |
| /// Optional. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? payload; |
| |
| /// Additional session entity types to replace or extend developer entity |
| /// types with. |
| /// |
| /// The entity synonyms apply to all languages and persist for the session. |
| /// Setting this data from a webhook overwrites the session entity types that |
| /// have been set using `detectIntent`, `streamingDetectIntent` or |
| /// SessionEntityType management methods. |
| /// |
| /// Optional. |
| core.List<GoogleCloudDialogflowV2beta1SessionEntityType>? sessionEntityTypes; |
| |
| /// A custom field used to identify the webhook source. |
| /// |
| /// Arbitrary strings are supported. When provided, Dialogflow uses this field |
| /// to populate QueryResult.webhook_source sent to the integration or API |
| /// caller. |
| /// |
| /// Optional. |
| core.String? source; |
| |
| GoogleCloudDialogflowV2beta1WebhookResponse({ |
| this.endInteraction, |
| this.followupEventInput, |
| this.fulfillmentMessages, |
| this.fulfillmentText, |
| this.liveAgentHandoff, |
| this.outputContexts, |
| this.payload, |
| this.sessionEntityTypes, |
| this.source, |
| }); |
| |
| GoogleCloudDialogflowV2beta1WebhookResponse.fromJson(core.Map _json) |
| : this( |
| endInteraction: _json.containsKey('endInteraction') |
| ? _json['endInteraction'] as core.bool |
| : null, |
| followupEventInput: _json.containsKey('followupEventInput') |
| ? GoogleCloudDialogflowV2beta1EventInput.fromJson( |
| _json['followupEventInput'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| fulfillmentMessages: _json.containsKey('fulfillmentMessages') |
| ? (_json['fulfillmentMessages'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1IntentMessage>((value) => |
| GoogleCloudDialogflowV2beta1IntentMessage.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| fulfillmentText: _json.containsKey('fulfillmentText') |
| ? _json['fulfillmentText'] as core.String |
| : null, |
| liveAgentHandoff: _json.containsKey('liveAgentHandoff') |
| ? _json['liveAgentHandoff'] as core.bool |
| : null, |
| outputContexts: _json.containsKey('outputContexts') |
| ? (_json['outputContexts'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1Context>((value) => |
| GoogleCloudDialogflowV2beta1Context.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| payload: _json.containsKey('payload') |
| ? (_json['payload'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| sessionEntityTypes: _json.containsKey('sessionEntityTypes') |
| ? (_json['sessionEntityTypes'] as core.List) |
| .map<GoogleCloudDialogflowV2beta1SessionEntityType>((value) => |
| GoogleCloudDialogflowV2beta1SessionEntityType.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| source: _json.containsKey('source') |
| ? _json['source'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (endInteraction != null) 'endInteraction': endInteraction!, |
| if (followupEventInput != null) |
| 'followupEventInput': followupEventInput!.toJson(), |
| if (fulfillmentMessages != null) |
| 'fulfillmentMessages': |
| fulfillmentMessages!.map((value) => value.toJson()).toList(), |
| if (fulfillmentText != null) 'fulfillmentText': fulfillmentText!, |
| if (liveAgentHandoff != null) 'liveAgentHandoff': liveAgentHandoff!, |
| if (outputContexts != null) |
| 'outputContexts': |
| outputContexts!.map((value) => value.toJson()).toList(), |
| if (payload != null) 'payload': payload!, |
| if (sessionEntityTypes != null) |
| 'sessionEntityTypes': |
| sessionEntityTypes!.map((value) => value.toJson()).toList(), |
| if (source != null) 'source': source!, |
| }; |
| } |
| |
| /// Metadata for CreateDocument operation. |
| class GoogleCloudDialogflowV3alpha1CreateDocumentOperationMetadata { |
| /// The generic information of the operation. |
| GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata? |
| genericMetadata; |
| |
| GoogleCloudDialogflowV3alpha1CreateDocumentOperationMetadata({ |
| this.genericMetadata, |
| }); |
| |
| GoogleCloudDialogflowV3alpha1CreateDocumentOperationMetadata.fromJson( |
| core.Map _json) |
| : this( |
| genericMetadata: _json.containsKey('genericMetadata') |
| ? GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata |
| .fromJson(_json['genericMetadata'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (genericMetadata != null) |
| 'genericMetadata': genericMetadata!.toJson(), |
| }; |
| } |
| |
| /// Metadata for DeleteDocument operation. |
| class GoogleCloudDialogflowV3alpha1DeleteDocumentOperationMetadata { |
| /// The generic information of the operation. |
| GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata? |
| genericMetadata; |
| |
| GoogleCloudDialogflowV3alpha1DeleteDocumentOperationMetadata({ |
| this.genericMetadata, |
| }); |
| |
| GoogleCloudDialogflowV3alpha1DeleteDocumentOperationMetadata.fromJson( |
| core.Map _json) |
| : this( |
| genericMetadata: _json.containsKey('genericMetadata') |
| ? GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata |
| .fromJson(_json['genericMetadata'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (genericMetadata != null) |
| 'genericMetadata': genericMetadata!.toJson(), |
| }; |
| } |
| |
| /// Metadata in google::longrunning::Operation for Knowledge operations. |
| class GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata { |
| /// The current state of this operation. |
| /// |
| /// Required. Output only. |
| /// Possible string values are: |
| /// - "STATE_UNSPECIFIED" : State unspecified. |
| /// - "PENDING" : The operation has been created. |
| /// - "RUNNING" : The operation is currently running. |
| /// - "DONE" : The operation is done, either cancelled or completed. |
| core.String? state; |
| |
| GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata({ |
| this.state, |
| }); |
| |
| GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata.fromJson( |
| core.Map _json) |
| : this( |
| state: |
| _json.containsKey('state') ? _json['state'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (state != null) 'state': state!, |
| }; |
| } |
| |
| /// Metadata for ImportDocuments operation. |
| class GoogleCloudDialogflowV3alpha1ImportDocumentsOperationMetadata { |
| /// The generic information of the operation. |
| GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata? |
| genericMetadata; |
| |
| GoogleCloudDialogflowV3alpha1ImportDocumentsOperationMetadata({ |
| this.genericMetadata, |
| }); |
| |
| GoogleCloudDialogflowV3alpha1ImportDocumentsOperationMetadata.fromJson( |
| core.Map _json) |
| : this( |
| genericMetadata: _json.containsKey('genericMetadata') |
| ? GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata |
| .fromJson(_json['genericMetadata'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (genericMetadata != null) |
| 'genericMetadata': genericMetadata!.toJson(), |
| }; |
| } |
| |
| /// Response message for Documents.ImportDocuments. |
| class GoogleCloudDialogflowV3alpha1ImportDocumentsResponse { |
| /// Includes details about skipped documents or any other warnings. |
| core.List<GoogleRpcStatus>? warnings; |
| |
| GoogleCloudDialogflowV3alpha1ImportDocumentsResponse({ |
| this.warnings, |
| }); |
| |
| GoogleCloudDialogflowV3alpha1ImportDocumentsResponse.fromJson(core.Map _json) |
| : this( |
| warnings: _json.containsKey('warnings') |
| ? (_json['warnings'] as core.List) |
| .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (warnings != null) |
| 'warnings': warnings!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// Metadata for ReloadDocument operation. |
| class GoogleCloudDialogflowV3alpha1ReloadDocumentOperationMetadata { |
| /// The generic information of the operation. |
| GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata? |
| genericMetadata; |
| |
| GoogleCloudDialogflowV3alpha1ReloadDocumentOperationMetadata({ |
| this.genericMetadata, |
| }); |
| |
| GoogleCloudDialogflowV3alpha1ReloadDocumentOperationMetadata.fromJson( |
| core.Map _json) |
| : this( |
| genericMetadata: _json.containsKey('genericMetadata') |
| ? GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata |
| .fromJson(_json['genericMetadata'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (genericMetadata != null) |
| 'genericMetadata': genericMetadata!.toJson(), |
| }; |
| } |
| |
| /// Metadata for UpdateDocument operation. |
| class GoogleCloudDialogflowV3alpha1UpdateDocumentOperationMetadata { |
| /// The generic information of the operation. |
| GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata? |
| genericMetadata; |
| |
| GoogleCloudDialogflowV3alpha1UpdateDocumentOperationMetadata({ |
| this.genericMetadata, |
| }); |
| |
| GoogleCloudDialogflowV3alpha1UpdateDocumentOperationMetadata.fromJson( |
| core.Map _json) |
| : this( |
| genericMetadata: _json.containsKey('genericMetadata') |
| ? GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata |
| .fromJson(_json['genericMetadata'] |
| as core.Map<core.String, core.dynamic>) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (genericMetadata != null) |
| 'genericMetadata': genericMetadata!.toJson(), |
| }; |
| } |
| |
| /// The response message for Locations.ListLocations. |
| class GoogleCloudLocationListLocationsResponse { |
| /// A list of locations that matches the specified filter in the request. |
| core.List<GoogleCloudLocationLocation>? locations; |
| |
| /// The standard List next-page token. |
| core.String? nextPageToken; |
| |
| GoogleCloudLocationListLocationsResponse({ |
| this.locations, |
| this.nextPageToken, |
| }); |
| |
| GoogleCloudLocationListLocationsResponse.fromJson(core.Map _json) |
| : this( |
| locations: _json.containsKey('locations') |
| ? (_json['locations'] as core.List) |
| .map<GoogleCloudLocationLocation>((value) => |
| GoogleCloudLocationLocation.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| nextPageToken: _json.containsKey('nextPageToken') |
| ? _json['nextPageToken'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (locations != null) |
| 'locations': locations!.map((value) => value.toJson()).toList(), |
| if (nextPageToken != null) 'nextPageToken': nextPageToken!, |
| }; |
| } |
| |
| /// A resource that represents Google Cloud Platform location. |
| class GoogleCloudLocationLocation { |
| /// The friendly name for this location, typically a nearby city name. |
| /// |
| /// For example, "Tokyo". |
| core.String? displayName; |
| |
| /// Cross-service attributes for the location. |
| /// |
| /// For example {"cloud.googleapis.com/region": "us-east1"} |
| core.Map<core.String, core.String>? labels; |
| |
| /// The canonical id for this location. |
| /// |
| /// For example: `"us-east1"`. |
| core.String? locationId; |
| |
| /// Service-specific metadata. |
| /// |
| /// For example the available capacity at the given location. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? metadata; |
| |
| /// Resource name for the location, which may vary between implementations. |
| /// |
| /// For example: `"projects/example-project/locations/us-east1"` |
| core.String? name; |
| |
| GoogleCloudLocationLocation({ |
| this.displayName, |
| this.labels, |
| this.locationId, |
| this.metadata, |
| this.name, |
| }); |
| |
| GoogleCloudLocationLocation.fromJson(core.Map _json) |
| : this( |
| displayName: _json.containsKey('displayName') |
| ? _json['displayName'] as core.String |
| : null, |
| labels: _json.containsKey('labels') |
| ? (_json['labels'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.String, |
| ), |
| ) |
| : null, |
| locationId: _json.containsKey('locationId') |
| ? _json['locationId'] as core.String |
| : null, |
| metadata: _json.containsKey('metadata') |
| ? (_json['metadata'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (displayName != null) 'displayName': displayName!, |
| if (labels != null) 'labels': labels!, |
| if (locationId != null) 'locationId': locationId!, |
| if (metadata != null) 'metadata': metadata!, |
| if (name != null) 'name': name!, |
| }; |
| } |
| |
| /// The response message for Operations.ListOperations. |
| class GoogleLongrunningListOperationsResponse { |
| /// The standard List next-page token. |
| core.String? nextPageToken; |
| |
| /// A list of operations that matches the specified filter in the request. |
| core.List<GoogleLongrunningOperation>? operations; |
| |
| GoogleLongrunningListOperationsResponse({ |
| this.nextPageToken, |
| this.operations, |
| }); |
| |
| GoogleLongrunningListOperationsResponse.fromJson(core.Map _json) |
| : this( |
| nextPageToken: _json.containsKey('nextPageToken') |
| ? _json['nextPageToken'] as core.String |
| : null, |
| operations: _json.containsKey('operations') |
| ? (_json['operations'] as core.List) |
| .map<GoogleLongrunningOperation>((value) => |
| GoogleLongrunningOperation.fromJson( |
| value as core.Map<core.String, core.dynamic>)) |
| .toList() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (nextPageToken != null) 'nextPageToken': nextPageToken!, |
| if (operations != null) |
| 'operations': operations!.map((value) => value.toJson()).toList(), |
| }; |
| } |
| |
| /// This resource represents a long-running operation that is the result of a |
| /// network API call. |
| class GoogleLongrunningOperation { |
| /// If the value is `false`, it means the operation is still in progress. |
| /// |
| /// If `true`, the operation is completed, and either `error` or `response` is |
| /// available. |
| core.bool? done; |
| |
| /// The error result of the operation in case of failure or cancellation. |
| GoogleRpcStatus? error; |
| |
| /// Service-specific metadata associated with the operation. |
| /// |
| /// It typically contains progress information and common metadata such as |
| /// create time. Some services might not provide such metadata. Any method |
| /// that returns a long-running operation should document the metadata type, |
| /// if any. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? metadata; |
| |
| /// The server-assigned name, which is only unique within the same service |
| /// that originally returns it. |
| /// |
| /// If you use the default HTTP mapping, the `name` should be a resource name |
| /// ending with `operations/{unique_id}`. |
| core.String? name; |
| |
| /// The normal response of the operation in case of success. |
| /// |
| /// If the original method returns no data on success, such as `Delete`, the |
| /// response is `google.protobuf.Empty`. If the original method is standard |
| /// `Get`/`Create`/`Update`, the response should be the resource. For other |
| /// methods, the response should have the type `XxxResponse`, where `Xxx` is |
| /// the original method name. For example, if the original method name is |
| /// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.Map<core.String, core.Object>? response; |
| |
| GoogleLongrunningOperation({ |
| this.done, |
| this.error, |
| this.metadata, |
| this.name, |
| this.response, |
| }); |
| |
| GoogleLongrunningOperation.fromJson(core.Map _json) |
| : this( |
| done: _json.containsKey('done') ? _json['done'] as core.bool : null, |
| error: _json.containsKey('error') |
| ? GoogleRpcStatus.fromJson( |
| _json['error'] as core.Map<core.String, core.dynamic>) |
| : null, |
| metadata: _json.containsKey('metadata') |
| ? (_json['metadata'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| name: _json.containsKey('name') ? _json['name'] as core.String : null, |
| response: _json.containsKey('response') |
| ? (_json['response'] as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| ) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (done != null) 'done': done!, |
| if (error != null) 'error': error!.toJson(), |
| if (metadata != null) 'metadata': metadata!, |
| if (name != null) 'name': name!, |
| if (response != null) 'response': response!, |
| }; |
| } |
| |
| /// A generic empty message that you can re-use to avoid defining duplicated |
| /// empty messages in your APIs. |
| /// |
| /// A typical example is to use it as the request or the response type of an API |
| /// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns |
| /// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON |
| /// object `{}`. |
| class GoogleProtobufEmpty { |
| GoogleProtobufEmpty(); |
| |
| GoogleProtobufEmpty.fromJson( |
| // ignore: avoid_unused_constructor_parameters |
| core.Map _json); |
| |
| core.Map<core.String, core.dynamic> toJson() => {}; |
| } |
| |
| /// The `Status` type defines a logical error model that is suitable for |
| /// different programming environments, including REST APIs and RPC APIs. |
| /// |
| /// It is used by [gRPC](https://github.com/grpc). Each `Status` message |
| /// contains three pieces of data: error code, error message, and error details. |
| /// You can find out more about this error model and how to work with it in the |
| /// [API Design Guide](https://cloud.google.com/apis/design/errors). |
| class GoogleRpcStatus { |
| /// The status code, which should be an enum value of google.rpc.Code. |
| core.int? code; |
| |
| /// A list of messages that carry the error details. |
| /// |
| /// There is a common set of message types for APIs to use. |
| /// |
| /// The values for Object must be JSON objects. It can consist of `num`, |
| /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| core.List<core.Map<core.String, core.Object>>? details; |
| |
| /// A developer-facing error message, which should be in English. |
| /// |
| /// Any user-facing error message should be localized and sent in the |
| /// google.rpc.Status.details field, or localized by the client. |
| core.String? message; |
| |
| GoogleRpcStatus({ |
| this.code, |
| this.details, |
| this.message, |
| }); |
| |
| GoogleRpcStatus.fromJson(core.Map _json) |
| : this( |
| code: _json.containsKey('code') ? _json['code'] as core.int : null, |
| details: _json.containsKey('details') |
| ? (_json['details'] as core.List) |
| .map<core.Map<core.String, core.Object>>((value) => |
| (value as core.Map<core.String, core.dynamic>).map( |
| (key, item) => core.MapEntry( |
| key, |
| item as core.Object, |
| ), |
| )) |
| .toList() |
| : null, |
| message: _json.containsKey('message') |
| ? _json['message'] as core.String |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (code != null) 'code': code!, |
| if (details != null) 'details': details!, |
| if (message != null) 'message': message!, |
| }; |
| } |
| |
| /// An object that represents a latitude/longitude pair. |
| /// |
| /// This is expressed as a pair of doubles to represent degrees latitude and |
| /// degrees longitude. Unless specified otherwise, this object must conform to |
| /// the WGS84 standard. Values must be within normalized ranges. |
| class GoogleTypeLatLng { |
| /// The latitude in degrees. |
| /// |
| /// It must be in the range \[-90.0, +90.0\]. |
| core.double? latitude; |
| |
| /// The longitude in degrees. |
| /// |
| /// It must be in the range \[-180.0, +180.0\]. |
| core.double? longitude; |
| |
| GoogleTypeLatLng({ |
| this.latitude, |
| this.longitude, |
| }); |
| |
| GoogleTypeLatLng.fromJson(core.Map _json) |
| : this( |
| latitude: _json.containsKey('latitude') |
| ? (_json['latitude'] as core.num).toDouble() |
| : null, |
| longitude: _json.containsKey('longitude') |
| ? (_json['longitude'] as core.num).toDouble() |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() => { |
| if (latitude != null) 'latitude': latitude!, |
| if (longitude != null) 'longitude': longitude!, |
| }; |
| } |